Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread Xue-Lei Andrew Fan
On Thu, 18 Mar 2021 01:27:26 GMT, Valerie Peng wrote: >> src/java.base/share/classes/sun/security/jca/JCAUtil.java line 86: >> >>> 84: SecureRandom result = def; >>> 85: if (result == null) { >>> 86: synchronized (JCAUtil.class) { >> >> Could this lock be avoided if

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread Xue-Lei Andrew Fan
On Wed, 17 Mar 2021 20:09:04 GMT, Valerie Peng wrote: >> Can someone help review this somewhat trivial change? >> >> Updated JCAUtil class to return the cached SecureRandom object only when the >> provider configuration has not changed. >> Added a regression test to check the affected classes,

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v2]

2021-03-17 Thread Valerie Peng
On Wed, 17 Mar 2021 20:40:16 GMT, Xue-Lei Andrew Fan wrote: >> To minimize the impact, I leave the JCAUtil.getSecureRandom() impl as is. I >> suppose this is more for JDK internal code which is not required to use the >> most preferred SecureRandom impl. There are quite a few callers to this >

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread Valerie Peng
On Wed, 17 Mar 2021 20:49:41 GMT, Xue-Lei Andrew Fan wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fixed a null race condition > > src/java.base/share/classes/sun/security/jca/JCAUtil.java line 86: > >> 84:

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread Valerie Peng
On Wed, 17 Mar 2021 21:03:38 GMT, Anthony Scarpino wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fixed a null race condition > > Marked as reviewed by ascarpino (Reviewer). Thanks all for the review and feedbac

Re: RFR: 8263404: RsaPrivateKeySpec is always recognized as RSAPrivateCrtKeySpec in RSAKeyFactory.engineGetKeySpec [v3]

2021-03-17 Thread Ziyi Luo
> This is a P2 regression introduced by JDK-8254717. > > In `RSAKeyFactory.engineGetKeySpec`, when the key is a RSA key and the > KeySpec is RSAPrivateKeySpec or RSAPrivateCrtKeySpec. The method behavior is > described as follow: > > X-axis: type of `keySpec` > Y-axis: type of `key` > > Before

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread Anthony Scarpino
On Wed, 17 Mar 2021 20:13:43 GMT, SalusaSecondus wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fixed a null race condition > > Not that my review counts towards approval, but this looks good to me (and > fixes

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread Anthony Scarpino
On Wed, 17 Mar 2021 20:09:04 GMT, Valerie Peng wrote: >> Can someone help review this somewhat trivial change? >> >> Updated JCAUtil class to return the cached SecureRandom object only when the >> provider configuration has not changed. >> Added a regression test to check the affected classes,

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread Xue-Lei Andrew Fan
On Wed, 17 Mar 2021 20:09:04 GMT, Valerie Peng wrote: >> Can someone help review this somewhat trivial change? >> >> Updated JCAUtil class to return the cached SecureRandom object only when the >> provider configuration has not changed. >> Added a regression test to check the affected classes,

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v2]

2021-03-17 Thread Xue-Lei Andrew Fan
On Wed, 17 Mar 2021 19:55:13 GMT, Valerie Peng wrote: > To minimize the impact, I leave the JCAUtil.getSecureRandom() impl as is. I > suppose this is more for JDK internal code which is not required to use the > most preferred SecureRandom impl. There are quite a few callers to this > method a

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread SalusaSecondus
On Wed, 17 Mar 2021 20:09:04 GMT, Valerie Peng wrote: >> Can someone help review this somewhat trivial change? >> >> Updated JCAUtil class to return the cached SecureRandom object only when the >> provider configuration has not changed. >> Added a regression test to check the affected classes,

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v3]

2021-03-17 Thread Valerie Peng
> Can someone help review this somewhat trivial change? > > Updated JCAUtil class to return the cached SecureRandom object only when the > provider configuration has not changed. > Added a regression test to check the affected classes, i.e. > AlgorithmParameterGenerator, KeyPairGenerator, Ciphe

RE: [11u] RFR 8259886: Improve SSL session cache performance and scalability

