-
Notifications
You must be signed in to change notification settings - Fork 653
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
Add an RSA2048 credential checker #3445
base: master
Are you sure you want to change the base?
Conversation
different fault policy with credential
Cool! I think it's worth splitting the HIL changes out and getting them merged first. I also think we should use the RSA HIL as part of this. The idea being that there can be a software implementation of the RSA HIL, but then we can also extend it to add a hardware implementation of RSA in the future. That way we can easily swap the RSA backend depending on the board. With this design we will need to swap the actual verifier |
Yeah I need help with integrating this. We have RSA math hil, do we have a HIL for RSA operations (in this case |
We currently just have basic RSA math operations Note that their Then we will need a verify function on top of that |
It seems like unfortunately this is blocked on RustCrypto/RSA#51 (and RustCrypto/RSA#342). I don't actually think that converting the portion of the RSA crate we need to use crypto-bigint (and stack-allocated keys) would be too terribly difficult, but, then what? We probably don't want our own vendored RSA crate in libraries, and RustCrypto/RSA (I assume) won't upstream a partial switch. Maybe we should skip RSA. Anytime I mention it the first thing that comes up is wait what about ECDSA. |
Work on moving the rsa library to crypto-bigint is underway RustCrypto/RSA#394 |
Pull Request Overview
This pull request is a rough proof of concept for doing a software-based RSA2048, SHA256, PKCS1 v1.5 signature validation for apps.
Issues:
It uses the RustCrypto RSA library which needs an allocator. I'm using the https://docs.rs/emballoc/latest/emballoc/ because it seems to work.
It adds a RSA signature HIL. I'm not sure what that should look like.
The kernel binary is a lot bigger and I had to move the app address on hail to 0x40000.
I got a ton of errors like:
so I removed our custom build of
core
.I chose RSA2048 and SHA256 only because the ARM® TrustZone® Cryptocell 310 security subsystem on the nRF52840 supports those values.
This also builds on my attempt to differentiate processes based on credential checks with the sha256 credential.
Testing Strategy
Tockloader can add a credential to an app:
Then on hail this PR checks that the signature is correct.
I used Python to to get n and e for the verifier:
TODO or Help Wanted
A lot.
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.