Re: RFR: 8347946: Add API note that caller should validate/trust signers to the getCertificates and getCodeSigners methods of JarEntry and JarURLConnection

2025-02-13 Thread Jaikiran Pai
On Thu, 13 Feb 2025 16:27:03 GMT, Sean Mullan wrote: > This change adds an API note to these methods recommending that the caller > should perform further validation steps on the code signers that signed the > JAR file, such as validating the code signer's certificate chain, and > determining

Re: RFR: 8349943: [JMH] Use jvmArgs consistently

2025-02-13 Thread SendaoYan
On Thu, 13 Feb 2025 08:35:47 GMT, Nicole Xu wrote: > As is suggested in > [JDK-8342958](https://bugs.openjdk.org/browse/JDK-8342958), `jvmArgs` should > be used consistently in microbenchmarks to 'align with the intuition that > when you use jvmArgsAppend/-Prepend intent is to add to a set of

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms [v3]

2025-02-13 Thread Jamil Nimeh
> This fix makes some minor changes to the internals of the > `CertificateBuilder` and `SimpleOCSPServer` test classes. They would break > when ML-DSA was selected as key and signing algorithms. Also RSASSA-PSS > works better now with these changes. I've also taken this opportunity to do > s

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms [v2]

2025-02-13 Thread Jamil Nimeh
> This fix makes some minor changes to the internals of the > `CertificateBuilder` and `SimpleOCSPServer` test classes. They would break > when ML-DSA was selected as key and signing algorithms. Also RSASSA-PSS > works better now with these changes. I've also taken this opportunity to do > s

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms [v2]

2025-02-13 Thread Jamil Nimeh
On Thu, 13 Feb 2025 19:34:04 GMT, Sean Mullan wrote: >> Jamil Nimeh has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix JBS ID and summary in test > > test/lib/jdk/test/lib/security/CertificateBuilder.java line 462: > >> 460:

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms

2025-02-13 Thread Jamil Nimeh
On Thu, 13 Feb 2025 19:52:32 GMT, Sean Mullan wrote: > Also, should it be moved to somewhere else like > jdk/test/sun/security/provider/certpath? Hmmm...not sure about that, but maybe an explanation is in order: Because the JDK only implements the client side with OCSP, we rely on CertPathVali

RFR: 8328914: Document the java.security.debug property in javadoc

2025-02-13 Thread Koushik Muthukrishnan Thirupattur
java.security.debug is a widely used debug system property for JDK security libs. It's time to capture details about this property via javadoc. ![image](https://github.com/user-attachments/assets/2c58dd82-363e-49be-9734-755d5d0014d7) NOTE : We are adding a new html file (similar to the Networkin

Re: RFR: 8349849: PKCS11 SunTlsKeyMaterial crashes when used with TLS1.2 TlsKeyMaterialParameterSpec

2025-02-13 Thread Bradford Wetmore
On Thu, 13 Feb 2025 19:37:39 GMT, Daniel Jeliński wrote: >> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11TlsKeyMaterialGenerator.java >> line 124: >> >>> 122: } else if (tlsVersion == 0x0303) { >>> 123: mechanism = CKM_TLS12_KEY_AND_MAC_DERIVE; >>> 124:

Re: RFR: 8349943: [JMH] Use jvmArgs consistently

2025-02-13 Thread Chen Liang
On Thu, 13 Feb 2025 08:35:47 GMT, Nicole Xu wrote: > As is suggested in > [JDK-8342958](https://bugs.openjdk.org/browse/JDK-8342958), `jvmArgs` should > be used consistently in microbenchmarks to 'align with the intuition that > when you use jvmArgsAppend/-Prepend intent is to add to a set of

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms

2025-02-13 Thread Jesper Wilhelmsson
On Thu, 13 Feb 2025 19:49:37 GMT, Sean Mullan wrote: > That's a good question. I usually add the `noreg-self` label even it it is a > brand new test and not a fix to an existing test and there is no other JDK > code changes. @JesperIRL do you have any advice for this situation? `noreg-self` is

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms

2025-02-13 Thread Sean Mullan
On Thu, 13 Feb 2025 19:45:19 GMT, Sean Mullan wrote: >> This fix makes some minor changes to the internals of the >> `CertificateBuilder` and `SimpleOCSPServer` test classes. They would break >> when ML-DSA was selected as key and signing algorithms. Also RSASSA-PSS >> works better now with

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms

2025-02-13 Thread Sean Mullan
On Thu, 13 Feb 2025 18:58:00 GMT, Sean Mullan wrote: >> This fix makes some minor changes to the internals of the >> `CertificateBuilder` and `SimpleOCSPServer` test classes. They would break >> when ML-DSA was selected as key and signing algorithms. Also RSASSA-PSS >> works better now with

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms

2025-02-13 Thread Sean Mullan
On Tue, 11 Feb 2025 17:50:45 GMT, Jamil Nimeh wrote: > This fix makes some minor changes to the internals of the > `CertificateBuilder` and `SimpleOCSPServer` test classes. They would break > when ML-DSA was selected as key and signing algorithms. Also RSASSA-PSS > works better now with thes

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms

2025-02-13 Thread Jamil Nimeh
On Thu, 13 Feb 2025 18:58:00 GMT, Sean Mullan wrote: >> This fix makes some minor changes to the internals of the >> `CertificateBuilder` and `SimpleOCSPServer` test classes. They would break >> when ML-DSA was selected as key and signing algorithms. Also RSASSA-PSS >> works better now with

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms

2025-02-13 Thread Jamil Nimeh
On Tue, 11 Feb 2025 17:50:45 GMT, Jamil Nimeh wrote: > This fix makes some minor changes to the internals of the > `CertificateBuilder` and `SimpleOCSPServer` test classes. They would break > when ML-DSA was selected as key and signing algorithms. Also RSASSA-PSS > works better now with thes

Re: RFR: 8349849: PKCS11 SunTlsKeyMaterial crashes when used with TLS1.2 TlsKeyMaterialParameterSpec

2025-02-13 Thread Daniel Jeliński
On Thu, 13 Feb 2025 19:06:28 GMT, Bradford Wetmore wrote: >> Please review this trivial fix that ensures that the mechanism always >> matches the parameter class type. >> >> I added a new test case that crashes without the fix, passes with the fix. >> Existing tier1-3 test cases continue to pa

Re: RFR: 8349849: PKCS11 SunTlsKeyMaterial crashes when used with TLS1.2 TlsKeyMaterialParameterSpec

2025-02-13 Thread Bradford Wetmore
On Wed, 12 Feb 2025 10:02:55 GMT, Daniel Jeliński wrote: > Please review this trivial fix that ensures that the mechanism always matches > the parameter class type. > > I added a new test case that crashes without the fix, passes with the fix. > Existing tier1-3 test cases continue to pass. M

Re: RFR: 8349759: Fix CertificateBuilder and SimpleOCSPServer test utilities to support PQC algorithms

2025-02-13 Thread Sean Mullan
On Tue, 11 Feb 2025 17:50:45 GMT, Jamil Nimeh wrote: > This fix makes some minor changes to the internals of the > `CertificateBuilder` and `SimpleOCSPServer` test classes. They would break > when ML-DSA was selected as key and signing algorithms. Also RSASSA-PSS > works better now with thes

Re: RFR: 8349849: PKCS11 SunTlsKeyMaterial crashes when used with TLS1.2 TlsKeyMaterialParameterSpec

2025-02-13 Thread Sean Mullan
On Thu, 13 Feb 2025 18:32:41 GMT, Daniel Jeliński wrote: >> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11TlsKeyMaterialGenerator.java >> line 122: >> >>> 120: } else if (tlsVersion == 0x0301 || tlsVersion == 0x0302) { >>> 121: mechanism = CKM_TLS_KEY_AND_MAC_

Re: RFR: 8349849: PKCS11 SunTlsKeyMaterial crashes when used with TLS1.2 TlsKeyMaterialParameterSpec

2025-02-13 Thread Daniel Jeliński
On Thu, 13 Feb 2025 18:41:01 GMT, Sean Mullan wrote: >> TLS 1.2 is version 3.3. >> The versions are: >> SSL 3.0 - 3.0 >> TLS 1.0 - 3.1 >> TLS 1.1 - 3.2 >> TLS 1.2 - 3.3 > > Ah ok. So I assume TLS 1.3 is using a different code path or KDF. TLS 1.3 uses HKDF, and doesn't work with SunPKCS11 yet, s

Re: RFR: 8349849: PKCS11 SunTlsKeyMaterial crashes when used with TLS1.2 TlsKeyMaterialParameterSpec

2025-02-13 Thread Daniel Jeliński
On Thu, 13 Feb 2025 18:12:52 GMT, Sean Mullan wrote: >> Please review this trivial fix that ensures that the mechanism always >> matches the parameter class type. >> >> I added a new test case that crashes without the fix, passes with the fix. >> Existing tier1-3 test cases continue to pass. >

Re: RFR: 8349849: PKCS11 SunTlsKeyMaterial crashes when used with TLS1.2 TlsKeyMaterialParameterSpec

2025-02-13 Thread Sean Mullan
On Wed, 12 Feb 2025 10:02:55 GMT, Daniel Jeliński wrote: > Please review this trivial fix that ensures that the mechanism always matches > the parameter class type. > > I added a new test case that crashes without the fix, passes with the fix. > Existing tier1-3 test cases continue to pass. @

RFR: 8347946: Add API note that caller should validate/trust signers to the getCertificates and getCodeSigners methods of JarEntry and JarURLConnection

2025-02-13 Thread Sean Mullan
This change adds an API note to these methods recommending that the caller should perform further validation steps on the code signers that signed the JAR file, such as validating the code signer's certificate chain, and determining if the signer should be trusted. There was already a similar wa

Integrated: 8328119: Support HKDF in SunPKCS11 (Preview)

2025-02-13 Thread Martin Balao
On Mon, 18 Nov 2024 18:05:34 GMT, Martin Balao wrote: > We would like to propose an implementation of the HKDF algorithms for > SunPKCS11, aligned with the KDF API proposed for JDK 24 (see [JEP 478: Key > Derivation Function API > (Preview)](https://bugs.openjdk.org/browse/JDK-8189808)). > >

Re: RFR: 8349535: Refactor ./pkcs11/Provider/MultipleLogins.sh to java test [v3]

2025-02-13 Thread Mikhail Yankelevich
> Moved the sh file logic to jtreg java test. Mikhail Yankelevich has updated the pull request incrementally with one additional commit since the last revision: changed to use a scratch directory - Changes: - all: https://git.openjdk.org/jdk/pull/23590/files - new: https://gi

Re: RFR: 8349535: Refactor ./pkcs11/Provider/MultipleLogins.sh to java test [v2]

2025-02-13 Thread Mikhail Yankelevich
On Wed, 12 Feb 2025 19:31:31 GMT, Rajan Halade wrote: >> test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java line 63: >> >>> 61: private static void copyDbFiles() throws IOException { >>> 62: final var testFolder = System.getProperty("test.src", "."); >>> 63: final var

RFR: 8349943: [JMH] Use jvmArgs consistently

2025-02-13 Thread Nicole Xu
As is suggested in [JDK-8342958](https://bugs.openjdk.org/browse/JDK-8342958), `jvmArgs` should be used consistently in microbenchmarks to 'align with the intuition that when you use jvmArgsAppend/-Prepend intent is to add to a set of existing flags, while if you supply jvmArgs intent is "run wi