Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f82f476 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Keystore 2.0 SPI: Make getAttestationIds return an empty array."

parents 9a24f337 464e6c41
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();
  }
+4 −5
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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);