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

Change keytype for newly generated ecdsa keys #513

Closed
jku opened this issue Feb 14, 2023 · 9 comments
Closed

Change keytype for newly generated ecdsa keys #513

jku opened this issue Feb 14, 2023 · 9 comments
Assignees
Labels

Comments

@jku
Copy link
Collaborator

jku commented Feb 14, 2023

Current behavior:
generate_ecdsa_key() creates keys with keytype 'ecdsa'

Expected behavior:

Considering that the TUF spec defines the a "ecdsa-sha2-nistp256" keytype and not a "ecdsa" one we should probably use the more specific keytypes instead?

This should be an easy non-breaking change: set the keytype in generate_ecdsa_key() to "ecdsa-sha2-nistp256" or "ecdsa-sha2-nistp384" based on the scheme.

@jku jku added the bug label Feb 14, 2023
@jku
Copy link
Collaborator Author

jku commented Feb 14, 2023

cc @rdimitrov

@jku
Copy link
Collaborator Author

jku commented Feb 14, 2023

This still leads me to wonder what the practical advantage of changing this key type name was.

I understand that some people think keytypes are unneeded (and scheme should fully define the type/scheme)... but why keep making changes to key type then?

@lukpueh
Copy link
Member

lukpueh commented Feb 15, 2023

I'm still convinced that this is a specification bug. "ecdsa-sha2-nistp256" is not a key type. At least the hash algorithm is only relevant for signing. Unless we define "key type" as the information needed for signing/verifying. But then why have key type and scheme? My preferred fix would be to deprecate the key type field altogether. We really only need scheme.

Practical advantage is less ambiguity (in a very complex specification) and less data on the wire (granted, not that important).

I agree that changing key type of "ecdsa-sha2-nistp*" keys to ecdsa in securesystemslib alone is not a big win, and more likely an interoperability problem.

@jku
Copy link
Collaborator Author

jku commented Feb 15, 2023

oh yeah, you are right and I was confused (I thought the spec had changed):

@lukpueh
Copy link
Member

lukpueh commented Feb 15, 2023

The way I read the spec, it also kind of offloads the definition of key types to the reference implementation.

@jku
Copy link
Collaborator Author

jku commented Feb 15, 2023

Sure, spec defines three keytypes and allows all implementers to define new ones. Using those implementation-defined keys is totally fine if interoperability is not a goal.

The issue is that a python-tuf repository user who decides to create ecdsa keys probably assumes they would be spec defined ecdsa keys... but they are not, they are implementation-defined keys. So the repository ends up spec compliant but likely not interoperable

@joshuagl
Copy link
Collaborator

joshuagl commented Mar 2, 2023

I agree that this is a specification bug. I have created a PR theupdateframework/specification#272 to capture what appears to be the specs current intent and document the keytype as "ecdsa". I've also added key formats to the agenda for the TUF project meeting at KubeCon EU.

@lukpueh
Copy link
Member

lukpueh commented May 22, 2023

theupdateframework/specification#272 has been merged. @jku, can we close here?

@jku
Copy link
Collaborator Author

jku commented May 22, 2023

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants