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

Weijun Wang weijun at openjdk.org
Sat Sep 21 14:21:59 UTC 2024


On Fri, 20 Sep 2024 20:17:00 GMT, Kevin Driver <kdriver at openjdk.org> wrote:

>> src/java.base/share/classes/javax/crypto/KDF.java line 665:
>> 
>>> 663: 
>>> 664:     private static boolean checkSpiNonNull(Delegate d) {
>>> 665:         return (d != null && d.spi() != null);
>> 
>> Can `d.spi() == null` ever happen?
>
> Based upon the most recent DPS refactor, it doesn't look possible any longer, so we could remove it. I don't see the harm in this check being present as a defensive-coding measure though.

If it's useless then remote it. We should be confidence in the logic. Adding unnecessary check will only confuse readers.

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

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


More information about the security-dev mailing list