Re: RFR: 8259065: Optimize MessageDigest.getInstance [v4]

2021-01-07 Thread Valerie Peng
On Thu, 7 Jan 2021 21:18:22 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/security/Provider.java line 1072: >> >>> 1070: } >>> 1071: public int hashCode() { >>> 1072: return 31*31 + type.hashCode()*31 + algorithm.hashCode(); >> >> Well, perhaps we ju

Re: RFR: 8259065: Optimize MessageDigest.getInstance [v5]

2021-01-07 Thread Valerie Peng
On Thu, 7 Jan 2021 21:23:19 GMT, Claes Redestad wrote: >> By caching default constructors used in >> `java.security.Provider::newInstanceUtil` in a `ClassValue`, we can reduce >> the overhead of allocating instances in a variety of places, e.g., >> `MessageDigest::getInstance`, without comprom

Re: RFR: 8237578: JDK-8214339 (SSLSocketImpl wraps SocketException) appears to not be fully fixed

2021-01-07 Thread Xue-Lei Andrew Fan
On Wed, 6 Jan 2021 23:28:34 GMT, Clive Verghese wrote: > This PR aims to revert some more cases where SocketExceptions are improperly > being wrapped as SSLException. Some work for this was done in > [JDK-8235263](https://bugs.openjdk.java.net/browse/JDK-8235263), but that > change did not cov

Re: RFR: 8237578: JDK-8214339 (SSLSocketImpl wraps SocketException) appears to not be fully fixed

2021-01-07 Thread Xue-Lei Andrew Fan
On Thu, 7 Jan 2021 21:04:48 GMT, Clive Verghese wrote: > While looking into the TrustTrustedCert.java test, we found out this change > may cause the test to fails intermittently. This is because it's is not > expecting a SocketException in Line 134. The root cause for this intermittent > failu

Re: RFR: 8237578: JDK-8214339 (SSLSocketImpl wraps SocketException) appears to not be fully fixed

2021-01-07 Thread Michael Osipov
On Wed, 6 Jan 2021 23:56:35 GMT, Xue-Lei Andrew Fan wrote: >> This PR aims to revert some more cases where SocketExceptions are improperly >> being wrapped as SSLException. Some work for this was done in >> [JDK-8235263](https://bugs.openjdk.java.net/browse/JDK-8235263), but that >> change did

Re: RFR: 8259319: Illegal package access when SunPKCS11 requires SunJCE's classes

2021-01-07 Thread Sean Mullan
On Wed, 6 Jan 2021 15:33:59 GMT, Martin Balao wrote: > As described in JDK-8259319 [1], this fix proposal is to set proper access > permissions so the SunPKCS11 provider can create instances of SunJCE classes > when a Security Manager is installed and the fallback scheme is used. > > No regres

Re: RFR: 8259065: Optimize MessageDigest.getInstance [v4]

2021-01-07 Thread Claes Redestad
On Thu, 7 Jan 2021 19:50:44 GMT, Valerie Peng wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Address review comments from @valeriep > > src/java.base/share/classes/java/security/Provider.java line 1072: > >> 10

Re: RFR: 8259065: Optimize MessageDigest.getInstance [v5]

2021-01-07 Thread Claes Redestad
> By caching default constructors used in > `java.security.Provider::newInstanceUtil` in a `ClassValue`, we can reduce > the overhead of allocating instances in a variety of places, e.g., > `MessageDigest::getInstance`, without compromising thread-safety or security. > > On the provided microbe

Re: RFR: 8237578: JDK-8214339 (SSLSocketImpl wraps SocketException) appears to not be fully fixed

2021-01-07 Thread Clive Verghese
On Wed, 6 Jan 2021 23:56:35 GMT, Xue-Lei Andrew Fan wrote: >> This PR aims to revert some more cases where SocketExceptions are improperly >> being wrapped as SSLException. Some work for this was done in >> [JDK-8235263](https://bugs.openjdk.java.net/browse/JDK-8235263), but that >> change did

Re: RFR: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures [v2]

2021-01-07 Thread Valerie Peng
On Thu, 7 Jan 2021 20:29:35 GMT, Martin Balao wrote: >> test/jdk/sun/security/pkcs11/Cipher/CancelMultipart.java line 50: >> >>> 48: } >>> 49: >>> 50: private static class SessionLeaker { >> >> The term "leak/leaker" is used extensively in the test, however, this is not >> really a le

Re: RFR: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures

2021-01-07 Thread Martin Balao
On Thu, 7 Jan 2021 18:56:03 GMT, Martin Balao wrote: > In summary, I believe we need changes in the OpenJDK side to properly handle > CKR_BUFFER_TOO_SMALL errors when C_SignFinal or C_Sign PKCS#11 functions are > called from P11Signature. Even if other error types or functions such as > C_Veri

Re: RFR: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures [v2]

2021-01-07 Thread Martin Balao
On Tue, 5 Jan 2021 19:41:27 GMT, Valerie Peng wrote: >> Martin Balao has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Comment describing the CancelMultipart test assertion. > > test/jdk/sun/security/pkcs11/Cipher/CancelMultipart.java line

Re: RFR: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures [v2]

2021-01-07 Thread Martin Balao
On Tue, 5 Jan 2021 19:32:42 GMT, Valerie Peng wrote: >> Martin Balao has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Comment describing the CancelMultipart test assertion. > > test/jdk/sun/security/pkcs11/Cipher/CancelMultipart.java line

Re: RFR: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures [v2]

2021-01-07 Thread Martin Balao
> When a multi-part cipher operation fails in SunPKCS11 (i.e. because of an > invalid block size), we now cancel the operation before returning the > underlying Session to the Session Manager. This allows to use the returned > Session for a different purpose. Otherwise, an CKR_OPERATION_ACTIVE e

Re: RFR: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures

2021-01-07 Thread Martin Balao
On Tue, 5 Jan 2021 19:30:13 GMT, Valerie Peng wrote: >> When a multi-part cipher operation fails in SunPKCS11 (i.e. because of an >> invalid block size), we now cancel the operation before returning the >> underlying Session to the Session Manager. This allows to use the returned >> Session fo

Re: RFR: 8259065: Optimize MessageDigest.getInstance [v4]

2021-01-07 Thread Valerie Peng
On Thu, 7 Jan 2021 03:59:13 GMT, Claes Redestad wrote: >> By caching default constructors used in >> `java.security.Provider::newInstanceUtil` in a `ClassValue`, we can reduce >> the overhead of allocating instances in a variety of places, e.g., >> `MessageDigest::getInstance`, without comprom

Re: RFR: 8259319: Illegal package access when SunPKCS11 requires SunJCE's classes

2021-01-07 Thread Valerie Peng
On Wed, 6 Jan 2021 15:33:59 GMT, Martin Balao wrote: > As described in JDK-8259319 [1], this fix proposal is to set proper access > permissions so the SunPKCS11 provider can create instances of SunJCE classes > when a Security Manager is installed and the fallback scheme is used. > > No regres

[jdk16] Integrated: 8039278: console.sh failed Automatically with exit code 1

2021-01-07 Thread Rajan Halade
Reviewed-by: xuelei, weijun - Commit messages: - 8039278: console.sh failed Automatically with exit code 1 Changes: https://git.openjdk.java.net/jdk16/pull/93/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk16&pr=93&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK

[jdk16] Integrated: 8039278: console.sh failed Automatically with exit code 1

2021-01-07 Thread Rajan Halade
On Thu, 7 Jan 2021 19:19:32 GMT, Rajan Halade wrote: > Reviewed-by: xuelei, weijun This pull request has now been integrated. Changeset: 1973fbee Author:Rajan Halade URL: https://git.openjdk.java.net/jdk16/commit/1973fbee Stats: 130 lines in 2 files changed: 0 ins; 129 del; 1 mod

Re: RFR: 8258833: Cancel multi-part cipher operations in SunPKCS11 after failures

2021-01-07 Thread Martin Balao
On Mon, 4 Jan 2021 21:35:48 GMT, Valerie Peng wrote: >> When a multi-part cipher operation fails in SunPKCS11 (i.e. because of an >> invalid block size), we now cancel the operation before returning the >> underlying Session to the Session Manager. This allows to use the returned >> Session fo

Re: RFR: 8039278: console.sh failed Automatically with exit code 1

2021-01-07 Thread Xue-Lei Andrew Fan
On Thu, 7 Jan 2021 18:26:12 GMT, Rajan Halade wrote: > 8039278: console.sh failed Automatically with exit code 1 Marked as reviewed by xuelei (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/1981

Re: RFR: 8039278: console.sh failed Automatically with exit code 1

2021-01-07 Thread Weijun Wang
On Thu, 7 Jan 2021 18:26:12 GMT, Rajan Halade wrote: > 8039278: console.sh failed Automatically with exit code 1 Marked as reviewed by weijun (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/1981

Integrated: 8039278: console.sh failed Automatically with exit code 1

2021-01-07 Thread Rajan Halade
On Thu, 7 Jan 2021 18:26:12 GMT, Rajan Halade wrote: > 8039278: console.sh failed Automatically with exit code 1 This pull request has now been integrated. Changeset: 4ce83f2a Author:Rajan Halade URL: https://git.openjdk.java.net/jdk/commit/4ce83f2a Stats: 130 lines in 2 files ch

RFR: 8039278: console.sh failed Automatically with exit code 1

2021-01-07 Thread Rajan Halade
8039278: console.sh failed Automatically with exit code 1 - Commit messages: - 8039278: update TEST.groups to remove console.sh - 8039278: console.sh failed Automatically with exit code 1 Changes: https://git.openjdk.java.net/jdk/pull/1981/files Webrev: https://webrevs.openjdk.jav

RFR: 8259385: Cleanup unused assignment

2021-01-07 Thread Xue-Lei Andrew Fan
In the SunJSSE provider implementation, there are a few cases that the assigned value is never used. For example: int i = 0; i = Byte.toUnsignedInt(buf.get()); could be simplified as `int i = Byte.toUnsignedInt(buf.get());` Code cleanup, no new regression test. - Commit mes

Re: RFR: 8258588: MD5 MessageDigest in java.util.UUID should be cached

2021-01-07 Thread Claes Redestad
On Thu, 7 Jan 2021 16:39:48 GMT, Peter Levart wrote: >>> I have to say that introducing a ThreadLocal here seems like a step in the >>> wrong direction. With a ThreadLocal, if I read this correctly, a >>> MessageDigest will be cached with each thread that ever calls this API, and >>> it won't

Re: RFR: 8258588: MD5 MessageDigest in java.util.UUID should be cached

2021-01-07 Thread Peter Levart
On Sun, 20 Dec 2020 22:41:33 GMT, PROgrm_JARvis wrote: >>> I have to say that introducing a ThreadLocal here seems like a step in the >>> wrong direction. With a ThreadLocal, if I read this correctly, a >>> MessageDigest will be cached with each thread that ever calls this API, and >>> it won