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

Kevin Driver kdriver at openjdk.org
Wed Aug 28 20:44:10 UTC 2024


On Mon, 26 Aug 2024 17:56:21 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Kevin Driver has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   code review comments and test renaming
>
> src/java.base/share/classes/com/sun/crypto/provider/HkdfKeyDerivation.java line 194:
> 
>> 192:                                      length);
>> 193:             } catch (InvalidKeyException ike) {
>> 194:                 throw (InvalidAlgorithmParameterException) new InvalidAlgorithmParameterException(
> 
> IAPE has a ctor with cause as an argument.

Resolved in https://github.com/openjdk/jdk/pull/20301/commits/a65dc9da044297c313e02d698255bad915dc0a10.

> src/java.base/share/classes/javax/crypto/KDF.java line 319:
> 
>> 317:      * @throws InvalidAlgorithmParameterException
>> 318:      *     if the initialization parameters are inappropriate for this
>> 319:      *     {@code KDF} or if no provider can be found which supports the
> 
> What does "this KDF" mean? This is a static method and there is no instance yet.

Resolved in https://github.com/openjdk/jdk/pull/20301/commits/a65dc9da044297c313e02d698255bad915dc0a10.

> src/java.base/share/classes/javax/crypto/KDFSpi.java line 52:
> 
>> 50:  * {@code null} to be passed, otherwise an {@code InvalidAlgorithmParameterException}
>> 51:  * may be thrown. On the other hand, implementations which require
>> 52:  * {@code KDFParameters} may throw an {@code InvalidAlgorithmParameterException}
> 
> This is not only `may`, this is `must` or `should`.

Resolved in https://github.com/openjdk/jdk/pull/20301/commits/a65dc9da044297c313e02d698255bad915dc0a10.

> src/java.base/share/classes/javax/crypto/KDFSpi.java line 55:
> 
>> 53:  * upon receiving a {@code null} value. Furthermore, implementations
>> 54:  * may supply default values for {@code KDFParameters}, mutating the
>> 55:  * object. In that case, {@link KDFSpi#engineGetParameters()} would supply
> 
> Change `would` to `should`. This is requirement for the implementation.

Resolved in https://github.com/openjdk/jdk/pull/20301/commits/a65dc9da044297c313e02d698255bad915dc0a10.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1735262279
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1735261195
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1735261674
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1735261561


More information about the security-dev mailing list