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

Commit 7f813b80 authored by Max Bires's avatar Max Bires Committed by android-build-merger
Browse files

Merge "Updating accepted HMAC key sizes"

am: 1cf90f78

Change-Id: I29dbb2db84696ba4ad7433ba9d99119572ede665
parents 92269e5e 1cf90f78
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -210,13 +210,9 @@ public abstract class AndroidKeyStoreKeyGeneratorSpi extends KeyGeneratorSpi {
                    }
                }
                if (mKeymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_HMAC) {
                    if (mKeySizeBits < 64) {
                    if (mKeySizeBits < 64 || mKeySizeBits > 512) {
                        throw new InvalidAlgorithmParameterException(
                            "HMAC key size must be at least 64 bits.");
                    }
                    if (mKeySizeBits > 512 && spec.isStrongBoxBacked()) {
                        throw new InvalidAlgorithmParameterException(
                            "StrongBox HMAC key size must be smaller than 512 bits.");
                            "HMAC key sizes must be within 64-512 bits, inclusive.");
                    }

                    // JCA HMAC key algorithm implies a digest (e.g., HmacSHA256 key algorithm