summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-09-03 17:02:22 +0200
committerMichał Górny <mgorny@gentoo.org>2023-09-14 07:30:11 +0200
commit89076704440410a8f87d8278363051856a91f88e (patch)
treeb2b7278dc602bb189cea19df57adeb5653b357f0 /eclass/verify-sig.eclass
parentverify-sig.eclass: Support `openssl dgst` format checksums (diff)
downloadgentoo-89076704440410a8f87d8278363051856a91f88e.tar.gz
gentoo-89076704440410a8f87d8278363051856a91f88e.tar.bz2
gentoo-89076704440410a8f87d8278363051856a91f88e.zip
verify-sig.eclass: Fix handling multiple/duplicate signatures
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/verify-sig.eclass')
-rw-r--r--eclass/verify-sig.eclass5
1 files changed, 3 insertions, 2 deletions
diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
index 815299b419ed..010361bfbc98 100644
--- a/eclass/verify-sig.eclass
+++ b/eclass/verify-sig.eclass
@@ -252,6 +252,7 @@ verify-sig_verify_unsigned_checksums() {
[[ ${checksum_file} == - ]] && checksum_file=/dev/stdin
local line checksum filename junk ret=0 count=0
+ local -A verified
while read -r line; do
if [[ ${line} == "-----BEGIN"* ]]; then
die "${FUNCNAME}: PGP armor found, use verify-sig_verify_signed_checksums instead"
@@ -278,7 +279,7 @@ verify-sig_verify_unsigned_checksums() {
fi
if "${algo,,}sum" -c --strict - <<<"${checksum} ${filename}"; then
- (( count++ ))
+ verified["${filename}"]=1
else
ret=1
fi
@@ -286,7 +287,7 @@ verify-sig_verify_unsigned_checksums() {
[[ ${ret} -eq 0 ]] ||
die "${FUNCNAME}: at least one file did not verify successfully"
- [[ ${count} -eq ${#files[@]} ]] ||
+ [[ ${#verified[@]} -eq ${#files[@]} ]] ||
die "${FUNCNAME}: checksums for some of the specified files were missing"
}