On Wed, 17 Mar 2021 20:09:04 GMT, Valerie Peng <valer...@openjdk.org> wrote:
>> Can someone help review this somewhat trivial change? >> >> Updated JCAUtil class to return the cached SecureRandom object only when the >> provider configuration has not changed. >> Added a regression test to check the affected classes, i.e. >> AlgorithmParameterGenerator, KeyPairGenerator, Cipher, KeyAgreement, >> KeyGenerator. >> >> Thanks, >> Valerie > > Valerie Peng has updated the pull request incrementally with one additional > commit since the last revision: > > Fixed a null race condition src/java.base/share/classes/sun/security/jca/JCAUtil.java line 86: > 84: SecureRandom result = def; > 85: if (result == null) { > 86: synchronized (JCAUtil.class) { Could this lock be avoided if set the value in the Providers update (or when the providers list is updated)? ------------- PR: https://git.openjdk.java.net/jdk/pull/3018