-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
App transitions to background when executing decryptPrivateKey #77
Comments
Hi, seems decryptPrivateKey should be encryptPrivateKey, because the key pair generated is not encrypted but if the app goes to background it may be because a crash, could you capture adb logcat to have more input please, thanks in advance |
Hi @jerson The generate key is just there to demonstrate that the module was properly installed and is functional. If you look, decryptPrivateKey is called with encryptedRSAKey, not key. I captured logcat. To remove as much noise as possible, I cleared it just before stepping into decryptPrivateKey. And froze the log after the process crashed. We can see a SIGSEGV at 2023-11-23 09:10:00.258 for process 21340 and a SIGABRT for process 21441. 21441 is my process (based on the Cmdline listed in the DEBUG dump. The SIGABRT seems related to the SIGSEGV. Here is the logcat
|
Before you ask: "react-native-fast-rsa": "^2.4.0" A little bit more background The wrapped key I am trying to decrypt is generated somewhere else using WebCrypto . I was able to successfully unwrap the private key using react-native-crypto, which does the key derivation, and react-native-aes-gcm-crypto to do the actual AES decryption. The result is what I used with RSA.decryptPrivateKey In the mean time, I used the unwrapped private key to try to use RSA.convertPrivateKeyToPublicKey, RSA.encryptPKCS1v15 and RSA.decryptPKCS1v15. This was all successful. I also try to wrap the private key (same as with RSA.decryptPKCS1v15) via RSA.encryptPrivateKey (using AES265). This failed with "x509: no DEK-Info header in block". I try to first convert the private key, using RSA.convertPrivateKeyToPKCS1 and RSA.convertPrivateKeyToPKCS8 but without success. RSA.convertPrivateKeyToPKCS8 actually did not do anything as the key is already PKCS8. |
Hi all,
I am trying to use decryptPrivateKey. However, whenever I fire it (with an await construct), my app goes to background. Actually, it probably goes to pause (I see it in overview on Android) since a console.log immediately following the statement (and in the catch statement) never fires.
For testing, just before the decryptPrivateKey call I did a await RSA.generate(2048), which works as expected.
I made sure to have RSA.useJSI = false; just to be sure.
On resuming the App the bundle gets reloaded and the App starts over. But this is probably out of scope here...
The code is this
The text was updated successfully, but these errors were encountered: