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

Android App is throwing this exception on some specific devices Encryptor: Error during asymmetric decryption #2519

Closed
meta-krishna-meghwal opened this issue Feb 29, 2024 · 6 comments

Comments

@meta-krishna-meghwal
Copy link

Please fill out the following details:

  1. Version of Mobile SDK Used: 10.2

  2. Issue found in Native App or Hybrid App: Hybrid

  3. OS Version: Android 13 and Android 14

  4. Device: Vivo V23

  5. Steps to reproduce:
    The app is not working properly on some specific devices, it is throwing below error.

  6. Error Log:
    02-28 15:44:32.530 23292 23292 E Encryptor: Error during asymmetric decryption 02-28 15:44:32.530 23292 23292 E Encryptor: javax.crypto.IllegalBlockSizeException 02-28 15:44:32.530 23292 23292 E Encryptor: at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:613) 02-28 15:44:32.530 23292 23292 E Encryptor: at javax.crypto.Cipher.doFinal(Cipher.java:2056) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.analytics.security.Encryptor.decryptWithPrivateKey(Encryptor.java:530) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.analytics.security.Encryptor.decryptWithRSABytes(Encryptor.java:427) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.analytics.security.Encryptor.decryptWithRSA(Encryptor.java:408) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.security.SalesforceKeyGenerator.generateUniqueId(SalesforceKeyGenerator.java:164) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.security.SalesforceKeyGenerator.getUniqueId(SalesforceKeyGenerator.java:88) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.security.SalesforceKeyGenerator.getUniqueId(SalesforceKeyGenerator.java:77) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.security.SalesforceKeyGenerator.generateEncryptionKey(SalesforceKeyGenerator.java:145) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.security.SalesforceKeyGenerator.getEncryptionKey(SalesforceKeyGenerator.java:103) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.app.SalesforceSDKManager.getEncryptionKey(SalesforceSDKManager.java:1123) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.rest.ClientManager.createNewAccount(ClientManager.java:368) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.ui.OAuthWebviewHelper.addAccount(OAuthWebviewHelper.java:671) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask.onPostExecute(OAuthWebviewHelper.java:622) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask.onPostExecute(OAuthWebviewHelper.java:546) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.os.AsyncTask.finish(AsyncTask.java:771) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.os.AsyncTask.-$$Nest$mfinish(Unknown Source:0) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.os.Handler.dispatchMessage(Handler.java:106) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.os.Looper.loopOnce(Looper.java:223) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.os.Looper.loop(Looper.java:324) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.app.ActivityThread.main(ActivityThread.java:8377) 02-28 15:44:32.530 23292 23292 E Encryptor: at java.lang.reflect.Method.invoke(Native Method) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582) 02-28 15:44:32.530 23292 23292 E Encryptor: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1059) 02-28 15:44:32.530 23292 23292 E Encryptor: Caused by: android.security.KeyStoreException: Unknown error (internal Keystore code: -1000 message: In KeystoreOperation::finish 02-28 15:44:32.530 23292 23292 E Encryptor: 02-28 15:44:32.530 23292 23292 E Encryptor: Caused by: 02-28 15:44:32.530 23292 23292 E Encryptor: 0: In finish: KeyMint::finish failed. 02-28 15:44:32.530 23292 23292 E Encryptor: 1: Error::Km(ErrorCode(-1000))) (public error code: 10 internal Keystore code: -1000) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:369) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:78) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.security.KeyStoreOperation.finish(KeyStoreOperation.java:128) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.finish(KeyStoreCryptoOperationChunkedStreamer.java:228) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:181) 02-28 15:44:32.530 23292 23292 E Encryptor: at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:603) 02-28 15:44:32.530 23292 23292 E Encryptor: ... 24 more 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: Exception thrown while getting encryption key 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes(java.nio.charset.Charset)' on a null object reference 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.salesforce.androidsdk.security.SalesforceKeyGenerator.generateEncryptionKey(SalesforceKeyGenerator.java:146) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.salesforce.androidsdk.security.SalesforceKeyGenerator.getEncryptionKey(SalesforceKeyGenerator.java:103) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.salesforce.androidsdk.app.SalesforceSDKManager.getEncryptionKey(SalesforceSDKManager.java:1123) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.salesforce.androidsdk.rest.ClientManager.createNewAccount(ClientManager.java:368) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.salesforce.androidsdk.ui.OAuthWebviewHelper.addAccount(OAuthWebviewHelper.java:671) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask.onPostExecute(OAuthWebviewHelper.java:622) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask.onPostExecute(OAuthWebviewHelper.java:546) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at android.os.AsyncTask.finish(AsyncTask.java:771) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at android.os.AsyncTask.-$$Nest$mfinish(Unknown Source:0) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at android.os.Handler.dispatchMessage(Handler.java:106) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at android.os.Looper.loopOnce(Looper.java:223) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at android.os.Looper.loop(Looper.java:324) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at android.app.ActivityThread.main(ActivityThread.java:8377) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at java.lang.reflect.Method.invoke(Native Method) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582) 02-28 15:44:32.531 23292 23292 E SalesforceKeyGenerator: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1059) 02-28 15:44:32.927 23292 23938 E Encryptor: Error during asymmetric decryption 02-28 15:44:32.927 23292 23938 E Encryptor: javax.crypto.IllegalBlockSizeException

@meta-krishna-meghwal meta-krishna-meghwal changed the title In Android App, Encryptor: Error during asymmetric decryption Android App is throwing this exception on some specific devices Encryptor: Error during asymmetric decryption Feb 29, 2024
@wmathurin
Copy link
Contributor

Can you give us more details:

  • Was the application working previously and stopped working after an upgrade maybe?
  • Or is it failing with freshly installed application?
  • Is the failure happening consistently?

@meta-krishna-meghwal
Copy link
Author

Yes, the application was working previously on the same device and now it is consistently throwing erorr.

@wmathurin
Copy link
Contributor

Was there a OS upgrade on the device?

@meta-krishna-meghwal
Copy link
Author

No, there was not any OS upgrade

@wmathurin
Copy link
Contributor

There was a fix in that area in MSDK 12. Could you try with the latest version of MSDK and let us know if you still see the problem?

@wmathurin
Copy link
Contributor

Closing issue for lack of response from customer.

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