-
Notifications
You must be signed in to change notification settings - Fork 168
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
feat: add ECCrypto native module with hardware-back key storage / secure enclave . #353
Conversation
9d62b96
to
c0dbfb3
Compare
Thanks for the PR. I'm not entirely sure how to review this PR, or why it has the "grumble" label.
This should rather live in an issue IMO. It can surely be split into several PRs, I see mainly 2, with the first 5 elements (up to the unit tests) and the last 2 elements with the integration. What do you think? |
@hanwencheng I think we can merge with master separately and it won't be a problem. There is really no overlap at the moment. |
3357aa6
to
7bf54f3
Compare
Test part is finished, will refresh this PR after the CI integration merged, then we will have a clear view of it. |
50793f1
to
116f2a6
Compare
116f2a6
to
05bbb12
Compare
Integration test is added as here |
I'm not sure it makes sense to use a UI testing framework to test non-UI features. Surely encryption methods and such can be tested more easily without it... |
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.
@sjeohp I think as far as testing the encryption methods, the best we can do is just unit test the encrypt/decrypt methods in their respective OS.
The integration tests @hanwencheng added are indeed for UI testing but they give us a way to emulate that OS and hit it from the JS code so that we also have an idea of whether the bridging is working as expected.
Other than that I'm ok to merge this as is (after adding some unit tests) and we can actually do the wiring up in a separate PR.
Happy to merge once the conflict is resolved |
This is the first PR for #222 According to Parity-Signer Secure Key Storage Proposal
To avoid the PR become too large, and also to be available to switch to another high priority issues, I would rather split this PR into multiple parts.
As development goes by, the
react-native-ecc
is not 100% fits to our use case, I have implement anECCrypto
module which both works in iOS (with Secure Enclave) and Android (with Hard-ware backed Keystore).So in this PR the following parts are finished:
Integrate with Android Fingerprint.Rest parts are:
I am using Google Tink library on Android for simplify the code and workflow but currently the BiometricPrompt is not integrated yet, there is an issue discussing it.
Usage
------ORIGINAL DESCRIPTION BELOW------
React-native-ecc has implement secure enclave with ecc sign and verify function. We could use to replace
react-native-secure-storage
, I am currently creating an PR to add the encryption and decryption function to fulfill our goal.On the Android system we will also need to store the encrypted data into Keystore so I will also implement the encryption and decryption function on Android based on React-native-ecc as well.