privacybydesign / irmamobile

IRMA app for iOS and Android
Other
81 stars 20 forks source link

Keystore operation failed errors on Samsung Galaxy S21 series #252

Closed ivard closed 10 months ago

ivard commented 1 year ago

At first the Yivi app works fine, but after a year the app starts with a fatar error:

java.security.InvalidKeyException: Keystore operation failed
android.security.keystore2.KeyStoreCryptoOperationUtils.getInvalidKeyException(KeyStoreCryptoOperationUtils.java:130), android.security.keystore2.KeyStoreCryptoOperationUtils.getExceptionForCipherInit(KeyStoreCryptoOperationUtils.java:154)

It only occurs on devices of the Samsung Galaxy S21 series. We currently have reports from 44 different users and all of them use a Samsung Galaxy S21.

sentry-io[bot] commented 11 months ago

Sentry issue: IRMAMOBILE-2020-1YS

sentry-io[bot] commented 10 months ago

Sentry issue: IRMAMOBILE-2020-25Y

ivard commented 10 months ago

Stacktrace:

java.security.InvalidKeyException: Keystore operation failed
Caused by: android.security.KeyStoreException: Invalid key blob (internal Keystore code: -33 message: In create_operation: Failed to begin operation. 10378

Caused by:
    0: In KeystoreSecurityLevel::upgrade_keyblob_if_required_with.
    1: In utils::upgrade_keyblob_if_required_with: Calling km_op.
    2: Error::Km(ErrorCode(-33))) (public error code: 10 internal Keystore code: -33)

Issue is similar to issues in other projects (e.g. https://github.com/oblador/react-native-keychain/issues/617 and https://github.com/Kunzisoft/KeePassDX/issues/1670). Seems to be fixed by a Samsung Android update.

According to our metrics, the issue existed between October 13th and November 27th 2023. This exactly matches the lifetime of Samsung System Update 39. This confirms our assumption that it was an OS issue. Therefore, we close this issue now.