Re: RFR: 8259021: SharedSecrets should avoid double racy reads from non-volatile fields [v2]

2021-01-05 Thread Alan Bateman
On Mon, 4 Jan 2021 14:27:09 GMT, Peter Levart wrote: >> See: https://bugs.openjdk.java.net/browse/JDK-8259021 >> See also discussion in thread: >> https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-December/072798.html > > Peter Levart has updated the pull request incrementally with one

RFR: 8259065: java.security.Provider should cache default constructors

2021-01-05 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 microbenchmark `Mes

Re: RFR: 8259223: Simplify boolean expression in the SunJSSE provider

2021-01-05 Thread Sean Mullan
On Tue, 5 Jan 2021 07:06:42 GMT, Xue-Lei Andrew Fan wrote: > There are some boolean expressions that could be improved for better > readability in the SunJSSE provider implementation. For example: > > - if (cert instanceof X509Certificate == false) { > + if (!(cert instanceof X509Certificate)

Re: RFR: 8259223: Simplify boolean expression in the SunJSSE provider [v2]

2021-01-05 Thread Xue-Lei Andrew Fan
> There are some boolean expressions that could be improved for better > readability in the SunJSSE provider implementation. For example: > > - if (cert instanceof X509Certificate == false) { > + if (!(cert instanceof X509Certificate)) { > > - return isDTLS ? true : (id >= TLS10.id); > + retu

Integrated: 8259021: SharedSecrets should avoid double racy reads from non-volatile fields

2021-01-05 Thread Peter Levart
On Thu, 31 Dec 2020 10:02:01 GMT, Peter Levart wrote: > See: https://bugs.openjdk.java.net/browse/JDK-8259021 > See also discussion in thread: > https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-December/072798.html This pull request has now been integrated. Changeset: 85bac8c4 Author

Re: RFR: 8258852: Arrays.asList() for single item could be replaced with List.of() [v2]

2021-01-05 Thread Sean Mullan
On Sat, 2 Jan 2021 18:52:08 GMT, Xue-Lei Andrew Fan wrote: >> If there is only one item, the call to Arrays.asList() could be replaced >> with List.of() for less memory occupation. This update also includes some >> other code cleanup, like redundant variables in the related files. >> >> Code

Integrated: 8258852: Arrays.asList() for single item could be replaced with List.of()

2021-01-05 Thread Xue-Lei Andrew Fan
On Wed, 23 Dec 2020 00:56:25 GMT, Xue-Lei Andrew Fan wrote: > If there is only one item, the call to Arrays.asList() could be replaced with > List.of() for less memory occupation. This update also includes some other > code cleanup, like redundant variables in the related files. > > Code clea

Re: RFR: 8258852: Arrays.asList() for single item could be replaced with List.of() [v2]

2021-01-05 Thread Xue-Lei Andrew Fan
On Tue, 5 Jan 2021 18:01:12 GMT, Sean Mullan wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Replace Collections.singletonList() with List.of() > > src/java.base/share/classes/sun/security/ssl/SSLConfiguratio

Integrated: 8259223: Simplify boolean expression in the SunJSSE provider

2021-01-05 Thread Xue-Lei Andrew Fan
On Tue, 5 Jan 2021 07:06:42 GMT, Xue-Lei Andrew Fan wrote: > There are some boolean expressions that could be improved for better > readability in the SunJSSE provider implementation. For example: > > - if (cert instanceof X509Certificate == false) { > + if (!(cert instanceof X509Certificate)

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

2021-01-05 Thread Valerie Peng
On Mon, 28 Dec 2020 16:24:43 GMT, Martin Balao 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 for a

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

2021-01-05 Thread Valerie Peng
On Mon, 28 Dec 2020 16:24:43 GMT, Martin Balao 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 for a

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v10]

2021-01-05 Thread Jim Laskey
> This PR is to introduce a new random number API for the JDK. The primary API > is found in RandomGenerator and RandomGeneratorFactory. Further description > can be found in the JEP https://openjdk.java.net/jeps/356 . > > javadoc can be found at > http://cr.openjdk.java.net/~jlaskey/prng/doc/a

RFR: 8250564: Remove terminally deprecated constructor in GSSUtil

2021-01-05 Thread Joe Darcy
Back in JDK 16, two unintended default constructors were identified and deprecated for removal. The time has come to remove them. Please also review the corresponding CSRs: JDK-8258521 Remove terminally deprecated constructor in GSSUtil https://bugs.openjdk.java.net/browse/JDK-8258521 JDK-825

Re: RFR: 8250564: Remove terminally deprecated constructor in GSSUtil

2021-01-05 Thread Brian Burkhalter
On Tue, 5 Jan 2021 21:02:21 GMT, Joe Darcy wrote: > Back in JDK 16, two unintended default constructors were identified and > deprecated for removal. The time has come to remove them. > > Please also review the corresponding CSRs: > > JDK-8258521 Remove terminally deprecated constructor in GSS

Re: RFR: 8250564: Remove terminally deprecated constructor in GSSUtil

2021-01-05 Thread Stuart Marks
On Tue, 5 Jan 2021 21:02:21 GMT, Joe Darcy wrote: > Back in JDK 16, two unintended default constructors were identified and > deprecated for removal. The time has come to remove them. > > Please also review the corresponding CSRs: > > JDK-8258521 Remove terminally deprecated constructor in GSS

Re: RFR: 8259065: java.security.Provider should cache default constructors [v2]

2021-01-05 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: 8259065: java.security.Provider should cache default constructors

2021-01-05 Thread Claes Redestad
On Mon, 4 Jan 2021 16:40:50 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 compromisin

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

2021-01-05 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: 8259065: Optimize MessageDigest.getInstance

2021-01-05 Thread Claes Redestad
On Wed, 6 Jan 2021 01:05:35 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: 8259065: Optimize MessageDigest.getInstance

2021-01-05 Thread David Schlosnagle
On Wed, 6 Jan 2021 01:20:40 GMT, Claes Redestad wrote: >> I refactored and optimized the lookup code further, getting rid of a number >> of bottlenecks: >> >> - Cache Constructors in Provider.Service instead of via a ClassValue. >> - Also cache the impl Class, wrap Class and Constructor in Weak

RFR: 8259291: Cleanup unnecessary local variables

2021-01-05 Thread Xue-Lei Andrew Fan
In the SunJSSE provider implementation, there are a few local variables that is not necessary. For example: byte[] finished = prfKey.getEncoded(); return finished; could be simplified as: return prfKey.getEncoded(); Code clean up, no new regression test. - Commit

Re: RFR: 8250564: Remove terminally deprecated constructor in GSSUtil

2021-01-05 Thread Alan Bateman
On Tue, 5 Jan 2021 21:02:21 GMT, Joe Darcy wrote: > Back in JDK 16, two unintended default constructors were identified and > deprecated for removal. The time has come to remove them. > > Please also review the corresponding CSRs: > > JDK-8258521 Remove terminally deprecated constructor in GSS