Re: RFR: 8302017: Allocate BadPaddingException only if it will be thrown [v2]

2023-07-19 Thread Ferenc Rakoczi
On Tue, 18 Jul 2023 18:20:02 GMT, Valerie Peng wrote: >> Instead of falling back to unpad()/decodeSignature() I suggest to try a new >> version of encodeSignature() (in addition to trying the current version of >> it) in which you omit putting the null for params into the DER encoding and >> c

RFR: 8307185: pkcs11 native libraries make JNI calls into java code while holding GC lock

2023-07-19 Thread Daniel Jeliński
This patch fixes random deadlocks in PKCS11 decryption and encryption code. The deadlocks were caused by object allocation in `ckAssertReturnValueOK` waiting for GC; GC was in turn waiting for `ReleasePrimitiveArrayCritical`, which never happened. The fix moves the call to `ckAssertReturnValueO

Re: RFR: 8307185: pkcs11 native libraries make JNI calls into java code while holding GC lock

2023-07-19 Thread Alan Bateman
On Wed, 19 Jul 2023 12:03:14 GMT, Daniel Jeliński wrote: > This patch fixes random deadlocks in PKCS11 decryption and encryption code. > > The deadlocks were caused by object allocation in `ckAssertReturnValueOK` > waiting for GC; GC was in turn waiting for `ReleasePrimitiveArrayCritical`, > w

Re: RFR: 8307185: pkcs11 native libraries make JNI calls into java code while holding GC lock

2023-07-19 Thread Valerie Peng
On Wed, 19 Jul 2023 12:03:14 GMT, Daniel Jeliński wrote: > This patch fixes random deadlocks in PKCS11 decryption and encryption code. > > The deadlocks were caused by object allocation in `ckAssertReturnValueOK` > waiting for GC; GC was in turn waiting for `ReleasePrimitiveArrayCritical`, > w

Re: RFR: 8307185: pkcs11 native libraries make JNI calls into java code while holding GC lock

2023-07-19 Thread Valerie Peng
On Wed, 19 Jul 2023 17:26:52 GMT, Valerie Peng wrote: >> This patch fixes random deadlocks in PKCS11 decryption and encryption code. >> >> The deadlocks were caused by object allocation in `ckAssertReturnValueOK` >> waiting for GC; GC was in turn waiting for `ReleasePrimitiveArrayCritical`, >>

Re: RFR: 8307185: pkcs11 native libraries make JNI calls into java code while holding GC lock

2023-07-19 Thread Daniel Jeliński
On Wed, 19 Jul 2023 17:28:15 GMT, Valerie Peng wrote: >> src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c line 172: >> >>> 170: &ckEncryptedLen); >>> 171: >>> 172: if (directIn == 0 && inBufP != NULL) { >> >> with this change, inBufP and outB

[jdk21] RFR: 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider

2023-07-19 Thread Valerie Peng
8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider - Commit messages: - Backport 28c4d196cff8576b69cf115cda538ab1dad978d2 Changes: https://git.openjdk.org/jdk21/pull/139/files Webrev: https://webrevs.openjdk.org/?repo=jdk21&pr=139&range=00 Issue: https://bu

Re: RFR: 8307185: pkcs11 native libraries make JNI calls into java code while holding GC lock [v2]

2023-07-19 Thread Daniel Jeliński
> This patch fixes random deadlocks in PKCS11 decryption and encryption code. > > The deadlocks were caused by object allocation in `ckAssertReturnValueOK` > waiting for GC; GC was in turn waiting for `ReleasePrimitiveArrayCritical`, > which never happened. > > The fix moves the call to `ckAsse

Re: RFR: 8307185: pkcs11 native libraries make JNI calls into java code while holding GC lock [v2]

2023-07-19 Thread Valerie Peng
On Wed, 19 Jul 2023 18:03:06 GMT, Daniel Jeliński wrote: >> This patch fixes random deadlocks in PKCS11 decryption and encryption code. >> >> The deadlocks were caused by object allocation in `ckAssertReturnValueOK` >> waiting for GC; GC was in turn waiting for `ReleasePrimitiveArrayCritical`,

Re: [jdk21] RFR: 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider

2023-07-19 Thread Sean Mullan
On Wed, 19 Jul 2023 17:51:20 GMT, Valerie Peng wrote: > 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider Marked as reviewed by mullan (Reviewer). - PR Review: https://git.openjdk.org/jdk21/pull/139#pullrequestreview-1537771538

Re: [jdk21] RFR: 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider

2023-07-19 Thread Anthony Scarpino
On Wed, 19 Jul 2023 17:51:20 GMT, Valerie Peng wrote: > 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider Marked as reviewed by ascarpino (Reviewer). - PR Review: https://git.openjdk.org/jdk21/pull/139#pullrequestreview-1537839835

Re: [jdk21] RFR: 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider

2023-07-19 Thread Xue-Lei Andrew Fan
On Wed, 19 Jul 2023 17:51:20 GMT, Valerie Peng wrote: > 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider Marked as reviewed by xuelei (Reviewer). src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java line 274: > 272: } > 273: > 274:

Re: [jdk21] RFR: 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider

2023-07-19 Thread Valerie Peng
On Wed, 19 Jul 2023 21:02:56 GMT, Xue-Lei Andrew Fan wrote: >> 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider > > src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java line > 274: > >> 272: } >> 273: >> 274: SecretKey that = (

Re: [jdk21] RFR: 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider

2023-07-19 Thread Valerie Peng
On Wed, 19 Jul 2023 17:51:20 GMT, Valerie Peng wrote: > 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider /Integrate - PR Comment: https://git.openjdk.org/jdk21/pull/139#issuecomment-1642849132

Re: RFR: 8302017: Allocate BadPaddingException only if it will be thrown [v2]

2023-07-19 Thread Valerie Peng
On Wed, 19 Jul 2023 08:46:53 GMT, Ferenc Rakoczi wrote: >> @ferakocz So, with this approach, we are paying the extra cost of encode >> signature + pad (for the omit null case) even for impls conforming to RFC >> 8017 spec. Based on the current interoperability testing, do you still feel >> tha

Re: RFR: 8302017: Allocate BadPaddingException only if it will be thrown [v3]

2023-07-19 Thread Valerie Peng
> This change refactors the RSAPadding class to return an output record > containing the status instead of relying on exception object to indicate a > failure. > > Thanks in advance for review~ > Valerie Valerie Peng has updated the pull request incrementally with one additional commit since t

[jdk21] Integrated: 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider

2023-07-19 Thread Valerie Peng
On Wed, 19 Jul 2023 17:51:20 GMT, Valerie Peng wrote: > 8311902: Concurrency regression in the PBKDF2 key impl of SunJCE provider This pull request has now been integrated. Changeset: 6786fa4b Author:Valerie Peng URL: https://git.openjdk.org/jdk21/commit/6786fa4bfd536897b80136ee912a

Re: RFR: 8302017: Allocate BadPaddingException only if it will be thrown [v3]

2023-07-19 Thread Xue-Lei Andrew Fan
On Thu, 20 Jul 2023 00:39:08 GMT, Valerie Peng wrote: >> This change refactors the RSAPadding class to return an output record >> containing the status instead of relying on exception object to indicate a >> failure. >> >> Thanks in advance for review~ >> Valerie > > Valerie Peng has updated t