8329754: The ThreadSafe attribute is ignored for SecureRandom algorithm aliases

Reviewed-by: weijun
This commit is contained in:
Artur Barashev 2024-09-09 21:04:04 +00:00 committed by Weijun Wang
parent 559fc711e0
commit 56387a0981
2 changed files with 40 additions and 19 deletions

View file

@ -225,8 +225,8 @@ public class SecureRandom extends java.util.Random {
if (provider == null || algorithm == null) {
return false;
} else {
return Boolean.parseBoolean(provider.getProperty(
"SecureRandom." + algorithm + " ThreadSafe", "false"));
Service service = provider.getService("SecureRandom", algorithm);
return Boolean.parseBoolean(service.getAttribute("ThreadSafe"));
}
}