RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v11]
Valerie Peng
valeriep at openjdk.org
Tue Aug 20 23:43:12 UTC 2024
On Fri, 16 Aug 2024 21:13:07 GMT, Kevin Driver <kdriver at openjdk.org> wrote:
>> src/java.base/share/classes/com/sun/crypto/provider/HkdfKeyDerivation.java line 284:
>>
>>> 282: * the input keying material used for the HKDF-Extract operation.
>>> 283: * @param salt
>>> 284: * the salt value used for HKDF-Extract. If no salt is to be used a
>>
>> "If no salt is to be used a {@code null} value should be provided." should be "or {@code null} if no salt value is provided." as in the `hkdfExpand()` method javadoc.
>
> Addressed in https://github.com/openjdk/jdk/pull/20301/commits/c6f491cd05c76088e6431b2ba9d4ab42b29e4055. Please indicate if this is resolved.
"{@code null} if no salt is to be used" seems incorrect as RFC 5869 states that "if not provided, a string of HashLen zeros is used". It is more precise to use "{@code null} if no salt value is provided" as stated in RFC 5869.
>> src/java.base/share/classes/com/sun/crypto/provider/HkdfKeyDerivation.java line 312:
>>
>>> 310: * Perform the HMAC-Expand operation. At the end of the operation, the
>>> 311: * keyStream instance variable will contain the complete KDF output based on
>>> 312: * the input values and desired length.
>>
>> These lines are outdated? I can't find any `keyStream` instance variable.
>
> Addressed in https://github.com/openjdk/jdk/pull/20301/commits/c6f491cd05c76088e6431b2ba9d4ab42b29e4055. Please indicate if this is resolved.
Yes, resolved.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1724095634
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1724097204
More information about the security-dev
mailing list