diff options
author | Reid Rankin <reidrankin@gmail.com> | 2020-01-23 16:04:01 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-01-24 05:11:58 +0200 |
commit | 1f9e56d8a4a0042816ea793c256101249541a8d1 (patch) | |
tree | 7b28446201efce70e8afee0222dac36fc387f2b5 /src/manifest.c | |
parent | 67696b2ac658ddea036a2b6b284df993c8363222 (diff) | |
download | apk-tools-1f9e56d8a4a0042816ea793c256101249541a8d1.tar.gz apk-tools-1f9e56d8a4a0042816ea793c256101249541a8d1.tar.bz2 apk-tools-1f9e56d8a4a0042816ea793c256101249541a8d1.tar.xz apk-tools-1f9e56d8a4a0042816ea793c256101249541a8d1.zip |
manifest: fix package file processing
This change ensures that apk_sign_ctx_process_file() and
apk_sign_ctx_parse_pkginfo_line() are called during archive
processing, allowing discovery of signatures and the data section
checksum.
Fixes a bug uncovered by commit f123d77e.
Diffstat (limited to 'src/manifest.c')
-rw-r--r-- | src/manifest.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/manifest.c b/src/manifest.c index b967143..145714c 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -64,11 +64,14 @@ static int read_file_entry(void *ctx, const struct apk_file_info *ae, struct manifest_file_ctx *mctx = ctx; char csum_buf[(APK_CHECKSUM_SHA1 * 2) + 1]; apk_blob_t csum_blob = APK_BLOB_BUF(csum_buf); + int r; - if (ae->name[0] == '.') { - if (!strncmp(ae->name, ".PKGINFO", 8) || !strncmp(ae->name, ".SIGN.", 6)) - return 0; - } + r = apk_sign_ctx_verify_tar(mctx->sctx, ae, is); + if (r != 0) + return r; + + if (!mctx->sctx->data_started) + return 0; if ((ae->mode & S_IFMT) != S_IFREG) return 0; |