commit:     2cb33d9f2ef99beb596b5d56d58346ee1b8c2204
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 26 09:11:23 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jan 27 07:06:47 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cb33d9f

verify-sig.eclass: Allow whitespace in openssl-dgst format

Permit whitespace when verifying openssl-dgst format, to make it also
work for the shasum format used by tarsnap.  However, given the changes
seem to be merely whitespace, just accept both rather than having two
confusing names for them.

    openssl-dgst: SHA256(filename)=digest
    shasum: SHA256 (filename) = digest

Closes: https://bugs.gentoo.org/969167
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/25
Merges: https://codeberg.org/gentoo/gentoo/pulls/25

 eclass/verify-sig.eclass | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
index 823e8f02a2c9..d9aa60152a09 100644
--- a/eclass/verify-sig.eclass
+++ b/eclass/verify-sig.eclass
@@ -344,11 +344,10 @@ verify-sig_verify_unsigned_checksums() {
                                [[ -n ${junk} ]] && continue
                                ;;
                        openssl-dgst)
-                               [[ ${line} != *"("*")="* ]] && continue
-                               checksum=${line##*)=}
-                               algo=${line%%(*}
-                               filename=${line#*(}
-                               filename=${filename%)=*}
+                               [[ ${line} =~ 
^([[:alnum:]]+)[[:space:]]*[(](.*)[)][[:space:]]*=[[:space:]]*([0-9a-fA-F]+)$ 
]] || continue
+                               algo=${BASH_REMATCH[1]}
+                               filename=${BASH_REMATCH[2]}
+                               checksum=${BASH_REMATCH[3]}
                                ;;
                esac
 

Reply via email to