On Mon, 19 Oct 2026 12:45:54 GMT, Weijun Wang <[email protected]> wrote:

>> Hai-May Chao has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Updated with Weijun's comments
>
> src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java line 770:
> 
>> 768:                 "|java.security.interfaces.XECKey");
>> 769:         ps("KEM", "DHKEM", "com.sun.crypto.provider.DHKEM", null, 
>> attrs);
>> 770:         ps("KEM", "DH", "sun.security.ssl.DHasKEM", null, attrs);
> 
> Do we really want to expose `KEM.DH` to the public?

No, changed to not expose KM.DH from SunJCE.

> src/java.base/share/classes/sun/security/ssl/Hybrid.java line 102:
> 
>> 100:         }
>> 101:         if (name.startsWith("ML-KEM")) {
>> 102:             return KeyPairGenerator.getInstance(name, sunJCE());
> 
> Why must we instantiate from SunJCE?

Changed by passing the provider of the SunJCE instance from 
HybridService.newInstance() into the Hybrid constructor.

> src/java.base/share/classes/sun/security/ssl/Hybrid.java line 462:
> 
>> 460:             this.k2 = k2;
>> 461:             byte[] encoded1 = k1.getEncoded();
>> 462:             byte[] encoded2 = k2.getEncoded();
> 
> What if `k1` or `k2` is not extractable? Why is the old multiple round 
> `addIKM` feature dropped?

Now the new code fails if either component is not extractable, combines the 
required TLS hybrid secret bytes, cleans the temporary encodings, and destroys 
the component keys without retaining them. The multiple-addIKM() logic was 
removed because JSSE now treats the built-in hybrid result as one RAW 
concatenated secret.

> src/java.base/share/classes/sun/security/ssl/KAKeyDerivation.java line 170:
> 
>> 168:                 // A non-RAW secret from a KEM can be provider-opaque. 
>> It
>> 169:                 // must be consumed by a KDF supplied by the provider 
>> that
>> 170:                 // created it.
> 
> Now that there is no private provider, can we let delayed provider selection 
> take care of KDF selection?
> 
> What are all `getXyzProvider` methods for?

Yes, use delayed provider selection for KDF.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33433#discussion_r4335190934
PR Review Comment: https://git.openjdk.org/jdk/pull/33433#discussion_r4335191817
PR Review Comment: https://git.openjdk.org/jdk/pull/33433#discussion_r4335193373
PR Review Comment: https://git.openjdk.org/jdk/pull/33433#discussion_r4335194721

Reply via email to