Fixing default timeout constant

The getKeyInfo check was not updated to use the new integer representing
an auth per operation key.

Bug: 152618140
Test: atest AuthBoundKeyTest
Change-Id: Ifa6d37ac878ba267761ed7ae32c544cd4b662d25
This commit is contained in:
Max Bires
2020-04-27 10:26:45 -07:00
parent 18fd3d0e07
commit 919a9d6d77

View File

@@ -167,7 +167,7 @@ public class AndroidKeyStoreSecretKeyFactorySpi extends SecretKeyFactorySpi {
boolean userAuthenticationRequired =
!keyCharacteristics.getBoolean(KeymasterDefs.KM_TAG_NO_AUTH_REQUIRED);
long userAuthenticationValidityDurationSeconds =
keyCharacteristics.getUnsignedInt(KeymasterDefs.KM_TAG_AUTH_TIMEOUT, -1);
keyCharacteristics.getUnsignedInt(KeymasterDefs.KM_TAG_AUTH_TIMEOUT, 0);
if (userAuthenticationValidityDurationSeconds > Integer.MAX_VALUE) {
throw new ProviderException("User authentication timeout validity too long: "
+ userAuthenticationValidityDurationSeconds + " seconds");