forked from rpm-software-management/rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from short keyid to fingerprint on key update
Remove old entries based on short keyid when key is updated via --import. Related: rpm-software-management#3360
- Loading branch information
Showing
3 changed files
with
69 additions
and
2 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
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 |
---|---|---|
|
@@ -100,6 +100,67 @@ runroot rpmkeys --list | |
[]) | ||
RPMTEST_CLEANUP | ||
|
||
AT_SETUP([rpmkeys migrate from keyid to fingerprint (rpmdb)]) | ||
AT_KEYWORDS([rpmkeys rpmdb]) | ||
RPMDB_INIT | ||
RPMTEST_CHECK([ | ||
runroot rpm -q --dbpath /data/misc/ gpg-pubkey | ||
], | ||
[0], | ||
[gpg-pubkey-1964c5fc-58e63918 | ||
], | ||
[]) | ||
|
||
RPMTEST_CHECK([ | ||
runroot rpmkeys --import --dbpath /data/misc/ /data/keys/rpm.org-rsa-2048-add-subkey.asc | ||
], | ||
[0], | ||
[], | ||
[]) | ||
|
||
RPMTEST_CHECK([ | ||
runroot rpm -q --dbpath /data/misc/ gpg-pubkey | ||
], | ||
[0], | ||
[gpg-pubkey-771b18d3d7baa28734333c424344591e1964c5fc-58e63918 | ||
], | ||
[]) | ||
RPMTEST_CLEANUP | ||
|
||
AT_SETUP([rpmkeys migrate from keyid to fingerprint (fs)]) | ||
AT_KEYWORDS([rpmkeys rpmdb]) | ||
RPMDB_INIT | ||
# root's .rpmmacros used to keep this build prefix independent | ||
echo "%_keyring fs" >> "${RPMTEST}"/root/.rpmmacros | ||
|
||
RPMTEST_CHECK([ | ||
runroot rpmkeys --import /data/keys/rpm.org-rsa-2048-test.pub | ||
runroot_other mv /var/lib/rpm/pubkeys/gpg-pubkey-771b18d3d7baa28734333c424344591e1964c5fc-58e63918.key /var/lib/rpm/pubkeys/gpg-pubkey-1964c5fc-58e63918.key | ||
runroot_other ls /var/lib/rpm/pubkeys/ | ||
runroot rpmkeys --list | ||
], | ||
[0], | ||
[gpg-pubkey-1964c5fc-58e63918.key | ||
771b18d3d7baa28734333c424344591e1964c5fc rpm.org RSA testkey <[email protected]> public key | ||
], | ||
[]) | ||
|
||
RPMTEST_CHECK([ | ||
runroot rpmkeys --import /data/keys/rpm.org-rsa-2048-add-subkey.asc | ||
], | ||
[0], | ||
[], | ||
[]) | ||
|
||
RPMTEST_CHECK([ | ||
runroot_other ls /var/lib/rpm/pubkeys/ | ||
], | ||
[0], | ||
[gpg-pubkey-771b18d3d7baa28734333c424344591e1964c5fc-58e63918.key | ||
], | ||
[]) | ||
RPMTEST_CLEANUP | ||
|
||
AT_SETUP([rpmkeys key update (fs)]) | ||
AT_KEYWORDS([rpmkeys signature]) | ||
RPMDB_INIT | ||
|