* commit 'b5501efcddb800cdc6b41863e8c4df2c1e0012ec': Reject AlgorithmParameters of wrong type.
This commit is contained in:
@@ -129,6 +129,12 @@ abstract class AndroidKeyStoreAuthenticatedAESCipherSpi extends AndroidKeyStoreC
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!"GCM".equalsIgnoreCase(params.getAlgorithm())) {
|
||||||
|
throw new InvalidAlgorithmParameterException(
|
||||||
|
"Unsupported AlgorithmParameters algorithm: " + params.getAlgorithm()
|
||||||
|
+ ". Supported: GCM");
|
||||||
|
}
|
||||||
|
|
||||||
GCMParameterSpec spec;
|
GCMParameterSpec spec;
|
||||||
try {
|
try {
|
||||||
spec = params.getParameterSpec(GCMParameterSpec.class);
|
spec = params.getParameterSpec(GCMParameterSpec.class);
|
||||||
|
|||||||
@@ -197,6 +197,12 @@ class AndroidKeyStoreUnauthenticatedAESCipherSpi extends AndroidKeyStoreCipherSp
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!"AES".equalsIgnoreCase(params.getAlgorithm())) {
|
||||||
|
throw new InvalidAlgorithmParameterException(
|
||||||
|
"Unsupported AlgorithmParameters algorithm: " + params.getAlgorithm()
|
||||||
|
+ ". Supported: AES");
|
||||||
|
}
|
||||||
|
|
||||||
IvParameterSpec ivSpec;
|
IvParameterSpec ivSpec;
|
||||||
try {
|
try {
|
||||||
ivSpec = params.getParameterSpec(IvParameterSpec.class);
|
ivSpec = params.getParameterSpec(IvParameterSpec.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user