2021-03-17 Thread Hohensee, Paul
Np, tagged. -Original Message- From: Daniel Jeliński Date: Tuesday, March 16, 2021 at 11:40 PM To: "Hohensee, Paul" Cc: "[email protected]" , "[email protected]" Subject: RE: [11u] RFR 8259886: Improve SSL session cache performance and scalability Thanks a

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v2]

2021-03-17 Thread Valerie Peng
On Wed, 17 Mar 2021 19:34:54 GMT, SalusaSecondus wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Changed to use volatile for the default SecureRandom object reference > > src/java.base/share/classes/sun/security/j

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v2]

2021-03-17 Thread SalusaSecondus
On Wed, 17 Mar 2021 19:25:13 GMT, Valerie Peng wrote: >> Can someone help review this somewhat trivial change? >> >> Updated JCAUtil class to return the cached SecureRandom object only when the >> provider configuration has not changed. >> Added a regression test to check the affected classes,

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v2]

2021-03-17 Thread Valerie Peng
On Wed, 17 Mar 2021 19:32:56 GMT, SalusaSecondus wrote: >> Valerie Peng has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Changed to use volatile for the default SecureRandom object reference > > src/java.base/share/classes/sun/security/j

Re: RFR: 8260274: Cipher.init(int, key) does not use highest priority provider for random bytes [v2]

2021-03-17 Thread Valerie Peng
> Can someone help review this somewhat trivial change? > > Updated JCAUtil class to return the cached SecureRandom object only when the > provider configuration has not changed. > Added a regression test to check the affected classes, i.e. > AlgorithmParameterGenerator, KeyPairGenerator, Ciphe

RFR: 8263743: redundant lock in SSLSocketImpl

2021-03-17 Thread Xue-Lei Andrew Fan
Remove redundant lock in SSLSocketImpl. In the SSLSocketImpl, there is a socket level lock while reading application data (see readApplicationRecord). socketLock.lock(); try { plainText = decode(buffer); } finally {

Integrated: 8148937: (str) Adapt StringJoiner for Compact Strings

2021-03-17 Thread Сергей Цыпанов
On Thu, 18 Feb 2021 14:30:15 GMT, Сергей Цыпанов wrote: > Hello, > > as of now `java.util.StringJoiner` still uses `char[]` as a storage for > joined Strings. > > This applies for the cases when all joined Strings as well as delimiter, > prefix and suffix contain only ASCII symbols. > > As

Re: RFR: 8148937: (str) Adapt StringJoiner for Compact Strings [v3]

2021-03-17 Thread Chris Hegarty
On Mon, 15 Mar 2021 21:47:28 GMT, Сергей Цыпанов wrote: >> Hello, >> >> as of now `java.util.StringJoiner` still uses `char[]` as a storage for >> joined Strings. >> >> This applies for the cases when all joined Strings as well as delimiter, >> prefix and suffix contain only ASCII symbols. >

Re: RFR: 8263658: Use the blessed modifier order in java.base

2021-03-17 Thread Roger Riggs
On Sat, 13 Mar 2021 22:45:30 GMT, Alex Blewitt wrote: > Sonar displays a warning message that modifiers should be declared in the > order listed in the JLS; specifically, that isntead of using `final static` > the `static final` should be preferred. > > This fixes the issues in the `java.base

RFR: 8263658: Use the blessed modifier order in java.base

2021-03-17 Thread Alex Blewitt
Sonar displays a warning message that modifiers should be declared in the order listed in the JLS; specifically, that isntead of using `final static` the `static final` should be preferred. This fixes the issues in the `java.base` package for ease of reviewing. https://sonarcloud.io/project/iss

Re: RFR: 8263658: Use the blessed modifier order in java.base

2021-03-17 Thread Aleksey Shipilev
On Sat, 13 Mar 2021 22:45:30 GMT, Alex Blewitt wrote: > Sonar displays a warning message that modifiers should be declared in the > order listed in the JLS; specifically, that isntead of using `final static` > the `static final` should be preferred. > > This fixes the issues in the `java.base

Re: Request for comment: the session ticket protection scheme for distributed TLS sessions.

2021-03-17 Thread Daniel Jeliński
Hi Xuelei, I reviewed the RFC above (I hope I'm not too late!) and have some concerns about the security properties of the proposed solution. Essentially they would apply to all schemes using session ticket encryption keys derived from a long-lived secret. How does this apply to TLS versions befor