Skip to content

android.security.KeyStoreException occuring while trying to login with Line - sdk-version:5.10.1 #170

@shakil-bin-karim

Description

@shakil-bin-karim

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions