You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
verify_git_signature fails with multi-key keyrings #3619
... the documentation does not mention anything about my problem
... there are no open or closed issues that are related to my problem
Description
The verify_git_signature built-in rego function fails to verify valid signatures when a keyring file contains multiple PGP keys, and the expected key is not the first key.
eg given a keys.asc like this:
-----BEGIN PGP PUBLIC KEY BLOCK----
[ Key A... ]
-----END PGP PUBLIC KEY BLOCK-----
-----BEGIN PGP PUBLIC KEY BLOCK----
[ Key B... ]
-----END PGP PUBLIC KEY BLOCK-----
And you have a tag that's signed by Key B, that you try to verify with verify_git_signature(input.git.tag, "keys.asc"), it only seems to parse the first key.
If you reverse the order of the keys, so Key B comes first, verification runs successfully.
Expected behaviour
It should look up all the keys in a file
Actual behaviour
Check fails even though signing key is in the keyring, it just isn't the first key
Activity