-
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
keyids_hash_algorithms missing in private keys? #412
Comments
Should we just adapt Or do we additionally want to make the property mandatory for some or all of |
I'd recommend that |
Furthermore, I don't see how including the hash algorithms portion in the key object returned by above |
Here's some background information on Let me know if it clears things up. |
ed25519_key, junk = securesystemslib.keys.format_metadata_to_key(ed25519_key_metadata) Providing the same behavior for I wonder if we want to (in addition to having the
|
I prefer not to make |
Hm. I just read your #272 (comment). It does not fully make sense to me, that these functions specify a Given a key {
"keyid": HASH256(KEYVAL),
"keyid_hash_algorithms": ['sha256', 'sha512'],
"keyval" : KEYVAL
} The keyid will always require |
Re format: Okay, makes sense. |
Okay, it does make sense now. It is required to associate a key with signatures signed by that key, but potentially having a different key id, due to a different hash algorithm. Thanks for the clarification, Vlad! I'll update |
Btw. we have partially redundant code in the tuf's repository lib (1) and securesystemslib's key module (2). (1) Should we merge? |
Yup, I added an interface to securesystemslib that does a lot of what repository_lib.py currently does. We should consider using the functions provided by securesystemslib. |
Actually the securesystemslib functions load PEM formatted keys, whereas the repository lib functions load json. |
Vlad, do you want to keep the interfaces in repository_lib? e.g.: def import_ed25519_publickey_from_file(filepath):
securesystemslib.import_ed25519_publickey_from_file(filepath) |
Keeping the interface in repository_lib makes the most sense. I'd imagine that the format of JSON keys would differ between projects, so adding it to securesystemslib is not ideal. |
I don't agree. The JSON/dictionary schemas are integral part of securesystemslib, c.f. |
But yes, we should still keep the interface in repository_lib for backwards compatibility. |
I created a new issue in securesystemslib: |
Per Vlad, both public and private keys generated / imported by TUF should include a 'keyid_hash_algorithms' element (which according to tuf.formats.ANYKEY_SCHEMA is optional).
However, this was executed on code current on the develop branch as of this commenting:
The imported private key does not include keyid_hash_algorithms.
The text was updated successfully, but these errors were encountered: