aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-07-14 14:10:08 +0200
committerFabian Groffen <grobian@gentoo.org>2019-07-14 14:10:08 +0200
commit2e4b280488b5f030a6e735060bb73667d1533fab (patch)
treeab36d77f4e0ae9d9b6723df0e85bfe2205f7807b /qmanifest.c
parentqsize: add -F argument, changed default format to match other applets (diff)
downloadportage-utils-2e4b280488b5f030a6e735060bb73667d1533fab.tar.gz
portage-utils-2e4b280488b5f030a6e735060bb73667d1533fab.tar.bz2
portage-utils-2e4b280488b5f030a6e735060bb73667d1533fab.zip
libq/hash: ensure hash_compute_file operates on hashes requested
thinko probably due to extraction from hashgen at some point, pass hashes with the function call, so it operates on the hashes the caller wants it to. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qmanifest.c')
-rw-r--r--qmanifest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qmanifest.c b/qmanifest.c
index 21254c3..41faa4c 100644
--- a/qmanifest.c
+++ b/qmanifest.c
@@ -201,7 +201,7 @@ write_hashes(
update_times(tv, &s);
- hash_compute_file(fname, sha256, sha512, whrlpl, blak2b, &flen);
+ hash_compute_file(fname, sha256, sha512, whrlpl, blak2b, &flen, hashes);
len = snprintf(data, sizeof(data), "%s %s %zd", type, name, flen);
if (hashes & HASH_BLAKE2B)
@@ -1027,7 +1027,7 @@ verify_file(const char *dir, char *mfline, const char *mfest, verify_msg **msgs)
sha256[0] = sha512[0] = whrlpl[0] = blak2b[0] = '\0';
snprintf(buf, sizeof(buf), "%s/%s", dir, path);
- hash_compute_file(buf, sha256, sha512, whrlpl, blak2b, &flen);
+ hash_compute_file(buf, sha256, sha512, whrlpl, blak2b, &flen, hashes);
if (flen == 0) {
msgs_add(msgs, mfest, path, "cannot open file!");