You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, I've been getting this issue while creating the public key in debug mode. However, if I build the APK and test it on an Android box or Android TV,
I get this error: error.0400008d:RSA routines:OPENSSL_internal:TOO_MANY_ITERATIONS in Flutter.
I'm not a crypto expert, certainly not an embedded expert, but could this be a combination of low powered platform, little randomness available and aiming for large primes?
It's possible we should figure out what the error is, and print a nicer message.
Now I wouldn't dare to give advice on how to do cryptographic protocols, but it's thinkable that smaller primes (fewer bits), or a different primitive like ECDSA might have differently.
Has there been any attempts to fix this? I am currently running the following on a Galaxy Watch 2. This works completely fine on a Google Pixel 9, Fedora Linux desktop, and a Windows desktop.
To add to @EricApostal - this continues to the Galaxy Watch Ultra as well. Likely an issue with all Wear OS or embedded devices.
GWU Wear OS 5.0, System Version 14
Update: #432 is now merged. It fixes the native ARM32 BN_ULONG binding used by BN_set_word, which could corrupt the RSA public exponent on 32-bit devices.
The fix was validated through the example app on a Galaxy A10, API 29 (armeabi-v7a): ffi.sizeOf<ffi.UintPtr>() == 4, the exponent 65537 produced the expected BIGNUM bytes, and 2048-bit RSA-OAEP generation succeeded with public JWK exponent AQAB.
This does not yet confirm whether the reported TOO_MANY_ITERATIONS failure on Android TV or Wear OS is resolved.
If the failure still reproduces, it may includes:
package version or commit,
debug or release build,
device model, OS/API level, and ABI,
the RSA generation call and complete error output,
whether repeated attempts consistently fail.
That evidence will determine whether the remaining failure is a separate BoringSSL or platform-specific issue.
Follow-up: #445 separates the 2048-bit RSA-OAEP / exponent 65537 integration test from the Android ARM32-only BN_set_word ABI test added in #432.
The new test can run on every Android ABI, including Android TV and Wear OS targets, without treating the ARM32-specific ABI assertion as a prerequisite. It is intended to reproduce and capture the remaining TOO_MANY_ITERATIONS behavior on an affected device. It does not claim to resolve that platform-specific failure.
Activity
avinashboy commentedon Jun 18, 2024
Device info is here:
Android TV OS Name: 11
Ram: 4GB
Model: Android 11RTC Mini PC
Device name: Leoxsys android mini pc
jonasfj commentedon Jun 26, 2024
What are you trying to do?
I'm not a crypto expert, certainly not an embedded expert, but could this be a combination of low powered platform, little randomness available and aiming for large primes?
A quick search yielded: openssl/openssl#4151
It's possible we should figure out what the error is, and print a nicer message.
Now I wouldn't dare to give advice on how to do cryptographic protocols, but it's thinkable that smaller primes (fewer bits), or a different primitive like ECDSA might have differently.
TimoshN commentedon Oct 18, 2024
in 32bit system
webcrypto.dart/lib/src/third_party/boringssl/generated_bindings.dart
Line 2993 in 22d6751
webcrypto.dart/lib/src/third_party/boringssl/generated_bindings.dart
Line 243 in 22d6751
as a temporary fix you may change
typedef BN_ULONG = ffi.Uint64;toffi.UnsignedLongEricApostal commentedon Apr 8, 2025
Has there been any attempts to fix this? I am currently running the following on a Galaxy Watch 2. This works completely fine on a Google Pixel 9, Fedora Linux desktop, and a Windows desktop.
It works fine on all devices except the Galaxy Watch 2, citing the exact same
TOO_MANY_ITERATIONSerror.microcrit commentedon Apr 15, 2025
To add to @EricApostal - this continues to the Galaxy Watch Ultra as well. Likely an issue with all Wear OS or embedded devices.
GWU Wear OS 5.0, System Version 14
harrshita123 commentedon Oct 17, 2026
Update: #432 is now merged. It fixes the native ARM32
BN_ULONGbinding used byBN_set_word, which could corrupt the RSA public exponent on 32-bit devices.The fix was validated through the example app on a Galaxy A10, API 29 (
armeabi-v7a):ffi.sizeOf<ffi.UintPtr>() == 4, the exponent 65537 produced the expected BIGNUM bytes, and 2048-bit RSA-OAEP generation succeeded with public JWK exponentAQAB.This does not yet confirm whether the reported
TOO_MANY_ITERATIONSfailure on Android TV or Wear OS is resolved.If the failure still reproduces, it may includes:
That evidence will determine whether the remaining failure is a separate BoringSSL or platform-specific issue.
harrshita123 commentedon Oct 17, 2026
Follow-up: #445 separates the 2048-bit RSA-OAEP / exponent 65537 integration test from the Android ARM32-only
BN_set_wordABI test added in #432.The new test can run on every Android ABI, including Android TV and Wear OS targets, without treating the ARM32-specific ABI assertion as a prerequisite. It is intended to reproduce and capture the remaining
TOO_MANY_ITERATIONSbehavior on an affected device. It does not claim to resolve that platform-specific failure.