diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-20 11:13:03 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-20 11:13:03 +0300 |
commit | eca9c22205105eba20e1e28ddae8ad9da81c5323 (patch) | |
tree | 3a31082b2a5082c10047249a0348478f77c93cf7 /src/verify.c | |
parent | 99be653f141f57e1474bd645efd770aa3e3bd68f (diff) | |
download | apk-tools-eca9c22205105eba20e1e28ddae8ad9da81c5323.tar.gz apk-tools-eca9c22205105eba20e1e28ddae8ad9da81c5323.tar.bz2 apk-tools-eca9c22205105eba20e1e28ddae8ad9da81c5323.tar.xz apk-tools-eca9c22205105eba20e1e28ddae8ad9da81c5323.zip |
db: signed index loading (ref #46)
prefer index in the new format as signed .tar.gz.
Diffstat (limited to 'src/verify.c')
-rw-r--r-- | src/verify.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/verify.c b/src/verify.c index 2fed4bd..1edf4e7 100644 --- a/src/verify.c +++ b/src/verify.c @@ -16,14 +16,16 @@ static int verify_main(void *ctx, int argc, char **argv) { - struct apk_database db; struct apk_sign_ctx sctx; - int i, ok, rc = 0; + struct apk_istream *is; + int i, r, ok, rc = 0; - apk_db_open(&db, NULL, APK_OPENF_NO_STATE); for (i = 0; i < argc; i++) { - apk_sign_ctx_init(&sctx, APK_SIGN_VERIFY); - apk_pkg_read(&db, argv[i], &sctx); + apk_sign_ctx_init(&sctx, APK_SIGN_VERIFY, NULL); + is = apk_bstream_gunzip_mpart(apk_bstream_from_file(argv[i]), + apk_sign_ctx_mpart_cb, &sctx); + r = apk_tar_parse(is, apk_sign_ctx_verify_tar, &sctx); + is->close(is); ok = sctx.control_verified && sctx.data_verified; if (apk_verbosity >= 1) apk_message("%s: %s", argv[i], @@ -33,7 +35,6 @@ static int verify_main(void *ctx, int argc, char **argv) rc++; apk_sign_ctx_free(&sctx); } - apk_db_close(&db); return rc; } |