RFR: 8342181: Update tests to use stronger Key and Salt size [v6]

Rajan Halade rhalade at openjdk.org
Wed Oct 30 17:31:11 UTC 2024


On Tue, 22 Oct 2024 10:52:23 GMT, Fernando Guallini <fguallini at openjdk.org> wrote:

>> Several tests currently use weak key and salt sizes. Since the purpose of these tests is not to evaluate weak keys, they can be updated to use stronger keys length (2048-bits) and stronger Salt (16 bytes). This PR does not intend to update the tests to use stronger algorithms.
>> 
>> There is no significant increase in tests run time, those still complete consistently fast (few seconds).
>
> Fernando Guallini has updated the pull request incrementally with one additional commit since the last revision:
> 
>   KeyToolTest.java will be updated in another PR

test/lib/jdk/test/lib/security/SecurityUtils.java line 113:

> 111: 
> 112:     /**
> 113:      * Returns a strong salt size for tests

Don't call it strong. It should be "Returns a salt size to be used for testing". Update on the similar line for `getTestKeySize` method.

test/lib/jdk/test/lib/security/SecurityUtils.java line 125:

> 123:         int testKeySize;
> 124:         switch (algo) {
> 125:             case "RSA" -> testKeySize = KeySize.RSA.keySize;

May be code should just use `return KeySize.RSA.keySize`

test/lib/jdk/test/lib/security/SecurityUtils.java line 153:

> 151:     private SecurityUtils() {}
> 152: 
> 153:     private enum KeySize{

Move this enum declaration to the top of the file. And I suggest you to rename enum to `TestKeySize`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21537#discussion_r1811087218
PR Review Comment: https://git.openjdk.org/jdk/pull/21537#discussion_r1811082741
PR Review Comment: https://git.openjdk.org/jdk/pull/21537#discussion_r1811079884


More information about the security-dev mailing list