RFR: 8322133: getParameterSpec(ECGenParameterSpec.class) on EC AlgorithmParameters does not return standard names

Sean Mullan mullan at openjdk.org
Tue Jul 9 17:00:35 UTC 2024


On Wed, 3 Jul 2024 15:38:49 GMT, Ben Perez <duke at openjdk.org> wrote:

> 8322133: getParameterSpec(ECGenParameterSpec.class) on EC AlgorithmParameters  does not return standard names

Changes requested by mullan (Reviewer).

test/jdk/sun/security/util/misc/CurveGetParameterSpec.java line 1:

> 1: /*

I think a better location for this test is `test/jdk/com/sun/crypto/provider/AlgorithmParameters/EC`.

test/jdk/sun/security/util/misc/CurveGetParameterSpec.java line 41:

> 39:         a.init(k.getParams());
> 40:         String name = a.getParameterSpec(ECGenParameterSpec.class).getName();
> 41:         if (!name.equals("secp384r1")) {

The default curve ("secp384r1") may change in the future. Suggest specifying desired curve name with `KeyPairGenerator.init()`.

Also, in the exception message, can you also print the name that was returned?

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

PR Review: https://git.openjdk.org/jdk/pull/20010#pullrequestreview-2166905954
PR Review Comment: https://git.openjdk.org/jdk/pull/20010#discussion_r1670881318
PR Review Comment: https://git.openjdk.org/jdk/pull/20010#discussion_r1670885409



More information about the security-dev mailing list