RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v51]

Kevin Driver kdriver at openjdk.org
Thu Oct 3 20:48:42 UTC 2024


On Thu, 3 Oct 2024 12:49:06 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Kevin Driver has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   revamped test to be a testng test and run 1 million iterations to try to demonstrate robustness
>
> test/jdk/javax/crypto/KDF/KDFDelayedProviderThreadingTest.java line 71:
> 
>> 69:         }).start();
>> 70:         new Thread(() -> k.getProviderName()).start();
>> 71:         System.out.println(Arrays.toString(k.deriveData(input)));
> 
> Thanks for including this test. Two comments:
> 
> 1. There is no need to print out here, especially you're running it for a million times.
> 2. The most important thing about this test is to make sure the provider is only chosen once so the 2 `deriveData` calls here should either always succeed or always fail. Now that you are running it a million times, there is a chance that the 2nd thread got the lock first and the 1st provider is chosen and both `deriveData` would fail.

Updates in: https://github.com/openjdk/jdk/pull/20301/commits/3399de1c2082e3f9cfcaae7d60ccb3b4a09f960d

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1786825427


More information about the security-dev mailing list