Re: RFR: 8298420: PEM API: Implementation (Preview) [v2]

2024-07-25 Thread Anthony Scarpino
On Thu, 25 Jul 2024 20:00:53 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - bad test check >> - internal PEMRecord optimization > > src/java.base/share/classes/javax/crypto/EncryptedPrivate

Re: RFR: 8298420: PEM API: Implementation (Preview) [v2]

2024-07-25 Thread Anthony Scarpino
On Thu, 25 Jul 2024 15:42:59 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - bad test check >> - internal PEMRecord optimization > > src/java.base/share/classes/java/security/Key.java line 1

Re: RFR: 8298420: PEM API: Implementation (Preview) [v2]

2024-07-25 Thread Anthony Scarpino
On Thu, 25 Jul 2024 21:02:19 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - bad test check >> - internal PEMRecord optimization > > src/java.base/share/classes/sun/security/util/Pem.java li

Re: RFR: 8298420: PEM API: Implementation (Preview) [v2]

2024-07-25 Thread Anthony Scarpino
On Thu, 25 Jul 2024 22:41:28 GMT, Weijun Wang wrote: >> Anthony Scarpino has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - bad test check >> - internal PEMRecord optimization > > test/jdk/sun/security/pkcs11/ec/policy line 6: > >> 4:

Re: RFR: 8298420: PEM API: Implementation (Preview) [v2]

2024-07-25 Thread Anthony Scarpino
> Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features does not > permanently define the API and it is subject to cha

Re: RFR: 8298420: PEM API: Implementation (Preview)

2024-07-25 Thread Anthony Scarpino
On Wed, 24 Jan 2024 00:01:06 GMT, Anthony Scarpino wrote: > Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features do

Re: RFR: 8336240: Test com/sun/crypto/provider/Cipher/DES/PerformanceTest.java fails with java.lang.ArithmeticException [v5]

2024-07-25 Thread Bradford Wetmore
On Thu, 25 Jul 2024 09:46:48 GMT, Fernando Guallini wrote: >> The manual test Cipher/DES/PerformanceTest.java fails with >> ArithmeticException due to potential division by zero. The issue arises when >> calculating the elapsed time using end - start, which could result in zero >> millisecond

Re: RFR: 8298420: PEM API: Implementation (Preview)

2024-07-25 Thread Weijun Wang
On Wed, 24 Jan 2024 00:01:06 GMT, Anthony Scarpino wrote: > Hi all, > > I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format > for encoding and decoding cryptographic keys and certificates. It will be > integrated into JDK24 as a Preview Feature. Preview features do

Re: RFR: 8336934: Clean up JavaLangReflectAccess

2024-07-25 Thread Chen Liang
On Thu, 25 Jul 2024 21:38:04 GMT, Roger Riggs wrote: >> Removed redundant APIs in `JavaLangReflectAccess` and added general warning >> against using `SharedSecrets`. > > src/java.base/share/classes/jdk/internal/access/JavaLangReflectAccess.java > line 53: > >> 51: // >> 52: >> 53: //

Re: RFR: 8336934: Clean up JavaLangReflectAccess

2024-07-25 Thread Roger Riggs
On Tue, 23 Jul 2024 04:10:38 GMT, Chen Liang wrote: > Removed redundant APIs in `JavaLangReflectAccess` and added general warning > against using `SharedSecrets`. src/java.base/share/classes/java/lang/reflect/Constructor.java line 168: > 166: } > 167: > 168: /** Creates a new root con

Re: RFR: 8336934: Clean up JavaLangReflectAccess

2024-07-25 Thread Roger Riggs
On Tue, 23 Jul 2024 04:10:38 GMT, Chen Liang wrote: > Removed redundant APIs in `JavaLangReflectAccess` and added general warning > against using `SharedSecrets`. The description should include a summary of the changes and the rationale. The Jira description is a bit better and could also be mo

Re: RFR: 8336667: IAE in DerInputStream.toByteArray

2024-07-25 Thread Weijun Wang
On Thu, 25 Jul 2024 19:04:12 GMT, Hai-May Chao wrote: > Nice to have new PoC.java test to cover indefinite length encoding. Looks > good. The other test -- from the bug reporter -- also contains indefinite length encoding deep inside, but the `PoC.java` test makes it more obvious what goes wr

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

2024-07-25 Thread Kevin Driver
> Introduce an API for Key Derivation Functions (KDFs), which are cryptographic > algorithms for deriving additional keys from a secret key and other data. See > [JEP 478](https://openjdk.org/jeps/478). > > Work was begun in [another PR](https://github.com/openjdk/jdk/pull/18924). Kevin Driver

Re: RFR: 8336667: IAE in DerInputStream.toByteArray

2024-07-25 Thread Hai-May Chao
On Mon, 22 Jul 2024 21:28:07 GMT, Weijun Wang wrote: > When reading an indefinite BER `DerValue` from a `DerInputStream`, the > current position of the stream must be placed right after the BER. There is a > bug in the calculation. Nice to have new PoC.java test to cover indefinite length enco

Integrated: 8336667: IAE in DerInputStream.toByteArray

2024-07-25 Thread Weijun Wang
On Mon, 22 Jul 2024 21:28:07 GMT, Weijun Wang wrote: > When reading an indefinite BER `DerValue` from a `DerInputStream`, the > current position of the stream must be placed right after the BER. There is a > bug in the calculation. This pull request has now been integrated. Changeset: b5b5a5b

Re: RFR: 8336667: IAE in DerInputStream.toByteArray

2024-07-25 Thread Valerie Peng
On Mon, 22 Jul 2024 21:28:07 GMT, Weijun Wang wrote: > When reading an indefinite BER `DerValue` from a `DerInputStream`, the > current position of the stream must be placed right after the BER. There is a > bug in the calculation. Look good. Thanks~ - Marked as reviewed by valer

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

2024-07-25 Thread Kevin Driver
> Introduce an API for Key Derivation Functions (KDFs), which are cryptographic > algorithms for deriving additional keys from a secret key and other data. See > [JEP 478](https://openjdk.org/jeps/478). > > Work was begun in [another PR](https://github.com/openjdk/jdk/pull/18924). Kevin Driver

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

2024-07-25 Thread Kevin Driver
On Thu, 25 Jul 2024 15:39:46 GMT, Kevin Driver wrote: >> src/java.base/share/classes/javax/crypto/KDF.java line 138: >> >>> 136: // the lock is not needed, because the Spi will already be set >>> in >>> 137: // chooseProvider >>> 138: lock = null; >> >> I guess that by

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

2024-07-25 Thread Kevin Driver
On Wed, 24 Jul 2024 21:06:56 GMT, Martin Balao wrote: >> Kevin Driver has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. The pull request contains one >> new comm

Re: RFR: 8336240: Test com/sun/crypto/provider/Cipher/DES/PerformanceTest.java fails with java.lang.ArithmeticException [v5]

2024-07-25 Thread Fernando Guallini
> The manual test Cipher/DES/PerformanceTest.java fails with > ArithmeticException due to potential division by zero. The issue arises when > calculating the elapsed time using end - start, which could result in zero > milliseconds if start and end are identical due to the high speed of > execu