From 919a9d6d774247a0ca17918f8637b29908e1ca4d Mon Sep 17 00:00:00 2001 From: Max Bires Date: Mon, 27 Apr 2020 10:26:45 -0700 Subject: [PATCH] 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 --- .../security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java index 8dbb5f544ad4d..cc5286d70cabc 100644 --- a/keystore/java/android/security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java +++ b/keystore/java/android/security/keystore/AndroidKeyStoreSecretKeyFactorySpi.java @@ -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");