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

insertProviderAt(SC, 1) breaks other crypto ops #12

Open
mvayngrib opened this issue Sep 7, 2018 · 5 comments
Open

insertProviderAt(SC, 1) breaks other crypto ops #12

mvayngrib opened this issue Sep 7, 2018 · 5 comments

Comments

@mvayngrib
Copy link

mvayngrib commented Sep 7, 2018

Q: is there a way to only use the Spongy/BouncyCastleProvider for the particular operations needed for chip reading/auth? Mutating the global list of providers breaks other crypto I'm doing. Thanks!

edit: i tried addProvider() instead, but then it doesn't scan the chip

@tananaev
Copy link
Owner

tananaev commented Sep 7, 2018

Why does it break other crypto? Does it replace some provider that you need?

@mvayngrib
Copy link
Author

@tananaev yep, see the code here https://github.com/tradle/react-native-ecc/blob/master/android/src/main/java/com/rn/ecc/ECCModule.java

sign doesn't work, the SC provider seems to get in the way. I printed the providers:

with passport-reader:

SC
AndroidKeyStoreBCWorkaround
AndroidOpenSSL
BC
Crypto
HarmonyJSSE
AndroidKeyStore

without passport reader:

AndroidKeyStoreBCWorkaround
AndroidOpenSSL
BC
Crypto
HarmonyJSSE
AndroidKeyStore

@tananaev
Copy link
Owner

tananaev commented Sep 7, 2018

Not sure how to solve the issue. Maybe there is a way to specify provider explicitly?

@mvayngrib
Copy link
Author

mvayngrib commented Sep 7, 2018

i've googled a fair bit. One way is to insertProviderAt before the relevant code in this module, and then remove it after. However, as it's executing in the background, it will probably affect anything that happens to be using crypto at the same time.

some libraries allow you to setProvider explicitly, e.g. here, but i'm not really familiar with the libraries being used here. Maybe you can check if u know where to look?

@tananaev
Copy link
Owner

tananaev commented Sep 7, 2018

Unfortunately I don't have much time to dedicate to this project.

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

No branches or pull requests

2 participants