-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Support for NIST256 ssh-certificates #373
Conversation
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.
Looks great, many thanks for the contribution!
A few small comments below:
libagent/formats.py
Outdated
if key_type == SSH_NIST256_KEY_TYPE or key_type == SSH_NIST256_CERT_TYPE: | ||
if key_type == SSH_NIST256_CERT_TYPE: | ||
# nonce | ||
_ = util.read_frame(s) |
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.
Please remove the comment and use a dummy variable (here and below):
_ = util.read_frame(s) | |
_nonce = util.read_frame(s) |
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.
Done as requested.
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!
curve_name = util.read_frame(s) | ||
log.debug('curve name: %s', curve_name) | ||
point = util.read_frame(s) | ||
|
||
if key_type == SSH_NIST256_CERT_TYPE: |
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.
Please add a unit test for the new code.
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.
Do you mean assert
ions?
If yes, what could I assert as most of the new code is to ignore data which is not needed and the remaining changes only adds ecdsa-sha2-nistp256-cert-v01@openssh.com
to SUPPORTED_KEY_TYPES
.
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.
Do you mean
assert
ions?
Similar to how it's done here:
def test_parse_public_key(): |
def test_parse_ed25519(): |
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.
Done
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.
Looks good, please add a small unit-test, rebase and squash :)
Adopt suggested naming scheme Adding new unit tests
d06fe29
to
d12f95d
Compare
The rebase and squash are done as requested. |
Thanks for the contribution! |
This should enable the usage of SSH-certificates using the NIST256 curve. By Testing this I found out that the payload to be signed is too big for the Trezor One but it is usable using a Trezor Model T.
This should also closes #372