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

securechip: replace sign interface function with native Rust impl #1334

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

benma
Copy link
Collaborator

@benma benma commented Dec 3, 2024

The securechip unsafe sign key slot in the ATECC608 was only used as an alternative to adding firmware code for signing using hte NIST P-256 curve.

The Optiga Trust M does not support the same functionality - one can't write a private key to this chip and extract the corresponding pubkey.

Since we want one interface for both chips, we remove the unsafe sign functionality and replace it with the Rust p256 crate.

It is only used in U2F.

As an alternative, one could use the native MCU PUKCC/PUKCL feature to derive a pubkey and sign using this curve (see pukcc.c), but I could not get it to work. Using the Rust crate is much easier to implement / use.

This adds 10592 bytes of binary space. If we need it back, we should try again to use PUKCC instead and offload these operations to the MCU.

Useful site to test U2f registration & authentication: https://demo.yubico.com/webauthn-technical

@NickeZ
Copy link
Collaborator

NickeZ commented Dec 3, 2024

Did you run vendor.sh in the container?

@benma
Copy link
Collaborator Author

benma commented Dec 3, 2024

Did you run vendor.sh in the container?

Yes, why?

@NickeZ
Copy link
Collaborator

NickeZ commented Dec 3, 2024

Did you run vendor.sh in the container?

Yes, why?

you bumped core/alloc

Copy link
Collaborator

@NickeZ NickeZ left a comment

Choose a reason for hiding this comment

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

utACK

benma added 2 commits December 3, 2024 18:30
The securechip unsafe sign key slot in the ATECC608 was only used as
an alternative to adding firmware code for signing using hte NIST
P-256 curve.

The Optiga Trust M does not support the same functionality - one can't
write a private key to this chip and extract the corresponding pubkey.

Since we want one interface for both chips, we remove the unsafe sign
functionality and replace it with the Rust p256 crate.

It is only used in U2F.

As an alternative, one could use the native MCU PUKCC/PUKCL feature to
derive a pubkey and sign using this curve (see pukcc.c), but I could
not get it to work. Using the Rust crate is much easier to implement /
use.

This adds 10592 bytes of binary space. If we need it back, we should
try again to use PUKCC instead and offload these operations to the
MCU.
The programmer needs to make sure the ptr/len point to a valid memory area.
@benma benma merged commit a12e8f8 into BitBoxSwiss:master Dec 3, 2024
3 checks passed
@benma benma deleted the p256 branch December 3, 2024 18:00
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.

2 participants