From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 2/5] verify-sig.eclass: Refactor code to use extra_args for all types
Date: Sat, 12 Oct 2024 20:52:03 +0200 [thread overview]
Message-ID: <20241012185704.771370-3-mgorny@gentoo.org> (raw)
In-Reply-To: <20241012185704.771370-1-mgorny@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/verify-sig.eclass | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
index b74ed78290aa..d601c7838a00 100644
--- a/eclass/verify-sig.eclass
+++ b/eclass/verify-sig.eclass
@@ -132,7 +132,6 @@ verify-sig_verify_detached() {
fi
local extra_args=()
- [[ ${VERIFY_SIG_OPENPGP_KEY_REFRESH} == yes ]] || extra_args+=( -R )
if [[ -n ${VERIFY_SIG_OPENPGP_KEYSERVER+1} ]]; then
[[ ${VERIFY_SIG_METHOD} == openpgp ]] ||
die "${FUNCNAME}: VERIFY_SIG_OPENPGP_KEYSERVER is not supported"
@@ -152,10 +151,15 @@ verify-sig_verify_detached() {
einfo "Verifying ${filename} ..."
case ${VERIFY_SIG_METHOD} in
minisig)
- minisign -V -P "$(<"${key}")" -x "${sig}" -m "${file}" ||
+ minisign "${extra_args[@]}" \
+ -V -P "$(<"${key}")" -x "${sig}" -m "${file}" ||
die "minisig signature verification failed"
;;
openpgp)
+ if [[ ${VERIFY_SIG_OPENPGP_KEY_REFRESH} != yes ]]; then
+ extra_args+=( -R )
+ fi
+
# gpg can't handle very long TMPDIR
# https://bugs.gentoo.org/854492
local -x TMPDIR=/tmp
@@ -165,7 +169,8 @@ verify-sig_verify_detached() {
die "PGP signature verification failed"
;;
signify)
- signify -V -p "${key}" -m "${file}" -x "${sig}" ||
+ signify "${extra_args[@]}" \
+ -V -p "${key}" -m "${file}" -x "${sig}" ||
die "Signify signature verification failed"
;;
esac
--
2.47.0
next prev parent reply other threads:[~2024-10-12 18:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-12 18:52 [gentoo-dev] [PATCH 0/5] verify-sig.eclass: sigstore support Michał Górny
2024-10-12 18:52 ` [gentoo-dev] [PATCH 1/5] sec-keys/sigstore-trusted-root: New package, v0_p20241010 Michał Górny
2024-10-12 18:52 ` Michał Górny [this message]
2024-10-12 18:52 ` [gentoo-dev] [PATCH 3/5] verify-sig.eclass: Error out on invalid method+function combos Michał Górny
2024-10-12 18:52 ` [gentoo-dev] [PATCH 4/5] verify-sig.eclass: Add support for verifying sigstore signatures Michał Górny
2024-10-12 18:52 ` [gentoo-dev] [PATCH 5/5] dev-lang/python: Use sigstore in 3.13.0 (example) Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241012185704.771370-3-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox