-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPGSigner (and gpg.functions.create_signature) produce invalid signature dicts #448
Comments
|
More specifically, use "sig" as key name instead of "signature". This is absolutely an API break or all gpg users, but I am not sure if there are any: Without this fix GPGSigner produces values that are not TUF compatible... Fixes secure-systems-lab#448
WRT possible fixes:
|
If we change GPG_SIGNATURE_SCHEMA, then old signatures (like the ones in in-toto metadata) will start to fail |
More specifically, use "sig" as key name instead of "signature". This makes the signature dicts compatible with TUF and in-toto specifications. API BREAK: This is absolutely an API break or all gpg users. Fixes secure-systems-lab#448
I actually did, but not beyond memory (see release post on slack): >>> from tuf.api.metadata import Metadata, Root
>>> from securesystemslib.signer import GPGSigner
>>>
>>> root = Metadata(signed=Root()) # create empty root metadata
>>> sig = root.sign(GPGSigner()) # sign with default key in default keyring
>>> sig.to_dict()
{
'keyid': '8ba69b87d43be294f23e812089a2ad3c07d962e8',
'signature': 'afd45fea08005bb8be587ab04fd5495cfe1f9070406c61a8a63ae4a7526724c238026dd78dbc7c4a54582164f5d0972464b24bd9f2e5e1c9ec22a7bb4ee9c22ce9b68c13e26d24fcb079e1e5315d3cf5daddd52246c1d9ac61f5e68ff7058308030dd317b46de7010a2662646d2450bf1b9b3f2d08b066d0ed42f7a2bd1149737b5ea40164bf6a4c3500c10573cf6b2f0466ab2b51af3ffca138c74204daf80fe9099e1a5087a2144584df5a705402e6872752438c60a025512e0b64d3082e0447aab07565f3d7960d7d347de98562c581b732cce55fefa5eb54e43e688c2c4dd838f0aca90e49e88b944dea63c31ae324c2161b5d2c74c2199b2cacaaa331a846cc53994d1df9b3c649bba3fabf28a7bebcf973dcfa33e72fa60e307369a29cb3f26bb6e037edc532c8cf624bf686f78af7799d81fa8827e08a5d58aca90e168483eb68f35157545c48fa673ce097a2e7da1d891b6abdf445d8c0e7ab8695ef3bd8350e277d6e7b2673ee67dc72373b2df2dd8cb33ba874610d41171d36cf95fea47efc15d568ea28decd77ab988186671fcd4b3250b734436b98aac4dfc14406a58a45a7857809b99a718bb4acb76b3d3635f7848022f422733aea4eb0ed8010c134cc7b55b57873226c9d38ffeaeec326d10cae129f65f6cf7dc78dce7aaaad70deca7841f806792c61bdb4990c50235f9f76ca794e89f623986b5d70e8e0',
'other_headers': '04000108001d1621048ba69b87d43be294f23e812089a2ad3c07d962e8050263218ca0'
} Writing |
Btw. we just recently discussed the sig <-> signature inconsistency, when fixing a related bug in #418. There I suggested to switch to |
Regarding spec compliance, at least at the time of adding this feature neither TUF nor in-toto specs explicitly allowed unrecognized fields, which would have made the signatures non-compliant due to the In hindsight and now that TUF spec and python-tuf supports them, it would have been smart to make sure that the |
For python-tuf we don't even have to support parsing and verifying |
That makes sense: so I think the reasonable plan is:
|
What I still dislike is GPGSigner and especially GPGSignature which claims to be a Signature but clearly does not pass for one -- using it would completely break TUF metadata for example. |
The result does not look like a TUF compliant signature (notice the key name "signature" instead of "sig"):
Did no-one ever actually try to put a GPG signature in TUF metadata?
The text was updated successfully, but these errors were encountered: