Merge "Fixing default behavior for keys requiring auth" into rvc-dev am: 27deb3b711 am: 7b6ea4e8f1
Change-Id: Ifb2d7622582998f8a028c49a32756684233a2413
This commit is contained in:
@@ -764,8 +764,9 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec, UserAu
|
|||||||
private @KeyProperties.BlockModeEnum String[] mBlockModes;
|
private @KeyProperties.BlockModeEnum String[] mBlockModes;
|
||||||
private boolean mRandomizedEncryptionRequired = true;
|
private boolean mRandomizedEncryptionRequired = true;
|
||||||
private boolean mUserAuthenticationRequired;
|
private boolean mUserAuthenticationRequired;
|
||||||
private int mUserAuthenticationValidityDurationSeconds = -1;
|
private int mUserAuthenticationValidityDurationSeconds = 0;
|
||||||
private @KeyProperties.AuthEnum int mUserAuthenticationType;
|
private @KeyProperties.AuthEnum int mUserAuthenticationType =
|
||||||
|
KeyProperties.AUTH_BIOMETRIC_STRONG;
|
||||||
private boolean mUserPresenceRequired = false;
|
private boolean mUserPresenceRequired = false;
|
||||||
private byte[] mAttestationChallenge = null;
|
private byte[] mAttestationChallenge = null;
|
||||||
private boolean mUniqueIdIncluded = false;
|
private boolean mUniqueIdIncluded = false;
|
||||||
@@ -1240,7 +1241,8 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec, UserAu
|
|||||||
if (seconds == -1) {
|
if (seconds == -1) {
|
||||||
return setUserAuthenticationParameters(0, KeyProperties.AUTH_BIOMETRIC_STRONG);
|
return setUserAuthenticationParameters(0, KeyProperties.AUTH_BIOMETRIC_STRONG);
|
||||||
}
|
}
|
||||||
return setUserAuthenticationParameters(seconds, KeyProperties.AUTH_BIOMETRIC_STRONG);
|
return setUserAuthenticationParameters(seconds, KeyProperties.AUTH_DEVICE_CREDENTIAL
|
||||||
|
| KeyProperties.AUTH_BIOMETRIC_STRONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -562,8 +562,9 @@ public final class KeyProtection implements ProtectionParameter, UserAuthArgs {
|
|||||||
private @KeyProperties.BlockModeEnum String[] mBlockModes;
|
private @KeyProperties.BlockModeEnum String[] mBlockModes;
|
||||||
private boolean mRandomizedEncryptionRequired = true;
|
private boolean mRandomizedEncryptionRequired = true;
|
||||||
private boolean mUserAuthenticationRequired;
|
private boolean mUserAuthenticationRequired;
|
||||||
private @KeyProperties.AuthEnum int mUserAuthenticationType;
|
private int mUserAuthenticationValidityDurationSeconds = 0;
|
||||||
private int mUserAuthenticationValidityDurationSeconds = -1;
|
private @KeyProperties.AuthEnum int mUserAuthenticationType =
|
||||||
|
KeyProperties.AUTH_BIOMETRIC_STRONG;
|
||||||
private boolean mUserPresenceRequired = false;
|
private boolean mUserPresenceRequired = false;
|
||||||
private boolean mUserAuthenticationValidWhileOnBody;
|
private boolean mUserAuthenticationValidWhileOnBody;
|
||||||
private boolean mInvalidatedByBiometricEnrollment = true;
|
private boolean mInvalidatedByBiometricEnrollment = true;
|
||||||
@@ -870,7 +871,8 @@ public final class KeyProtection implements ProtectionParameter, UserAuthArgs {
|
|||||||
if (seconds == -1) {
|
if (seconds == -1) {
|
||||||
return setUserAuthenticationParameters(0, KeyProperties.AUTH_BIOMETRIC_STRONG);
|
return setUserAuthenticationParameters(0, KeyProperties.AUTH_BIOMETRIC_STRONG);
|
||||||
}
|
}
|
||||||
return setUserAuthenticationParameters(seconds, KeyProperties.AUTH_BIOMETRIC_STRONG);
|
return setUserAuthenticationParameters(seconds, KeyProperties.AUTH_DEVICE_CREDENTIAL
|
||||||
|
| KeyProperties.AUTH_BIOMETRIC_STRONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -165,8 +165,7 @@ public abstract class KeymasterUtils {
|
|||||||
}
|
}
|
||||||
args.addUnsignedLong(KeymasterDefs.KM_TAG_USER_SECURE_ID,
|
args.addUnsignedLong(KeymasterDefs.KM_TAG_USER_SECURE_ID,
|
||||||
KeymasterArguments.toUint64(sid));
|
KeymasterArguments.toUint64(sid));
|
||||||
args.addEnum(KeymasterDefs.KM_TAG_USER_AUTH_TYPE,
|
args.addEnum(KeymasterDefs.KM_TAG_USER_AUTH_TYPE, spec.getUserAuthenticationType());
|
||||||
KeymasterDefs.HW_AUTH_PASSWORD | KeymasterDefs.HW_AUTH_BIOMETRIC);
|
|
||||||
args.addUnsignedInt(KeymasterDefs.KM_TAG_AUTH_TIMEOUT,
|
args.addUnsignedInt(KeymasterDefs.KM_TAG_AUTH_TIMEOUT,
|
||||||
spec.getUserAuthenticationValidityDurationSeconds());
|
spec.getUserAuthenticationValidityDurationSeconds());
|
||||||
if (spec.isUserAuthenticationValidWhileOnBody()) {
|
if (spec.isUserAuthenticationValidWhileOnBody()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user