-
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
Better distinguish between keytype and scheme for ECDSA keys #267
Better distinguish between keytype and scheme for ECDSA keys #267
Conversation
Signed-off-by: Joshua Lock <[email protected]>
Prior to this change ECDSA keys had a keytype that include their scheme. Change this to simply 'ecdsa' for all ECDSA keys, regardless of scheme, to better match other key types. Continue to support reading keys of the old keytype+scheme format. Signed-off-by: Joshua Lock <[email protected]>
cc @adityasaky |
cc @shibumi |
# in order to support key files generated with older versions of | ||
# securesystemslib. At some point this backwards compatibility should be | ||
# removed. | ||
if key_object['keytype'] not in['ecdsa', 'ecdsa-sha2-nistp256', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in in-toto-golang, too?
CC: @lukpueh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's necessary. Just wanted to loop you in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's necessary. Just wanted to loop you in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good! :)
securesystemslib/keys.py
Outdated
@@ -687,7 +687,7 @@ def create_signature(key_dict, data): | |||
securesystemslib.formats.ANYKEY_SCHEMA.check_match(key_dict) | |||
|
|||
# Signing the 'data' object requires a private key. Signing schemes that are | |||
# currently supported are: 'ed25519', 'ecdsa-sha2-nistp256', and rsa schemes | |||
# currently supported are: 'ed25519', 'ecdsa', and rsa schemes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not misreading this, we're talking about the schemes themselves here, right? Meaning we leave it as is / include ecdsa-sha2-nistp384
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted, thanks!
elif keytype == 'ecdsa-sha2-nistp256': | ||
# Continue to support keytypes of ecdsa-sha2-nistp256 and ecdsa-sha2-nistp384 | ||
# for backwards compatibility with older securesystemslib releases | ||
elif keytype in ['ecdsa', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: We didn't support generation of ecdsa-sha2-nistp384
signatures prior to this PR (#228 only added verification support).
With this patch, we'll fail one level deeper when schemes are checked, which IMO is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the excellent work!
We claim that the spec is just documenting the signature _schemes_ from the reference implementation, but that we define three _keytypes_ within the spec. This change first updates the _keytypes_ to match the reference implementation (we have defaulted to a generic "ecdsa" keytype since secure-systems-lab/securesystemslib#267). Further, we update the specification to clarify that within we are documenting the keytypes and schemes from the reference implementation, and that we recommend implementing these keytypes and schemes as specified. Signed-off-by: Joshua Lock <[email protected]>
We claim that the spec is just documenting the signature _schemes_ from the reference implementation, but that we define three _keytypes_ within the spec. This change first updates the _keytypes_ to match the reference implementation (we have defaulted to a generic "ecdsa" keytype since secure-systems-lab/securesystemslib#267). Further, we update the specification to clarify that within we are documenting the keytypes and schemes from the reference implementation, and that we recommend implementing these keytypes and schemes as specified. Signed-off-by: Joshua Lock <[email protected]>
We claim that the spec is just documenting the signature _schemes_ from the reference implementation, but that we define three _keytypes_ within the spec. This change first updates the _keytypes_ to match the reference implementation (we have defaulted to a generic "ecdsa" keytype since secure-systems-lab/securesystemslib#267). Further, we update the specification to clarify that within we are documenting the keytypes and schemes from the reference implementation, and that we recommend implementing these keytypes and schemes as specified. Signed-off-by: Joshua Lock <[email protected]>
We claim that the spec is just documenting the signature _schemes_ from the reference implementation, but that we define three _keytypes_ within the spec. This change first updates the _keytypes_ to match the reference implementation (we have defaulted to a generic "ecdsa" keytype since secure-systems-lab/securesystemslib#267). Further, we update the specification to clarify that within we are documenting the keytypes and schemes from the reference implementation, and that we recommend implementing these keytypes and schemes as specified. Signed-off-by: Joshua Lock <[email protected]>
We claim that the spec is just documenting the signature _schemes_ from the reference implementation, but that we define three _keytypes_ within the spec. This change first updates the _keytypes_ to match the reference implementation (we have defaulted to a generic "ecdsa" keytype since secure-systems-lab/securesystemslib#267). Further, we update the specification to clarify that within we are documenting the keytypes and schemes from the reference implementation, and that we recommend implementing these keytypes and schemes as specified. Signed-off-by: Joshua Lock <[email protected]>
Fixes issue #: #239
Description of the changes being introduced by the pull request: use just 'ecdsa' as the keytype for newly created ECDSA keys, while continuing to support keys that were generated with the old style keytype that included the signing scheme.
Please verify and check that the pull request fulfils the following
requirements: