8170247: java/security/SecureRandom/ApiTest fails when run with unlimited policy
Test was failing to handle expected exception in case of unlimited policy Reviewed-by: weijun
This commit is contained in:
parent
5f2d8b9738
commit
2034cb4c6e
@ -195,10 +195,10 @@ public class ApiTest {
|
|||||||
case "AES-128":
|
case "AES-128":
|
||||||
case "AES-192":
|
case "AES-192":
|
||||||
case "AES-256":
|
case "AES-256":
|
||||||
int algoStrength = Integer.parseInt(alg.replaceAll("AES-", ""));
|
int algoStrength = Integer.parseInt(alg.substring("AES-".length()));
|
||||||
int maxStrengthSupported = Cipher.getMaxAllowedKeyLength("AES");
|
int maxAESStrength = Cipher.getMaxAllowedKeyLength("AES");
|
||||||
if (strength > maxStrengthSupported
|
if (strength > algoStrength
|
||||||
|| algoStrength > maxStrengthSupported) {
|
|| algoStrength > maxAESStrength) {
|
||||||
error = false;
|
error = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user