wultra / react-native-powerauth-mobile-sdk

React Native Mobile SDK for PowerAuth Protocol (ios, android)
Apache License 2.0
9 stars 3 forks source link

Investigate PowerAuthPassword usage in commitActivation #213

Closed kober32 closed 1 month ago

kober32 commented 1 month ago

We have a report that when PowerAuthPassword is used in commitActivation (with biometrics) method on Android, the commit fails with a BIOMETRY_FAILED error (stacktrace below).

This error ultimately comes from the ValidateSessionSetup in the Session.cpp - completeActivation where it ends with an EC_WrongState error.

When destroyOnUse is set to false, the issue goes away (just a hint).

This happened on the 2.5.1 version of the library.

Stacktrace:

{
    "originalException": {
        "nativeStackAndroid": [
            {
                "lineNumber": 1080,
                "file": "PowerAuthSDK.java",
                "methodName": "onBiometricDialogSuccess",
                "class": "io.getlime.security.p owerauth.sdk.PowerAuthSDK$11"
            },
            {
                "lineNumber": 2277,
                "'file": "PowerAuthSDK.java",
                "methodName": "onBiometricDialogSuccess",
                "class": "io.getlime.security.powerauth.sdk.PowerAuthSDK$25"
            },
            {
                "lineNumber": 123,
                "file": "BiometricResultDispatcher.java",
                "methodName": "run",
                "class": "io.ge tlime.security.powerauth.biometry.impl.BiometricResultDispatcher$2"
            },
            {
                "lineNumber": 208,
                "file": "BiometricResultDispatcher.java",
                "methodNam e": "run",
                "class": "io.getlime.security.powerauth.biometry.impl.BiometricResultDispatcher$6"
            },
            {
                "lineNumber": 60,
                "file": "MainThreadExecutor.java",
                "methodName": "dispatchCallback",
                "class": "io.getlime.security.powe rauth.sdk.impl.MainThreadExecutor"
            },
            {
                "lineNumber": 199,
                "file": "BiometricResultDispatcher.java",
                "methodName": "dispatch",
                "class": "io.getlime. security.powerauth.biometry.impl.BiometricResultDispatcher"
            },
            {
                "lineNumber": 120,
                "file": "BiometricResultDispatcher java",
                "methodNam e": "dispatchSuccess",
                "class": "io.getlime.security.powerauth.biometry.impl.BiometricResultDispatcher"
            },
            {
                "lineNumber": 254,
                "file": "BiometricAuthenticator java",
                "methodName": "onAuthenticationSucceeded",
                "class": "io.getlime.security.powerauth.biometry.impl.BiometricAuthenticator$1"
            },
            {
                "'lineNumber": 907,
                "file": "BiometricFragment.java",
                "methodName": "run",
                "class": "androidx.biometric.BiometricFragment$9"
            },
            {
                "lineNumber": 1000,
                "file": "Handler java",
                "methodName": "handle Callb ack",
                "class": "android.os.Handler"
            },
            {
                "lineNumber": 104,
                "file": "Handler.java",
                "methodName": "dispatchMessage",
                "class": "android.os.Handler"
            },
            {
                "lineNumber": 242,
                " file": "Looper.java",
                "methodName": "loopOnc e",
                "class": "android.os.Looper"
            },
            {
                "lineNumber": 362,
                "file": "Looper java",
                "methodName": "loop",
                "class": "android.os.Looper"
            },
            {
                "lineNumber": 8448,
                "file": "ActivityThread java",
                "methodName": "mai n",
                "class": "android.app.ActivityThread"
            },
            {
                "lineNumber": -2,
                "file": "Method.java",
                "methodName": "invoke",
                "class": "java.lang.reflect.Method"
            },
            {
                "lineNumber": 552,
                "file": "Runtimelnit.java",
                "methodName": "run",
                "class": "com.android.internal.os.Runtimelnit$MethodAndArgsCaller"
            },
            {
                "lineNumber": 992,
                "file": "Zygotelnit.java",
                "methodName": "main",
                "class": " com.android.internal.os.Zygotelnit"
            }
        ],
        "userInfo": null,
        "message": null,
        "code": "BIOMETRY_FAILED"
    },
    "code": "BIOMETRY_FAILED"
}
hvge commented 1 month ago

I think it may be related to this issue - https://github.com/wultra/powerauth-mobile-sdk/issues/607