RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v9]
Sean Mullan
mullan at openjdk.org
Mon Aug 5 20:18:36 UTC 2024
On Tue, 30 Jul 2024 16:04:25 GMT, Kevin Driver <kdriver at openjdk.org> wrote:
>> src/java.base/share/classes/javax/crypto/spec/HKDFParameterSpec.java line 328:
>>
>>> 326: }
>>> 327:
>>> 328: private Extract(List<SecretKey> ikms, List<SecretKey> salts) {
>>
>> Should it throw an exception if either or both of the lists are empty?
>
> See the discussion here: https://github.com/C2SP/wycheproof/issues/114
>
> @wangweij has been discussing this issue, and it looks like openssl permits "empty" IKM values. We already know from the RFC that salt is optional, but the RFC is less explicit about IKM.
If that's the case, then I think the `ikms` and `salts` method should specify that an empty List may be returned and under what conditions, as it is an edge case. For example, "Returns an empty list if there are no salt values".
P.S. Let's not resolve the comment until the submitter has a chance to respond to the proposed solution, if it still could use discussion/agreement or is not what the submitter had requested.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1704586163
More information about the security-dev
mailing list