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

Kevin Driver kdriver at openjdk.org
Fri Aug 16 21:16:35 UTC 2024


On Thu, 8 Aug 2024 19:30:31 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Kevin Driver has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 16 additional commits since the last revision:
>> 
>>  - update test to include Spi updates
>>  - Update with latest from master
>>    
>>    Merge remote-tracking branch 'origin/master' into kdf-jep-wip
>>    # Please enter a commit message to explain why this merge is necessary,
>>    # especially if it merges an updated upstream into a topic branch.
>>    #
>>    # Lines starting with '#' will be ignored, and an empty message aborts
>>    # the commit.
>>  - add engineGetKDFParameters to the KDFSpi
>>  - code review comment fix for javadoc specification
>>  - change course on null return values from derive methods
>>  - code review comments
>>  - threading refactor + code review comments
>>  - review comments
>>  - review comments
>>  - update code snippet type in KDF
>>  - ... and 6 more: https://git.openjdk.org/jdk/compare/2638d442...dd2ee48f
>
> src/java.base/share/classes/javax/crypto/KDF.java line 286:
> 
>> 284:     public static KDF getInstance(String algorithm, Provider provider)
>> 285:         throws NoSuchAlgorithmException {
>> 286:         Objects.requireNonNull(provider, "provider may not be null");
> 
> See the above comment for null-check inconsistency.

Addressed in https://github.com/openjdk/jdk/pull/20301/commits/c6f491cd05c76088e6431b2ba9d4ab42b29e4055. Please indicate if this is resolved.

> src/java.base/share/classes/javax/crypto/KDF.java line 469:
> 
>> 467:      * @throws InvalidAlgorithmParameterException
>> 468:      *     if the information contained within the {@code kdfParameterSpec} is
>> 469:      *     invalid, if {@code alg} is invalid, or if their combination
> 
> Again, what is the definition of `alg` being invalid? Would it be clearer to just refer to `KDFSpi.engineDeriveKey()` and not duplicating the words here?

Addressed in https://github.com/openjdk/jdk/pull/20301/commits/c6f491cd05c76088e6431b2ba9d4ab42b29e4055. Please indicate if this is resolved.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1720350883
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1720355809



More information about the security-dev mailing list