8285696: AlgorithmConstraints:permits not throwing IllegalArgumentException when 'alg' is null

Reviewed-by: jpai, xuelei
This commit is contained in:
Daniel Jeliński 2022-04-28 06:20:34 +00:00
parent c1173c24bf
commit 47951655ac

View file

@ -160,6 +160,9 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
throw new IllegalArgumentException("The primitives cannot be null" +
" or empty.");
}
if (algorithm == null || algorithm.isEmpty()) {
throw new IllegalArgumentException("No algorithm name specified");
}
if (!cachedCheckAlgorithm(algorithm)) {
return false;