Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-27 Thread Weijun Wang
On Wed, 27 Oct 2021 19:40:16 GMT, Sean Mullan wrote: >> This is complicated. Theoretically a KeyStore implementation can store some >> attributes in clear text and some encrypted, and it's probably not possible >> to know if there exist any encrypted ones before actually decrypting the >> entr

Re: RFR: 8273026: Slow LoginContext.login() on multi threading application [v5]

2021-10-27 Thread Larry-N
> This fix adds a cache of service provider classes to LoginContext (in > particular, it's a cache of LoginModules classes). The approach helps to > increase the performance of the LoginContext.login() method significantly, > especially in a multi-threading environment. Service Loader is used fo

Re: RFR: 8273026: Slow LoginContext.login() on multi threading application [v4]

2021-10-27 Thread Weijun Wang
On Wed, 27 Oct 2021 18:43:41 GMT, Larry-N wrote: >> This fix adds a cache of service provider classes to LoginContext (in >> particular, it's a cache of LoginModules classes). The approach helps to >> increase the performance of the LoginContext.login() method significantly, >> especially in a

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-27 Thread Sean Mullan
On Tue, 26 Oct 2021 15:35:40 GMT, Weijun Wang wrote: >> src/java.base/share/classes/java/security/KeyStore.java line 1035: >> >>> 1033: * not extractable (For example, if the attributes is >>> encrypted >>> 1034: * in a private key entry or a secret key entry). >>> 1035:

Re: RFR: 8231107: Allow store password to be null when saving a PKCS12 KeyStore [v3]

2021-10-27 Thread Weijun Wang
> You can create a password-less PKCS12 KeyStore file now by calling > `ks.store(outStream, null)` no matter what the default cert protection > algorithm and Mac algorithm are defined in `java.security`. > > Note: the system properties set in `ToolsJDK.gmk` to generate `cacerts` must > be retai

Re: RFR: 8225181: KeyStore should have a getAttributes method

2021-10-27 Thread Sean Mullan
On Tue, 26 Oct 2021 15:42:02 GMT, Weijun Wang wrote: >> src/java.base/share/classes/java/security/KeyStoreSpi.java line 457: >> >>> 455: */ >>> 456: public Set engineGetAttributes(String alias) { >>> 457: return Collections.emptySet(); >> >> Would `Set.of()` be better here? > >

Re: RFR: 8275918: Remove unused local variables in java.base security code [v3]

2021-10-27 Thread Andrey Turbanov
> Cleanup unused local variables. Looks like they are leftovers after > refactoring. Andrey Turbanov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: - Merge remote-tracking branch 'origin/master' into remove_unused_l

Re: RFR: 8273026: Slow LoginContext.login() on multi threading application [v3]

2021-10-27 Thread Larry-N
On Wed, 27 Oct 2021 13:06:54 GMT, Larry-N wrote: >> This fix adds a cache of service provider classes to LoginContext (in >> particular, it's a cache of LoginModules classes). The approach helps to >> increase the performance of the LoginContext.login() method significantly, >> especially in a

Re: RFR: 8273026: Slow LoginContext.login() on multi threading application [v4]

2021-10-27 Thread Larry-N
> This fix adds a cache of service provider classes to LoginContext (in > particular, it's a cache of LoginModules classes). The approach helps to > increase the performance of the LoginContext.login() method significantly, > especially in a multi-threading environment. Service Loader is used fo

Re: RFR: 8275918: Remove unused local variables in java.base security code [v2]

2021-10-27 Thread Andrey Turbanov
> Cleanup unused local variables. Looks like they are leftovers after > refactoring. Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 8275918: Remove unused local variables in java.base security code remove local variable --

Re: RFR: 8275918: Remove unused local variables in java.base security code [v2]

2021-10-27 Thread Andrey Turbanov
On Tue, 26 Oct 2021 15:18:26 GMT, Weijun Wang wrote: >> Andrey Turbanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8275918: Remove unused local variables in java.base security code >> remove local variable > > src/java.base/share/

Withdrawn: 8158689: java.security.KeyPair should implement Destroyable

2021-10-27 Thread Anthony Scarpino
On Fri, 22 Oct 2021 23:50:38 GMT, Anthony Scarpino wrote: > Hi, > > I need a review of this change. It makes KeyPair implement Destroyable and > implements the methods to call the underlying privateKey. It also sets the > public and private key to 'final'. > > The bug includes a CSR and Re

Re: RFR: 8244202: Implementation of JEP 418: Internet-Address Resolution SPI [v9]

2021-10-27 Thread Michael McMahon
On Tue, 26 Oct 2021 16:24:48 GMT, Aleksei Efimov wrote: >> This change implements a new service provider interface for host name and >> address resolution, so that java.net.InetAddress API can make use of >> resolvers other than the platform's built-in resolver. >> >> The following API classes

Re: RFR: 8257722: Improve "keytool -printcert -jarfile" output [v2]

2021-10-27 Thread Weijun Wang
On Wed, 27 Oct 2021 16:32:48 GMT, Hai-May Chao wrote: >> This change does a few improvements to the output of `keytool -printcert >> -jarfile` command to help readability and diagnosis. > > Hai-May Chao has updated the pull request incrementally with one additional > commit since the last revis

Re: RFR: 8257722: Improve "keytool -printcert -jarfile" output [v2]

2021-10-27 Thread Hai-May Chao
> This change does a few improvements to the output of `keytool -printcert > -jarfile` command to help readability and diagnosis. Hai-May Chao has updated the pull request incrementally with one additional commit since the last revision: Updated TimestampCheck test and removed its unused meth

Integrated: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes

2021-10-27 Thread Andrey Turbanov
On Thu, 9 Sep 2021 06:50:21 GMT, Andrey Turbanov wrote: > StringBuffer is a legacy synchronized class. There are more modern > alternatives which perform better: > 1. Plain String concatenation should be preferred > 2. StringBuilder is a direct replacement to StringBuffer which generally have >

Re: RFR: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs [v2]

2021-10-27 Thread Weijun Wang
On Sat, 23 Oct 2021 00:40:39 GMT, Weijun Wang wrote: >> New `Subject` APIs `current()` and `callAs()` are created to be replacements >> of `getSubject()` and `doAs()` since the latter two methods are now >> deprecated for removal. >> >> In this implementation, by default, `current()` returns t

Re: RFR: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs [v3]

2021-10-27 Thread Weijun Wang
> New `Subject` APIs `current()` and `callAs()` are created to be replacements > of `getSubject()` and `doAs()` since the latter two methods are now > deprecated for removal. > > In this implementation, by default, `current()` returns the same value as > `getSubject(AccessController.getCurrent(

Re: RFR: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs [v2]

2021-10-27 Thread Weijun Wang
On Wed, 27 Oct 2021 12:46:57 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> renames > > src/java.base/share/classes/javax/security/auth/Subject.java line 324: > >> 322: } >> 323: >> 324:

Re: RFR: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs [v2]

2021-10-27 Thread Weijun Wang
On Mon, 25 Oct 2021 20:02:14 GMT, Bernd wrote: >> Oh, it's needed. Otherwise the `AccessController.getContext()` call (which >> is inside `current()`) will also be called in a clean privileged context and >> there is no subject associated with it. >> >> On the other hand, it still needs to in

Re: RFR: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs [v2]

2021-10-27 Thread Weijun Wang
On Wed, 27 Oct 2021 13:49:18 GMT, Sean Mullan wrote: >> src/java.base/share/classes/javax/security/auth/Subject.java line 296: >> >>> 294: * which is equivalent to >>> 295: * {@code Subject.getSubject(AccessController.getContext())} >>> 296: * by default in this

Re: RFR: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs [v2]

2021-10-27 Thread Weijun Wang
On Mon, 25 Oct 2021 19:52:06 GMT, Bernd wrote: >> Sure, I can. I was testing the default value to "false" at some time and >> found `"true".equals` and `!"false".equals` symmetric and good-looking. :-) > > It probably doesn’t matter to have the Logic centralized, just looked a bit > hardcoded (

Re: RFR: 8273026: Slow LoginContext.login() on multi threading application [v3]

2021-10-27 Thread Weijun Wang
On Wed, 27 Oct 2021 13:06:54 GMT, Larry-N wrote: >> This fix adds a cache of service provider classes to LoginContext (in >> particular, it's a cache of LoginModules classes). The approach helps to >> increase the performance of the LoginContext.login() method significantly, >> especially in a

Re: RFR: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs [v2]

2021-10-27 Thread Sean Mullan
On Wed, 27 Oct 2021 12:45:57 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> renames > > src/java.base/share/classes/javax/security/auth/Subject.java line 296: > >> 294: * which is equiv

Re: RFR: 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs [v2]

2021-10-27 Thread Sean Mullan
On Sat, 23 Oct 2021 00:40:39 GMT, Weijun Wang wrote: >> New `Subject` APIs `current()` and `callAs()` are created to be replacements >> of `getSubject()` and `doAs()` since the latter two methods are now >> deprecated for removal. >> >> In this implementation, by default, `current()` returns t

Re: RFR: 8273026: Slow LoginContext.login() on multi threading application [v3]

2021-10-27 Thread Larry-N
> This fix adds a cache of service provider classes to LoginContext (in > particular, it's a cache of LoginModules classes). The approach helps to > increase the performance of the LoginContext.login() method significantly, > especially in a multi-threading environment. Service Loader is used fo

Re: RFR: 8273026: Slow LoginContext.login() on multi threading application [v2]

2021-10-27 Thread Larry-N
On Wed, 27 Oct 2021 12:56:41 GMT, Larry-N wrote: >> This fix adds a cache of service provider classes to LoginContext (in >> particular, it's a cache of LoginModules classes). The approach helps to >> increase the performance of the LoginContext.login() method significantly, >> especially in a

Re: RFR: 8273026: Slow LoginContext.login() on multi threading application [v2]

2021-10-27 Thread Larry-N
> This fix adds a cache of service provider classes to LoginContext (in > particular, it's a cache of LoginModules classes). The approach helps to > increase the performance of the LoginContext.login() method significantly, > especially in a multi-threading environment. Service Loader is used fo