Skip to content

Commit

Permalink
Add "OpenPGP" to all signature verification related messages
Browse files Browse the repository at this point in the history
This clarifies what these things are - not raw DSA/RSA signatures but
OpenPGP signatures. It also opens the door for other types of signatures
somewhere in the future, even though no such things are in the plans
just now.

Most importantly though, this will be needed to make sense of these
messages with the multiple OpenPGP signature support where we no longer
know such algorithm details.

Related: rpm-software-management#3385
  • Loading branch information
pmatilai committed Nov 6, 2024
1 parent 02f09b3 commit 6bf2af8
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 119 deletions.
4 changes: 2 additions & 2 deletions lib/rpmvs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ const char *rpmsinfoDescr(struct rpmsinfo_s *sinfo)
case RPMSIG_SIGNATURE_TYPE:
if (sinfo->sig) {
char *t = pgpIdentItem(sinfo->sig);
rasprintf(&sinfo->descr, _("%s%s"),
rasprintf(&sinfo->descr, _("%sOpenPGP %s"),
rangeName(sinfo->range), t);
free(t);
} else {
rasprintf(&sinfo->descr, _("%s%s%s %s"),
rasprintf(&sinfo->descr, _("%sOpenPGP %s%s %s"),
rangeName(sinfo->range),
pgpValString(PGPVAL_PUBKEYALGO, sinfo->sigalgo),
sinfo->alt ? " ALT" : "",
Expand Down
20 changes: 10 additions & 10 deletions tests/rpmi.at
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ runroot rpm -U --ignorearch --ignoreos --nodeps \
],
[0],
[],
[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
])
RPMTEST_CLEANUP

Expand All @@ -308,8 +308,8 @@ runroot rpm -U --ignorearch --ignoreos --nodeps \
],
[1],
[],
[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
package hello-2.0-1.x86_64 does not verify: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
package hello-2.0-1.x86_64 does not verify: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
])
RPMTEST_CLEANUP

Expand Down Expand Up @@ -361,9 +361,9 @@ runroot rpm -U --ignorearch --ignoreos --nodeps \
[1],
[],
[`if test x$PGP = xlegacy; then
echo 'error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header RSA signature: BAD (package tag 268: invalid OpenPGP signature: Corrupt PGP packet)'
echo 'error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP RSA signature: BAD (package tag 268: invalid OpenPGP signature: Corrupt PGP packet)'
else
echo 'error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header RSA signature: BAD (package tag 268: invalid OpenPGP signature: Parsing an OpenPGP packet:'
echo 'error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP RSA signature: BAD (package tag 268: invalid OpenPGP signature: Parsing an OpenPGP packet:'
echo ' Failed to parse Signature Packet'
echo ' because: Malformed packet: Subpacket extends beyond the end of the subpacket area)'
fi`
Expand All @@ -387,7 +387,7 @@ runroot rpm -U --ignorearch --ignoreos --nodeps \
],
[1],
[],
[error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: BAD
[error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: BAD
error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header SHA256 digest: BAD (Expected ef920781af3bf072ae9888eec3de1c589143101dff9cc0b561468d395fb766d9 != 29fdfe92782fb0470a9a164a6c94af87d3b138c63b39d4c30e0223ca1202ba82)
error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header SHA1 digest: BAD (Expected 5cd9874c510b67b44483f9e382a1649ef7743bac != 4261b2c1eb861a4152c2239bce20bfbcaa8971ba)
error: /tmp/hello-2.0-1.x86_64-signed.rpm cannot be installed
Expand Down Expand Up @@ -434,19 +434,19 @@ runroot rpm -U --ignorearch --ignoreos --nodeps --noverify \
],
[1],
[INSTALL 1
warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
error: unpacking of archive failed: cpio: Bad magic
error: hello-2.0-1.x86_64: install failed
INSTALL 2
error: unpacking of archive failed: cpio: Bad magic
error: hello-2.0-1.x86_64: install failed
INSTALL 3
warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
package hello-2.0-1.x86_64 does not verify: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
package hello-2.0-1.x86_64 does not verify: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
INSTALL 4
package hello-2.0-1.x86_64 does not verify: no signature
INSTALL 5
warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
error: unpacking of archive failed: cpio: Bad magic
error: hello-2.0-1.x86_64: install failed
],
Expand Down
4 changes: 2 additions & 2 deletions tests/rpmpython.at
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ public key not available
public key not available
public key not available
],
[warning: /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm: Header V4 RSA/SHA512 signature, key ID 1f71177215217ee0: NOKEY
warning: /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm: Header V4 RSA/SHA512 signature, key ID 1f71177215217ee0: NOKEY]
[warning: /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm: Header OpenPGP V4 RSA/SHA512 signature, key ID 1f71177215217ee0: NOKEY
warning: /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm: Header OpenPGP V4 RSA/SHA512 signature, key ID 1f71177215217ee0: NOKEY]
)

RPMPY_TEST([transaction callback 1],[
Expand Down
2 changes: 1 addition & 1 deletion tests/rpmquery.at
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ runroot rpm \
],
[0],
[RSA/SHA256, Thu Apr 6 13:02:33 2017, Key ID 4344591e1964c5fc],
[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
])
RPMTEST_CLEANUP

Expand Down
Loading

0 comments on commit 6bf2af8

Please sign in to comment.