RFR: 8343772: Expected IAPE not thrown in KDF.getInstance (TCK)
Weijun Wang
weijun at openjdk.org
Thu Nov 7 17:04:54 UTC 2024
On Thu, 7 Nov 2024 16:28:46 GMT, Kevin Driver <kdriver at openjdk.org> wrote:
> TCK/spec compliance fix for two `getInstance` methods in KDF - unwrap a wrapped IAPE from an NSAE.
src/java.base/share/classes/javax/crypto/KDF.java line 470:
> 468: InvalidAlgorithmParameterException {
> 469: Throwable cause = e.getCause();
> 470: if (cause instanceof InvalidAlgorithmParameterException) {
You can use `instanceof InvalidAlgorithmParameterException iape`.
test/jdk/com/sun/crypto/provider/KDF/HKDFExhaustiveTest.java line 311:
> 309: Utils.runAndCheckException(
> 310: () -> KDF.getInstance(KDF_ALGORITHMS[0], new TestKDFParams(), SUNJCE),
> 311: InvalidAlgorithmParameterException.class);
How about also test the other `getInstance` method with `String provider` argument?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21961#discussion_r1833040703
PR Review Comment: https://git.openjdk.org/jdk/pull/21961#discussion_r1833042533
More information about the security-dev
mailing list