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

PlatformException: BadPaddingException (BAD_DECRYPT in openssl) #148

Closed
nilsbehlen opened this issue Apr 21, 2021 · 3 comments · Fixed by #149 or #157
Closed

PlatformException: BadPaddingException (BAD_DECRYPT in openssl) #148

nilsbehlen opened this issue Apr 21, 2021 · 3 comments · Fixed by #149 or #157
Assignees
Labels
Type: Crash Report Crash reports received from the catcher plugin.

Comments

@nilsbehlen
Copy link
Member

Error:

PlatformException(Exception encountered, read, javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT at com.android.org.conscrypt.NativeCrypto.EVP_CipherFinal_ex(Native Method) at com.android.org.conscrypt.OpenSSLEvpCipher.doFinalInternal(OpenSSLEvpCipher.java:152) at com.android.org.conscrypt.OpenSSLCipher.engineDoFinal(OpenSSLCipher.java:374) at javax.crypto.Cipher.doFinal(Cipher.java:2055) at com.it_nomads.fluttersecurestorage.ciphers.StorageCipher18Implementation.decrypt(StorageCipher18Implementation.java:91) at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.decodeRawValue(FlutterSecureStoragePlugin.java:162) at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.read(FlutterSecureStoragePlugin.java:143) at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.access$300(FlutterSecureStoragePlugin.java:30) at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin$MethodRunner.run(FlutterSecureStoragePlugin.java:196) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:245) at android.os.HandlerThread.run(HandlerThread.java:67) , null)

Stack trace:
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159)
#2 FlutterSecureStorage.read (package:flutter_secure_storage/flutter_secure_storage.dart:45)
#3 StorageUtil.getCurrentVersion (package:privacyidea_authenticator/utils/storage_utils.dart:273)
#4 _MainScreenState.initState. (package:privacyidea_authenticator/screens/main_screen.dar:121)

Alternate stack trace:
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159)
#2 FlutterSecureStorage.readAll (package:flutter_secure_storage/flutter_secure_storage.dart:89)
#3 StorageUtil.loadAllTokens (package:privacyidea_authenticator/utils/storage_utils.dart:71)
#4 _MainScreenState._loadTokenList (package:privacyidea_authenticator/screens/main_screen.dart:224)
#5 _MainScreenState._loadEverything (package:privacyidea_authenticator/screens/main_screen.dart:206)

Occures on android and seems to be related to the secure storage plugin.

@nilsbehlen nilsbehlen added the Type: Crash Report Crash reports received from the catcher plugin. label Apr 21, 2021
@timosturm
Copy link
Contributor

timosturm commented Apr 22, 2021

TODO:

  1. Add flags to .xml
  2. Catch this specific error
  3. Tell the user to clear app data or reinstall app

See:
mogol/flutter_secure_storage#210
and
mogol/flutter_secure_storage#161

@nilsbehlen
Copy link
Member Author

this issue seems to persist in 3.1.2 eventhough with less occurences

@nilsbehlen nilsbehlen reopened this May 6, 2021
@timosturm
Copy link
Contributor

The problem I see with this error is the fact that we cannot know if the user tried the recommended fix to solve this problem, or if this error was not correctly handled by our custom error handling here.

I may try to add something to this crash report to see if the custom handling was triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Crash Report Crash reports received from the catcher plugin.
Projects
None yet
2 participants