Merge "Adding framework check for 3DES key size"
am: a24d025212
Change-Id: Id71784688902c0fc1d490b1fd8321fae134166b5
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user