Skip to content

Commit

Permalink
Fix rpmsign --key-id regression
Browse files Browse the repository at this point in the history
Commit d99186f failed to update
the popt alias to the new macro. So --key-id worked only if you
hadn't set %_openpgp_sign_id in your rpm macro config - the prime
case for wanting to use --key-id to override that choice. Doh.
Just goes to show what you don't test, really is broken by definition...
  • Loading branch information
pmatilai authored and ffesti committed Nov 6, 2024
1 parent 02f09b3 commit 3c06b9e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rpmpopt.in
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ rpmbuild alias --nodebuginfo --define 'debug_package %{nil}' \
rpmbuild alias --build-in-place --define '_build_in_place 1' \
--POPTdesc=$"run build in current directory on checked out sources"

rpmsign alias --key-id --define '_gpg_name !#:+' \
rpmsign alias --key-id --define '_openpgp_sign_id !#:+' \
--POPTdesc=$"key id/name to sign with" \
--POPTargs=$"<id>"
rpmsign alias --digest-algo --define '_gpg_digest_algo !#:+' \
Expand Down
16 changes: 14 additions & 2 deletions tests/rpmsigdig.at
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ RPMTEST_CLEANUP
# stderr is ignored due to noisy failures from gpgconf which we don't
# care about in this test...
AT_SETUP([rpmsign --addsign sequoia])
AT_KEYWORDS([rpmsign signature])
AT_KEYWORDS([rpmsign sequoia signature])
AT_SKIP_IF([test x$PGP = xdummy])
RPMDB_INIT

Expand All @@ -1311,7 +1311,7 @@ cat << EOF > ${HOME}/.rpmmacros
%_openpgp_sign_id 771B18D3D7BAA28734333C424344591E1964C5FC
EOF

runroot_other sq key import /data/keys/rpm.org-rsa-2048-test.secret
runroot_other sq key import /data/keys/*.secret
],
[0],
[ignore],
Expand Down Expand Up @@ -1340,6 +1340,18 @@ POST-DELSIGN
/tmp/hello-2.0-1.x86_64.rpm:
],
[ignore])

RPMTEST_CHECK([
runroot rpmsign --addsign --key-id 152bb32fd9ca982797e835cfb0645aec757bf69e /tmp/hello-2.0-1.x86_64.rpm > /dev/null
runroot rpmkeys -Kv /tmp/hello-2.0-1.x86_64.rpm
],
[1],
[/tmp/hello-2.0-1.x86_64.rpm:
Header V4 EdDSA/SHA512 signature, key ID b0645aec757bf69e: NOKEY
Header SHA256 digest: OK
Payload SHA256 digest: OK
],
[ignore])
RPMTEST_CLEANUP

# ------------------------------
Expand Down

0 comments on commit 3c06b9e

Please sign in to comment.