mirror of
https://github.com/containers/skopeo.git
synced 2025-08-01 23:07:51 +00:00
Add a test for valid signature using an unknown public key
(The key was one-time-generated in a temporary directory, and is, intentionally, not available.) This is not conceptually related to the rest of the PR, just adding a missing case to the test, except that the added fixture will be reused in a prSignedBy test.
This commit is contained in:
parent
ee7c5ebae9
commit
e2839c38c5
BIN
signature/fixtures/unknown-key.signature
Normal file
BIN
signature/fixtures/unknown-key.signature
Normal file
Binary file not shown.
@ -138,5 +138,12 @@ func TestGPGSigningMechanismVerify(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
content, signingFingerprint, err = mech.Verify(signature)
|
||||
assertSigningError(t, content, signingFingerprint, err)
|
||||
|
||||
// Valid signature with an unknown key
|
||||
signature, err = ioutil.ReadFile("./fixtures/unknown-key.signature")
|
||||
require.NoError(t, err)
|
||||
content, signingFingerprint, err = mech.Verify(signature)
|
||||
assertSigningError(t, content, signingFingerprint, err)
|
||||
|
||||
// The various GPG/GPGME failures cases are not obviously easy to reach.
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user