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

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

Senjuu
Copy link

@Senjuu Senjuu commented Dec 6, 2021

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

Copy link
Owner

@romanz romanz left a 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:

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)
Copy link
Owner

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):

Suggested change
_ = util.read_frame(s)
_nonce = util.read_frame(s)

Copy link
Author

Choose a reason for hiding this comment

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

Done as requested.

Copy link
Owner

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:
Copy link
Owner

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.

Copy link
Author

@Senjuu Senjuu Dec 13, 2021

Choose a reason for hiding this comment

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

Do you mean assertions?
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.

Copy link
Owner

Choose a reason for hiding this comment

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

Do you mean assertions?

Similar to how it's done here:

def test_parse_public_key():

def test_parse_ed25519():

Copy link
Author

Choose a reason for hiding this comment

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

Done

@Senjuu Senjuu requested a review from romanz December 13, 2021 14:27
Copy link
Owner

@romanz romanz left a 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
@Senjuu
Copy link
Author

Senjuu commented Dec 21, 2021

The rebase and squash are done as requested.

@Senjuu Senjuu requested a review from romanz December 21, 2021 08:47
@romanz romanz merged commit c460ea1 into romanz:master Dec 21, 2021
@romanz
Copy link
Owner

romanz commented Dec 21, 2021

Thanks for the contribution!

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

Successfully merging this pull request may close these issues.

Cannot use Certificates for SSH
2 participants