Merge "Revert "Fixing default behavior for keys requiring auth"" into rvc-dev

This commit is contained in:
Kenny Root
2020-03-05 17:10:53 +00:00
committed by Android (Google) Code Review
3 changed files with 6 additions and 7 deletions

View File

@@ -764,9 +764,8 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec, UserAu
private @KeyProperties.BlockModeEnum String[] mBlockModes;
private boolean mRandomizedEncryptionRequired = true;
private boolean mUserAuthenticationRequired;
private int mUserAuthenticationValidityDurationSeconds = 0;
private @KeyProperties.AuthEnum int mUserAuthenticationType =
KeyProperties.AUTH_BIOMETRIC_STRONG;
private int mUserAuthenticationValidityDurationSeconds = -1;
private @KeyProperties.AuthEnum int mUserAuthenticationType;
private boolean mUserPresenceRequired = false;
private byte[] mAttestationChallenge = null;
private boolean mUniqueIdIncluded = false;

View File

@@ -562,9 +562,8 @@ public final class KeyProtection implements ProtectionParameter, UserAuthArgs {
private @KeyProperties.BlockModeEnum String[] mBlockModes;
private boolean mRandomizedEncryptionRequired = true;
private boolean mUserAuthenticationRequired;
private @KeyProperties.AuthEnum int mUserAuthenticationType =
KeyProperties.AUTH_BIOMETRIC_STRONG;
private int mUserAuthenticationValidityDurationSeconds = 0;
private @KeyProperties.AuthEnum int mUserAuthenticationType;
private int mUserAuthenticationValidityDurationSeconds = -1;
private boolean mUserPresenceRequired = false;
private boolean mUserAuthenticationValidWhileOnBody;
private boolean mInvalidatedByBiometricEnrollment = true;

View File

@@ -165,7 +165,8 @@ public abstract class KeymasterUtils {
}
args.addUnsignedLong(KeymasterDefs.KM_TAG_USER_SECURE_ID,
KeymasterArguments.toUint64(sid));
args.addEnum(KeymasterDefs.KM_TAG_USER_AUTH_TYPE, spec.getUserAuthenticationType());
args.addEnum(KeymasterDefs.KM_TAG_USER_AUTH_TYPE,
KeymasterDefs.HW_AUTH_PASSWORD | KeymasterDefs.HW_AUTH_BIOMETRIC);
args.addUnsignedInt(KeymasterDefs.KM_TAG_AUTH_TIMEOUT,
spec.getUserAuthenticationValidityDurationSeconds());
if (spec.isUserAuthenticationValidWhileOnBody()) {