Skip to content
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

Merged
merged 3 commits into from
Aug 20, 2020

Conversation

joshuagl
Copy link
Collaborator

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
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Signed-off-by: Joshua Lock <jlock@vmware.com>
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 <jlock@vmware.com>
@joshuagl
Copy link
Collaborator Author

joshuagl commented Aug 18, 2020

cc @adityasaky

@coveralls
Copy link

coveralls commented Aug 18, 2020

Coverage Status

Coverage remained the same at 98.95% when pulling 3cd47e7 on joshuagl:joshuagl/ecdsa-issue-239 into 708e992 on secure-systems-lab:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0005%) to 98.95% when pulling d14a64b on joshuagl:joshuagl/ecdsa-issue-239 into 708e992 on secure-systems-lab:master.

@lukpueh
Copy link
Member

lukpueh commented Aug 19, 2020

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',
Copy link

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

Copy link
Member

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.

Copy link
Member

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! :)

@@ -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
Copy link
Member

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?

Copy link
Collaborator Author

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']:
Copy link
Member

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.

Copy link
Member

@lukpueh lukpueh left a 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!

@lukpueh lukpueh merged commit 876772c into secure-systems-lab:master Aug 20, 2020
@joshuagl joshuagl deleted the joshuagl/ecdsa-issue-239 branch August 20, 2020 14:23
@lukpueh lukpueh mentioned this pull request Feb 11, 2021
3 tasks
joshuagl added a commit to joshuagl/specification that referenced this pull request Mar 1, 2023
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 <jlock@vmware.com>
joshuagl added a commit to joshuagl/specification that referenced this pull request Mar 2, 2023
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 <jlock@vmware.com>
joshuagl added a commit to joshuagl/specification that referenced this pull request Mar 15, 2023
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 <jlock@vmware.com>
joshuagl added a commit to joshuagl/specification that referenced this pull request May 12, 2023
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 <jlock@vmware.com>
joshuagl added a commit to theupdateframework/specification that referenced this pull request May 15, 2023
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 <jlock@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants