Description
When authenticating multiple times on Android the below error is thrown
{
error: 'Failed to encrypt the data with the generated key.',
success: false
}
Adding some further logging clarifies the error a little better
FingerPrintHelper: (pool-4-thread-1) [25314,25397] java.lang.IllegalStateException: IV has already been used. Reusing IV in encryption mode violates security best practices.
I applied the approach in
https://github.com/appcelerator-modules/titanium-identity/pull/36 to the current module and that worked
Steps to reproduce
1. Build the module using
ti build -p android
2. Click the
Authenticate with: Touch ID
button and authenticate with your fingerprint
3. Click the
Authenticate with: Touch ID
button and authenticate with your fingerprint
Actual
On the second attempt an error occurs
Expected
Should be able to auth everytime
I will fix up the linked PR to remove the merge conflicts
PR: https://github.com/appcelerator-modules/titanium-identity/pull/59
FR Passed. PR Merged.
We would need a PR to add this to the SDK in the future
PR (titanium_mobile): https://github.com/appcelerator/titanium_mobile/pull/12951 _(To be included in Titanium SDK 10.0.1.)_