Merge "Keystore 2.0 SPI: Make getAttestationIds return an empty array." am: 1f82f476c0 am: cf64e636a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664321 Change-Id: I7e790f590c81e8d0dcdf9693b9dc23d14f1ff90a
This commit is contained in:
@@ -8123,7 +8123,7 @@ package android.security.keystore {
|
||||
}
|
||||
|
||||
public final class KeyGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
|
||||
method @Nullable public int[] getAttestationIds();
|
||||
method @NonNull public int[] getAttestationIds();
|
||||
method public int getNamespace();
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec, UserAu
|
||||
boolean userPresenceRequired,
|
||||
byte[] attestationChallenge,
|
||||
boolean devicePropertiesAttestationIncluded,
|
||||
int[] attestationIds,
|
||||
@NonNull int[] attestationIds,
|
||||
boolean uniqueIdIncluded,
|
||||
boolean userAuthenticationValidWhileOnBody,
|
||||
boolean invalidatedByBiometricEnrollment,
|
||||
@@ -779,9 +779,8 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec, UserAu
|
||||
* @return integer array representing the requested device IDs to attest.
|
||||
*/
|
||||
@SystemApi
|
||||
@Nullable
|
||||
public int[] getAttestationIds() {
|
||||
return Utils.cloneIfNotNull(mAttestationIds);
|
||||
public @NonNull int[] getAttestationIds() {
|
||||
return mAttestationIds.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -911,7 +910,7 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec, UserAu
|
||||
private boolean mUserPresenceRequired = false;
|
||||
private byte[] mAttestationChallenge = null;
|
||||
private boolean mDevicePropertiesAttestationIncluded = false;
|
||||
private int[] mAttestationIds = null;
|
||||
private int[] mAttestationIds = new int[0];
|
||||
private boolean mUniqueIdIncluded = false;
|
||||
private boolean mUserAuthenticationValidWhileOnBody;
|
||||
private boolean mInvalidatedByBiometricEnrollment = true;
|
||||
|
||||
@@ -655,7 +655,7 @@ public abstract class AndroidKeyStoreKeyPairGeneratorSpi extends KeyPairGenerato
|
||||
}
|
||||
|
||||
int[] idTypes = mSpec.getAttestationIds();
|
||||
if (idTypes == null) {
|
||||
if (idTypes.length == 0) {
|
||||
return;
|
||||
}
|
||||
final Set<Integer> idTypesSet = new ArraySet<>(idTypes.length);
|
||||
|
||||
Reference in New Issue
Block a user