summaryrefslogtreecommitdiff
path: root/src/package.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-21 17:37:44 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-21 17:37:44 +0300
commit812483515ad95c84de9c49de28fbd5ee769facfc (patch)
treecccd65d2b463ff6440ac367701b97bbc6a5e80d0 /src/package.c
parent75802cb07dec505e381d01110a883f84a713ec19 (diff)
downloadapk-tools-812483515ad95c84de9c49de28fbd5ee769facfc.tar.gz
apk-tools-812483515ad95c84de9c49de28fbd5ee769facfc.tar.bz2
apk-tools-812483515ad95c84de9c49de28fbd5ee769facfc.tar.xz
apk-tools-812483515ad95c84de9c49de28fbd5ee769facfc.zip
pkg: fix indexing of multi-part apks
Diffstat (limited to 'src/package.c')
-rw-r--r--src/package.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/package.c b/src/package.c
index 78f7cb6..44b4232 100644
--- a/src/package.c
+++ b/src/package.c
@@ -447,7 +447,7 @@ int apk_sign_ctx_mpart_cb(void *ctx, int part, apk_blob_t data)
/* Package identity is checksum of control block */
sctx->identity.type = EVP_MD_CTX_size(&sctx->mdctx);
EVP_DigestFinal_ex(&sctx->mdctx, sctx->identity.data, NULL);
- return 1;
+ return -1000;
} else {
/* Reset digest for hashing data */
EVP_DigestFinal_ex(&sctx->mdctx, calculated, NULL);
@@ -702,7 +702,7 @@ struct apk_package *apk_pkg_read(struct apk_database *db, const char *file,
tar = apk_bstream_gunzip_mpart(bs, apk_sign_ctx_mpart_cb, sctx);
r = apk_tar_parse(tar, read_info_entry, &ctx);
tar->close(tar);
- if (r < 0)
+ if (r < 0 && r != -1000)
goto err;
if (ctx.pkg->name == NULL)
goto err;