react-native-keychain icon indicating copy to clipboard operation
react-native-keychain copied to clipboard

Unrecoverable "Could not decrypt data with alias" on Huawei P30 Pro

Open pi-xel opened this issue 3 years ago • 8 comments

Hi,

I am using react-native-keychain 6.2.0 and see this error when using getGenericPassword for all our users that have a Huawei P30 Pro.

The passwords are set via setGenericPassword with a custom service name and all other options as default.

I've already seen this error message for other devices (Google Pixel, Motorola Razr, some other Huawei devices, as reported in https://github.com/oblador/react-native-keychain/issues/371) but there the behavior was sporadic, i.e. sometimes it failed but then it worked again on the next request. So this was something that could be recovered on a higher level.

But on the Huawei P30 Pro the behavior is different, so I guess there's a different root cause.

There it works for some time, then it fails at some point with Could not decrypt data with alias: servicename and from then on all subsequent requests fail with the same error message until the password is set again using setGenericPassword.

I don't have a Huawei P30 Pro available at the moment to debug it myself.

Do you have any idea what the issue might be? Please also let me know if I can do anything to help further debugging this issue.

Thanks in advance and also thanks for creating this great library!

pi-xel avatar May 20 '21 07:05 pi-xel

Addition: I don't know if this is related, but other errors I only see for the Huawei P30 Pro on getGenericPassword are:

Unknown error with alias: servicename, error: Failed to obtain information about key. Keystore error: 4 Unknown error with alias: servicename, error: Failed to communicate with keystore service

Either these errors or the Could not decrypt data with alias: servicename occur at some point (after working for a while, with the latter more frequently) and both appear to be non-recoverable.

pi-xel avatar May 20 '21 08:05 pi-xel

Addition 2: I need to put a question mark to the "it works for some time" since the key in question is only read on app startup.

So it could be that the key actually never gets properly stored / can never be retrieved on the Huawei P30 Pro, but that the app works nevertheless until the user kills & restarts / updates the app for the first time after storing the key (since on first storing the key is already loaded).

pi-xel avatar May 20 '21 08:05 pi-xel

+1

leolusoli avatar Aug 23 '21 07:08 leolusoli

This is still the case. image

dkoprowski avatar Aug 30 '21 12:08 dkoprowski

Hey guys, I also have the same issue. have you find any solution to this?

PouyaLitkouhi avatar Aug 31 '21 23:08 PouyaLitkouhi

Same here, no solution so far..

SudoPlz avatar Jan 03 '22 16:01 SudoPlz

Just to add that I got this error for a Samsung device (SM-T813)

savv avatar May 10 '22 09:05 savv

Does anyone had luck maybe with version 8 to get rid of this error?

Apollon77 avatar Nov 28 '22 14:11 Apollon77