X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=libopkg%2Fopkg_install.c;h=aae72be6cb0909e3c675468d3c7e1fdf9d165782;hb=31d07533a12024a5a6c6f50d538cacda055f57b8;hp=750ea652cf6229c55dd9903053091f70da3f2388;hpb=29b3b9d76a8d6b9af6d6465a9f501c2e5066bea0;p=oweals%2Fopkg-lede.git diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index 750ea65..aae72be 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -837,7 +837,7 @@ int opkg_install_pkg(opkg_conf_t *conf, pkg_t *pkg, int from_upgrade) } /* check that the repository is valid */ - #if HAVE_GPGME + #if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) char *list_file_name, *sig_file_name, *lists_dir; /* check to ensure the package has come from a repository */ @@ -852,8 +852,15 @@ int opkg_install_pkg(opkg_conf_t *conf, pkg_t *pkg, int from_upgrade) if (file_exists (sig_file_name)) { - if (opkg_verify_file (conf, list_file_name, sig_file_name)) + if (opkg_verify_file (conf, list_file_name, sig_file_name)){ + opkg_message(conf, OPKG_ERROR, "Failed to verify the signature of: %s\n", + list_file_name); return OPKG_INSTALL_ERR_SIGNATURE; + } + }else{ + opkg_message(conf, OPKG_ERROR, "Signature file is missing. " + "Perhaps you need to run 'opkg update'?\n"); + return OPKG_INSTALL_ERR_SIGNATURE; } free (lists_dir); @@ -890,6 +897,7 @@ int opkg_install_pkg(opkg_conf_t *conf, pkg_t *pkg, int from_upgrade) free(file_sha256); return OPKG_INSTALL_ERR_SHA256; } + free(file_sha256); } #endif