RFR: 8293197: Avoid double racy reads from non-volatile fields in SharedSecrets

2022-08-31 Thread Andrey Turbanov
After integration of [JDK-8259021](https://bugs.openjdk.org/browse/JDK-8259021) a few more fields were added to `SharedSecrets` class. It make sense to update their reading code to use the same idiom. - Commit messages: - [PATCH] SharedSecrets should avoid double racy reads from no

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v4]

2022-08-31 Thread Weijun Wang
On Thu, 1 Sep 2022 02:26:48 GMT, Mark Powers wrote: >> https://bugs.openjdk.org/browse/JDK-8291509 > > Mark Powers has updated the pull request incrementally with one additional > commit since the last revision: > > comments from Sean and Max More comments. Haven't read `ssl`, `util`, and `x

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v4]

2022-08-31 Thread Weijun Wang
On Thu, 1 Sep 2022 02:26:48 GMT, Mark Powers wrote: >> https://bugs.openjdk.org/browse/JDK-8291509 > > Mark Powers has updated the pull request incrementally with one additional > commit since the last revision: > > comments from Sean and Max This includes all in `sun.security.provider.certp

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v4]

2022-08-31 Thread Weijun Wang
On Wed, 31 Aug 2022 04:22:15 GMT, Mark Powers wrote: >> src/java.base/share/classes/sun/security/pkcs12/MacData.java line 47: >> >>> 45: >>> 46: private String digestAlgorithmName; >>> 47: private AlgorithmParameters digestAlgorithmParams; >> >> Yes, this field is not used now. But one

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Weijun Wang
On Tue, 30 Aug 2022 22:53:31 GMT, Mark Powers wrote: >> http://cr.openjdk.java.net/~alundblad/styleguide/index-v6.html#toc-constants > > Can't argue with that. Normally we use `SHA2_GROUP`. There are underscores between the words. - PR: https://git.openjdk.org/jdk/pull/9972

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v4]

2022-08-31 Thread Mark Powers
> https://bugs.openjdk.org/browse/JDK-8291509 Mark Powers has updated the pull request incrementally with one additional commit since the last revision: comments from Sean and Max - Changes: - all: https://git.openjdk.org/jdk/pull/9972/files - new: https://git.openjdk.org/jdk

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Mark Powers
On Wed, 31 Aug 2022 22:55:09 GMT, Mark Powers wrote: >> The tests that we have all pass. I think I'll intentionally break `equals` >> and see if the tests still pass. From my experience with PKCS#11, there is >> no reason to check that attribute arrays are equal. > > I broke `equals` to always

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Mark Powers
On Wed, 31 Aug 2022 22:43:58 GMT, Mark Powers wrote: >> In fact, I am not sure if this method works now. `PKCS10Attribute` has not >> overridden `equals`. Is this method ever used? I see it used in `PKCS10` but >> the encoding is used for comparison there. And, who would want to compare >> `PK

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Mark Powers
On Wed, 31 Aug 2022 22:30:57 GMT, Weijun Wang wrote: >> Ah, I see. The key for an attr might not be the id. > > In fact, I am not sure if this method works now. `PKCS10Attribute` has not > overridden `equals`. Is this method ever used? I see it used in `PKCS10` but > the encoding is used for co

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Weijun Wang
On Wed, 31 Aug 2022 22:25:57 GMT, Weijun Wang wrote: >> Don't know what you mean about changing `toString`. I could change `equals` >> to something like: >> >> >> public boolean equals(Object other) { >> if (!(other instanceof PKCS10Attributes)) >> return false; >> >>

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Weijun Wang
On Wed, 31 Aug 2022 22:29:59 GMT, Weijun Wang wrote: >> Sorry, I meant `equals`. Why cannot we just compare with `other.map`? > > Ah, I see. The key for an attr might not be the id. In fact, I am not sure if this method works now. `PKCS10Attribute` has not overridden `equals`. - P

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Weijun Wang
On Wed, 31 Aug 2022 22:23:42 GMT, Mark Powers wrote: >> src/java.base/share/classes/sun/security/pkcs10/PKCS10Attributes.java line >> 184: >> >>> 182: return false; >>> 183: PKCS10Attribute thisAttr, otherAttr; >>> 184: String key; >> >> This whole `toString` method

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Mark Powers
On Tue, 30 Aug 2022 20:23:26 GMT, Weijun Wang wrote: >> Mark Powers has updated the pull request incrementally with one additional >> commit since the last revision: >> >> white space > > src/java.base/share/classes/sun/security/pkcs10/PKCS10Attributes.java line > 184: > >> 182:

Integrated: 8292681: Add JMH for ProtectionDomain

2022-08-31 Thread Eric Caspole
On Fri, 19 Aug 2022 18:48:10 GMT, Eric Caspole wrote: > Add a JMH for ProtectionDomain related to current work on JDK-8292375. Also, > add the InMemoryJavaCompiler to the JMH jar, to generate the classes needed > for this test and will be useful for future class loading JMH too. This pull requ

Re: RFR: 8292681: Add JMH for ProtectionDomain [v3]

2022-08-31 Thread Sean Mullan
On Mon, 29 Aug 2022 13:56:28 GMT, Eric Caspole wrote: >> Add a JMH for ProtectionDomain related to current work on JDK-8292375. Also, >> add the InMemoryJavaCompiler to the JMH jar, to generate the classes needed >> for this test and will be useful for future class loading JMH too. > > Eric Cas

Re: RFR: JDK-8291509 Minor cleanup could be done in sun.security [v3]

2022-08-31 Thread Weijun Wang
On Wed, 31 Aug 2022 04:22:46 GMT, Mark Powers wrote: >> src/java.base/share/classes/sun/security/provider/PolicyParser.java line 576: >> >>> 574: } >>> 575: >>> 576: return (ignoreEntry == true) ? null : e; >> >> Remove definition of `ignoreEntry`. > > I don't see how that can