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

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

Merge "Adding framework check for 3DES key size"

am: a24d0252

Change-Id: Id71784688902c0fc1d490b1fd8321fae134166b5
parents d6b5de96 a24d0252
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.security.keystore;

import android.security.Credentials;
import android.security.GateKeeper;
import android.security.KeyStore;
import android.security.keymaster.KeyCharacteristics;
import android.security.keymaster.KeymasterArguments;
@@ -204,7 +203,12 @@ public abstract class AndroidKeyStoreKeyGeneratorSpi extends KeyGeneratorSpi {
                        }
                    }
                }

                if (mKeymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_3DES) {
                    if (mKeySizeBits != 168) {
                        throw new InvalidAlgorithmParameterException(
                            "3DES key size must be 168 bits.");
                    }
                }
                if (mKeymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_HMAC) {
                    if (mKeySizeBits < 64) {
                        throw new InvalidAlgorithmParameterException(