JEP Review Request: TLS Certificate Compression

2022-02-15 Thread Xuelei Fan
Hi all, The JDK Enhancement Proposal, TLS Certificate Compression, has been opened for community review. Detailed, please refer to the draft: https://bugs.openjdk.java.net/browse/JDK-8281710 Feel free to make comments and send your feedback to the alias. I may submit this JEP in the begin

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v6]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 20:09:27 GMT, Michael Osipov wrote: > > New commit pushed. For the openssl style suggestion, I think its major > > benefit is to provide a string format of the type (like `"othername: > > UPN:"`). In the `default` block, it still extracts either the IA5String or > > the UTF

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v6]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 20:00:24 GMT, Weijun Wang wrote: > New commit pushed. For the openssl style suggestion, I think its major > benefit is to provide a string format of the type (like `"othername: UPN:"`). > In the `default` block, it still extracts either the IA5String or the > UTF8String. I

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v6]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 19:51:57 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v6]

2022-02-15 Thread Weijun Wang
> The enhancement adds two extra items in the `getSubjectAlternativeNames()` > output for an OtherName. > > It also fix several errors: > 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` > without the tag and length bytes. > 2. The argument in constructor `extClass.ge

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 17:15:13 GMT, Michael Osipov wrote: > Oh, can you reference? Sorry, memory is incorrect, those are date time types (in https://www.oss.com/asn1/resources/reference/ASN.1-Reference-Card-format-USA.pdf). But here they do promote a VisibleString that we don't support. ---

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Sean Mullan
On Tue, 15 Feb 2022 15:16:58 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 16:12:17 GMT, Michael Osipov wrote: > I don't expect any new ASN.1 string types to be added in the future, but of > someone decides to create a public ASN.1 I've seen new string types that need 2 bytes tag, but don't know if they are used anywhere. Also, there are existi

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 17:11:31 GMT, Weijun Wang wrote: > > I don't expect any new ASN.1 string types to be added in the future, but of > > someone decides to create a public ASN.1 > > I've seen new string types that need 2 bytes tag, but don't know if they are > used anywhere. Oh, can you refer

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 16:22:17 GMT, Weijun Wang wrote: > So my current opinion is to make it as vague as possible (Ex: `a valid > supported character string`) so people always remember to check `instanceof > String` first. I agree with that, but consider https://github.com/openjdk/jdk/pull/7167

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 15:16:58 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 16:09:13 GMT, Michael Osipov wrote: >> But in this case, we still have a place to provide the raw bytes. Maybe >> that's better? Or you'd rather be guaranteed that one particular otherName >> should always have a string there and there's no need to do an `instanceof` >> che

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 16:04:07 GMT, Weijun Wang wrote: > > > ``` > > > 2. I feel a little uneasy of the new `if` and `otherwise` words inside > > > parentheses, especially the second one which seems out of nowhere. Please > > > suggest better wording if possible. > > > ``` > > > > > > What abou

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:55:50 GMT, Weijun Wang wrote: >> Correct, but they don't swallow at least. > > But in this case, we still have a place to provide the raw bytes. Maybe > that's better? Or you'd rather be guaranteed that one particular otherName > should always have a string there and ther

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 15:59:42 GMT, Michael Osipov wrote: > > ``` > > 2. I feel a little uneasy of the new `if` and `otherwise` words inside > > parentheses, especially the second one which seems out of nowhere. Please > > suggest better wording if possible. > > ``` > > > What about? > > > ``

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:16:58 GMT, Weijun Wang wrote: > New commit pushed with a spec change and CSR is now in draft mode. Something > worth mentioning: > > 1. I explicitly added "valid UTF8String..." to match the `catch > (IOException)` line in the implementation, so if there's anything wr

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:16:58 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 15:46:10 GMT, Michael Osipov wrote: >> I have difficulty describing `!(a && b)`. There is no parentheses in human >> language and `!` has higher order than `&&`. >> >> I thought about completely reverse the block but that means everything after >> the throw will be inside a

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:48:17 GMT, Weijun Wang wrote: >> My wording for the &&: If the tag is not a constructed and context-specific >> tag number 0, then an exception is thrown. The parens denote that both >> conditions need to apply: >> >> !(isCSTag0 && isConst) >> >> true, true = !(true &&

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:40:42 GMT, Weijun Wang wrote: >> src/java.base/share/classes/sun/security/x509/OtherName.java line 93: >> >>> 91: oid = in.getOID(); >>> 92: DerValue derValue1 = in.getDerValue(); >>> 93: if (!derValue1.isContextSpecific((byte)0) || >>> !derValue1.

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 15:28:29 GMT, Michael Osipov wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> string at 4th place > > src/java.base/share/classes/sun/security/x509/OtherName.java line 93: > >> 91: oid =

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 15:50:07 GMT, Michael Osipov wrote: > Are you going to address this separately or document to be implicitly fixed > by this PR? Normally we close the other one as a duplicate. I'll do it now. - PR: https://git.openjdk.java.net/jdk/pull/7167

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:51:22 GMT, Weijun Wang wrote: > > Are you going to address this separately or document to be implicitly fixed > > by this PR? > > Normally we close the other one as a duplicate. I'll do it now. Well, technically it is not a duplicate since both tickets address different

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:16:58 GMT, Weijun Wang wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> specifies the type of the 4th element > > New commit pushed with a spec change and CSR is now in draft mode. Something >

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 15:21:08 GMT, Michael Osipov wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> string at 4th place > > test/jdk/sun/security/x509/OtherName/Parse.java line 89: > >> 87: int found = 0; >> 8

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:16:58 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Michael Osipov
On Tue, 15 Feb 2022 15:16:58 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Weijun Wang
On Fri, 11 Feb 2022 17:13:46 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v5]

2022-02-15 Thread Weijun Wang
> The enhancement adds two extra items in the `getSubjectAlternativeNames()` > output for an OtherName. > > It also fix several errors: > 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` > without the tag and length bytes. > 2. The argument in constructor `extClass.ge

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v2]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 14:36:35 GMT, Weijun Wang wrote: >> Your words are more precise. A reader should check the size first. A new >> commit pushed and the CSR is also updated. > >> @wangweij I would highly recommend to address this ticket first: >> https://bugs.openjdk.java.net/browse/JDK-677668

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Weijun Wang
On Tue, 15 Feb 2022 09:10:22 GMT, Michael Osipov wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> specifies the type of the 4th element > > src/java.base/share/classes/sun/security/x509/OtherName.java line 93: > >>

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v2]

2022-02-15 Thread Weijun Wang
On Thu, 10 Feb 2022 21:09:45 GMT, Weijun Wang wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> wording, title > > Your words are more precise. A reader should check the size first. A new > commit pushed and the CSR

Re: RFR: JDK-8061729 : Update java/net tests to eliminate dependency on sun.net.www.MessageHeader and some other internal APIs [v5]

2022-02-15 Thread Daniel Fuchs
On Fri, 11 Feb 2022 11:15:56 GMT, Mahendra Chhipa wrote: >> There are some regression tests depending on sun.net.www.MessageHeader, the >> internal API dependency should be removed. Some of other internal API >> dependancies are removed in following issues : >> JDK-8273142 >> JDK-8268464 >> JDK

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v2]

2022-02-15 Thread Michael Osipov
On Thu, 10 Feb 2022 21:09:45 GMT, Weijun Wang wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> wording, title > > Your words are more precise. A reader should check the size first. A new > commit pushed and the CSR

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Michael Osipov
On Fri, 11 Feb 2022 17:13:46 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v4]

2022-02-15 Thread Michael Osipov
On Fri, 11 Feb 2022 17:13:46 GMT, Weijun Wang wrote: >> The enhancement adds two extra items in the `getSubjectAlternativeNames()` >> output for an OtherName. >> >> It also fix several errors: >> 1. In `OtherName.java`, `nameValue` should be the value inside `CONTEXT [0]` >> without the tag an

Re: RFR: 8277976: Break up SEQUENCE in X509Certificate::getSubjectAlternativeNames and X509Certificate::getIssuerAlternativeNames in otherName [v2]

2022-02-15 Thread Michael Osipov
On Thu, 10 Feb 2022 21:09:45 GMT, Weijun Wang wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> wording, title > > Your words are more precise. A reader should check the size first. A new > commit pushed and the CSR