-
Notifications
You must be signed in to change notification settings - Fork 275
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
Reconsider keyid "compliance" #1894
Comments
Rather than reverting this change in python-tuf, we should aim to get this change into the spec. I don't think it's worth adding some extra complexity here that we'll just remove very soon. |
I agree on avoiding complexity: I think we should still investigate if we are accidentally doing something that triggers this issue. |
I've had a first look to remind myself how the keyid is calculated:
note that the used JSON object is not the key from the metadata file (as an example it has a "private" field with an empty string for an unexplained purpose). This does not feel like a process that was designed for interoperability -- for a start it does not really seem to be documented |
For reference: secure-systems-lab/securesystemslib#308 summarizes securesystemslib/TUF/in-toto public key formats and points out issues/inconsistencies, such as the ambiguously defined "private" field you mention. It also suggests to "better decouple default keyids from keys, to allow the use of custom keyids, but with a canonical json computed keyid as fallback" |
Right, so I suppose the result is then:
Closing as WONTFIX |
Metadata API currently does not validate that keyid is a hex digest of the keys canonical form, we also do not test for this.
I maintain that this is fine from a security perspective: being able to calculate keyid from key value brings us no value that I can see, just more complicated code. See also https://github.com/theupdateframework/taps/blob/master/tap12.md
However, as shown in theupdateframework/go-tuf#228 go-tuf client does seem to check that keyids are as specified and arguably they are spec compliant in doing so. So let's reconsider: should we try to ensure that this creates keys with keyids that fulfill the requirements:
I assume that last call removes some unused fields from the key structure to make the metadata cleaner... and that probably makes the key not hash correctly.
The text was updated successfully, but these errors were encountered: