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

Rework BouncyCastleSecureArea. #392

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Rework BouncyCastleSecureArea. #392

merged 1 commit into from
Oct 26, 2023

Conversation

davidz25
Copy link
Contributor

First of all, rename this to SoftwareSecureArea since there is no need to leak the fact that we're currently using BouncyCastle which could change in the future.

Instead of always using self-signed keys, make it possible to specify the attestation key to use at key creation time. Without this we cannot easily support curves which cannot be used for signing (for example X25519). Modify holder app to create an attestation root on demand.

Introduce attestation extension so SoftwareSecureArea keys also can convey the attestation challenge. The OID for this has been reserved (it's 1.3.6.1.4.1.11129.2.1.39) and we can extend this if needed. Add code for dealing with this and use it in SoftwareSecureArea.

Show the curve of DeviceKey in the reader app.

Make sure we use the BouncyCastle library bundled with the app instead of the Conscrypt-based implementation that may come with the OS. Do this for both wallet and reader app.

This has been manually test with mdocs using both ECDSA and MAC authentication with all curves except Ed25519, X25519, Ed448, and X448. These curves still have some serialization problems, we'll revisit this in a future PR.

The app still uses the name "Bouncy Castle", we'll address that in a future PR.

Test: Manually tested.
Test: All unit tests pass.

Copy link
Contributor

@suzannajiwani suzannajiwani 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 overall, just need the copyright

First of all, rename this to SoftwareSecureArea since there is no need
to leak the fact that we're currently using BouncyCastle which could
change in the future.

Instead of always using self-signed keys, make it possible to specify
the attestation key to use at key creation time. Without this we
cannot easily support curves which cannot be used for signing (for
example X25519). Modify holder app to create an attestation root
on demand.

Introduce attestation extension so SoftwareSecureArea keys also
can convey the attestation challenge. The OID for this has been
reserved (it's 1.3.6.1.4.1.11129.2.1.39) and we can extend this
if needed. Add code for dealing with this and use it in
SoftwareSecureArea.

Show the curve of DeviceKey in the reader app.

Make sure we use the BouncyCastle library bundled with the app
instead of the Conscrypt-based implementation that may come
with the OS. Do this for both wallet and reader app.

This has been manually test with mdocs using both ECDSA and MAC
authentication with all curves except Ed25519, X25519, Ed448,
and X448. These curves still have some serialization problems,
we'll revisit this in a future PR.

The app still uses the name "Bouncy Castle", we'll address that
in a future PR.

Also update to the latest available BouncyCastle, version 1.70.

Test: Manually tested.
Test: All unit tests pass.
@davidz25 davidz25 merged commit b4e1051 into master Oct 26, 2023
5 checks passed
@davidz25 davidz25 deleted the rework-bc-sa branch October 26, 2023 19:44
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