-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark signatures by revoked keys as untrusted
RPMRC_NOKEY means that RPM does not have the key at all. In the case of a signature by a revoked subkey, RPM *does* have the key; it is just refusing to trust it. Therefore, RPMRC_NOTTRUSTED is the correct return code. The same is true if a subkey is incapable of signing: RPM has the key, but is refusing to trust signatures made by it.
- Loading branch information
Showing
4 changed files
with
81 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,7 +201,7 @@ runroot rpm -qi gpg-pubkey-1964c5fc-58e63918|grep -v Date|grep -v Version: | |
runroot rpm -q --provides gpg-pubkey-1964c5fc-58e63918 | ||
], | ||
[0], | ||
[Name : gpg-pubkey | ||
[[Name : gpg-pubkey | ||
Version : 1964c5fc | ||
Release : 58e63918 | ||
Architecture: (none) | ||
|
@@ -247,7 +247,9 @@ UNW2iqnN3BA7guhOv6OMiROF1+I7Q5nWT63mQC7IgQ== | |
gpg(rpm.org RSA testkey <[email protected]>) = 4:4344591e1964c5fc-58e63918 | ||
gpg(1964c5fc) = 4:4344591e1964c5fc-58e63918 | ||
gpg(4344591e1964c5fc) = 4:4344591e1964c5fc-58e63918 | ||
], | ||
gpg(f00650f8) = 4:185e6146f00650f8-58e63918 | ||
gpg(185e6146f00650f8) = 4:185e6146f00650f8-58e63918 | ||
]], | ||
[]) | ||
AT_CLEANUP | ||
|
||
|
@@ -368,6 +370,10 @@ gpg(a0e0c1c7) = 4:9dd6f039a0e0c1c7-623f6177 | |
gpg(9dd6f039a0e0c1c7) = 4:9dd6f039a0e0c1c7-623f6177 | ||
gpg(f5757247) = 4:a9ecf25cf5757247-623f5e9e | ||
gpg(a9ecf25cf5757247) = 4:a9ecf25cf5757247-623f5e9e | ||
gpg(7bab107a) = 4:dbf8808f7bab107a-623f5eb6 | ||
gpg(dbf8808f7bab107a) = 4:dbf8808f7bab107a-623f5eb6 | ||
gpg(63e4b138) = 4:511ed0d463e4b138-623f5f69 | ||
gpg(511ed0d463e4b138) = 4:511ed0d463e4b138-623f5f69 | ||
]], | ||
[]) | ||
AT_CLEANUP | ||
|
@@ -446,6 +452,10 @@ gpg(a0e0c1c7) = 4:9dd6f039a0e0c1c7-623f6177 | |
gpg(9dd6f039a0e0c1c7) = 4:9dd6f039a0e0c1c7-623f6177 | ||
gpg(f5757247) = 4:a9ecf25cf5757247-623f5e9e | ||
gpg(a9ecf25cf5757247) = 4:a9ecf25cf5757247-623f5e9e | ||
gpg(7bab107a) = 4:dbf8808f7bab107a-623f5eb6 | ||
gpg(dbf8808f7bab107a) = 4:dbf8808f7bab107a-623f5eb6 | ||
gpg(63e4b138) = 4:511ed0d463e4b138-623f5f69 | ||
gpg(511ed0d463e4b138) = 4:511ed0d463e4b138-623f5f69 | ||
]], | ||
[]) | ||
AT_CLEANUP | ||
|
@@ -505,6 +515,8 @@ chEM | |
gpg(Another complex test key <[email protected]>) = 4:d115be9bebddd264-623f8f42 | ||
gpg(ebddd264) = 4:d115be9bebddd264-623f8f42 | ||
gpg(d115be9bebddd264) = 4:d115be9bebddd264-623f8f42 | ||
gpg(6c8ea995) = 4:026746b46c8ea995-623f8f5b | ||
gpg(026746b46c8ea995) = 4:026746b46c8ea995-623f8f5b | ||
gpg(ac1fbf3d) = 4:cb2e24c7ac1fbf3d-623f8fab | ||
gpg(cb2e24c7ac1fbf3d) = 4:cb2e24c7ac1fbf3d-623f8fab | ||
]],) | ||
|
@@ -602,6 +614,56 @@ runroot rpmkeys -Kv --nosignature /data/RPMS/hello-2.0-1.x86_64-signed.rpm; echo | |
[]) | ||
AT_CLEANUP | ||
|
||
# ------------------------------ | ||
# Test pre-built package verification (revoked subkey) | ||
AT_SETUP([rpmkeys -Kv <signed with revoked subkey> 1]) | ||
AT_KEYWORDS([rpmkeys digest signature]) | ||
AT_CHECK([ | ||
RPMDB_INIT | ||
|
||
runroot rpmkeys --define '_pkgverify_level all' -Kv /data/RPMS/hello-2.0-1.x86_64-signed-revoked.rpm; echo $? | ||
runroot rpmkeys --import /data/keys/rpm.org-ed25519-subkey-2-test.pub; echo $? | ||
runroot rpmkeys --define '_pkgverify_level all' -Kv /data/RPMS/hello-2.0-1.x86_64-signed-revoked.rpm; echo $? | ||
runroot rpmkeys --define '_pkgverify_level all' -Kv --nodigest /data/RPMS/hello-2.0-1.x86_64-signed-revoked.rpm; echo $? | ||
runroot rpmkeys --define '_pkgverify_level all' -Kv --nosignature /data/RPMS/hello-2.0-1.x86_64-signed-revoked.rpm; echo $? | ||
], | ||
[0], | ||
[[/data/RPMS/hello-2.0-1.x86_64-signed-revoked.rpm: | ||
Header V4 EdDSA/SHA512 Signature, key ID 7bab107a: NOKEY | ||
Header RSA signature: NOTFOUND | ||
Header SHA256 digest: OK | ||
Header SHA1 digest: OK | ||
Payload SHA256 digest: OK | ||
RSA signature: NOTFOUND | ||
DSA signature: NOTFOUND | ||
MD5 digest: OK | ||
1 | ||
0 | ||
/data/RPMS/hello-2.0-1.x86_64-signed-revoked.rpm: | ||
Header V4 EdDSA/SHA512 Signature, key ID 7bab107a: NOTTRUSTED | ||
Header RSA signature: NOTFOUND | ||
Header SHA256 digest: OK | ||
Header SHA1 digest: OK | ||
Payload SHA256 digest: OK | ||
RSA signature: NOTFOUND | ||
DSA signature: NOTFOUND | ||
MD5 digest: OK | ||
1 | ||
/data/RPMS/hello-2.0-1.x86_64-signed-revoked.rpm: | ||
Header V4 EdDSA/SHA512 Signature, key ID 7bab107a: NOTTRUSTED | ||
Header RSA signature: NOTFOUND | ||
RSA signature: NOTFOUND | ||
DSA signature: NOTFOUND | ||
1 | ||
/data/RPMS/hello-2.0-1.x86_64-signed-revoked.rpm: | ||
Header SHA256 digest: OK | ||
Header SHA1 digest: OK | ||
Payload SHA256 digest: OK | ||
MD5 digest: OK | ||
0 | ||
]], | ||
[]) | ||
AT_CLEANUP | ||
# ------------------------------ | ||
# Test pre-built corrupted package verification (corrupted signature) | ||
AT_SETUP([rpmkeys -Kv <corrupted signed> 1]) | ||
|