Commit 772e4aa2 authored by Timo Teräs's avatar Timo Teräs

various: fix installation of new style apks

parent 2345548e
......@@ -93,7 +93,7 @@ static size_t tar_entry_read(void *stream, void *ptr, size_t size)
return -1;
teis->bytes_left -= size;
if (teis->csum != NULL)
if (teis->csum == NULL)
return size;
EVP_DigestUpdate(&teis->mdctx, ptr, size);
......
......@@ -1284,8 +1284,7 @@ static int apk_db_install_archive_entry(void *_ctx,
const char *p;
int r = 0, type = APK_SCRIPT_INVALID;
if (apk_sign_ctx_process_file(&ctx->sctx, ae, is) == 0)
return 0;
apk_sign_ctx_verify_tar(&ctx->sctx, ae, is);
/* Package metainfo and script processing */
if (ae->name[0] == '.') {
......
......@@ -330,7 +330,8 @@ int apk_sign_ctx_process_file(struct apk_sign_ctx *ctx,
ctx->num_signatures++;
/* Found already a trusted key */
if (ctx->signature.pkey != NULL)
if (ctx->action != APK_SIGN_VERIFY ||
ctx->signature.pkey != NULL)
return 0;
if (strncmp(&fi->name[6], "RSA.", 4) == 0 ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment