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.security.KeyStoreException occuring while trying to login with Line - sdk-version:5.10.1 #170

Open
shakil-bin-karim opened this issue Jun 4, 2024 · 0 comments

Comments

@shakil-bin-karim
Copy link

What did you do?

Try to authenticate users with Line.

What did you expect?

User's getting authenticated with Line.

What happened actually?

Some users were experiencing crashes while trying to login with Line as we updated SDK to v5.10.1. It is occurring due to KeyStoreException. Currently this is only occurring in one particular phone model: Oppo Reno5 A.

Stack trace

Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()
       at android.os.AsyncTask$4.done(AsyncTask.java:415)
       at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
       at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
       at java.util.concurrent.FutureTask.run(FutureTask.java:269)
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
       at java.lang.Thread.run(Thread.java:1012)

Caused by com.linecorp.linesdk.internal.security.encryption.EncryptionException: Failed to encrypt
       at com.linecorp.linesdk.internal.security.encryption.StringAesCipher.encrypt(StringAesCipher.kt:63)
       at com.linecorp.linesdk.internal.AccessTokenCache.encryptString(AccessTokenCache.java:99)
       at com.linecorp.linesdk.internal.AccessTokenCache.saveAccessToken(AccessTokenCache.java:60)
       at com.linecorp.linesdk.auth.internal.LineAuthenticationController$AccessTokenRequestTask.doInBackground(LineAuthenticationController.java:242)
       at com.linecorp.linesdk.auth.internal.LineAuthenticationController$AccessTokenRequestTask.doInBackground(LineAuthenticationController.java:203)
       at android.os.AsyncTask$3.call(AsyncTask.java:394)
       at java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
       at java.lang.Thread.run(Thread.java:1012)

Caused by java.security.ProviderException: Keystore operation failed
       at android.security.keystore2.AndroidKeyStoreHmacSpi.engineDoFinal(AndroidKeyStoreHmacSpi.java:241)
       at javax.crypto.Mac.doFinal(Mac.java:667)
       at javax.crypto.Mac.doFinal(Mac.java:742)
       at com.linecorp.linesdk.internal.security.encryption.StringAesCipher.calculateHmacValue(StringAesCipher.kt:154)
       at com.linecorp.linesdk.internal.security.encryption.StringAesCipher.encrypt(StringAesCipher.kt:60)
       at com.linecorp.linesdk.internal.AccessTokenCache.encryptString(AccessTokenCache.java:99)
       at com.linecorp.linesdk.internal.AccessTokenCache.saveAccessToken(AccessTokenCache.java:60)
       at com.linecorp.linesdk.auth.internal.LineAuthenticationController$AccessTokenRequestTask.doInBackground(LineAuthenticationController.java:242)
       at com.linecorp.linesdk.auth.internal.LineAuthenticationController$AccessTokenRequestTask.doInBackground(LineAuthenticationController.java:203)
       at android.os.AsyncTask$3.call(AsyncTask.java:394)
       at java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
       at java.lang.Thread.run(Thread.java:1012)

Caused by android.security.KeyStoreException: Invalid operation handle
       at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:356)
       at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:78)
       at android.security.KeyStoreOperation.finish(KeyStoreOperation.java:127)

Your environment?

LINE SDK version 5.10.1
Andorid version -12
Phone Model - Oppo Reno5 A

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

1 participant