Re: RFR: 8296742: Illegal X509 Extension should not be created [v10]

2022-11-22 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Sean Mullan
On Tue, 22 Nov 2022 20:43:37 GMT, Weijun Wang wrote: >> src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java >> line 76: >> >>> 74: */ >>> 75: public SubjectKeyIdentifierExtension(byte[] octetString) >>> 76: throws IOException { >> >> Do you wan

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Sean Mullan
On Tue, 22 Nov 2022 20:24:23 GMT, Weijun Wang wrote: >> Do you want to add similar checks to the `GeneralSubtree` and >> `GeneralSubtrees` ctors? > > I'll add a check in `GeneralSubtree` to reject a null name. `GeneralSubtrees` > is complicated. The intersect and reduce methods make it mutable,

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Sean Mullan
On Tue, 22 Nov 2022 21:02:14 GMT, Weijun Wang wrote: > Oh, when parsing a `SubjectAlternativeNameExtension` or an > `IssuerAlternativeNameExtension`, an empty `GeneralNames` is returned when > the content is empty. I would like to study more about it in another bug. Ok. - PR: htt

Re: RFR: 8296742: Illegal X509 Extension should not be created [v9]

2022-11-22 Thread Sean Mullan
On Tue, 22 Nov 2022 21:43:42 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v9]

2022-11-22 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Weijun Wang
On Tue, 22 Nov 2022 17:42:06 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Weijun Wang
On Tue, 22 Nov 2022 17:42:06 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Weijun Wang
On Tue, 22 Nov 2022 20:09:02 GMT, Sean Mullan wrote: > A general comment is that since we are adding checks for illegal values to > the `*Extension` classes, we should probably go one step further and do the > same for all the classes in `sun.security.x509` package. I'm ok if you want > to han

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Weijun Wang
On Tue, 22 Nov 2022 19:56:42 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> IssuerAlternativeNameExtension names > > src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Weijun Wang
On Tue, 22 Nov 2022 19:53:44 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> IssuerAlternativeNameExtension names > > src/java.base/share/classes/sun/security/x509/SubjectAlternativeNameExtension.ja

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Weijun Wang
On Tue, 22 Nov 2022 19:49:33 GMT, Sean Mullan wrote: >> src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java >> line 142: >> >>> 140: if (permitted == null && excluded == null) { >>> 141: throw new IllegalArgumentException( >>> 142:

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Weijun Wang
On Tue, 22 Nov 2022 19:34:24 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> IssuerAlternativeNameExtension names > > src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Sean Mullan
On Tue, 22 Nov 2022 17:42:06 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Sean Mullan
On Tue, 22 Nov 2022 19:46:56 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> IssuerAlternativeNameExtension names > > src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java > l

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Sean Mullan
On Tue, 22 Nov 2022 17:42:06 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Mark Powers
On Tue, 22 Nov 2022 17:36:30 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v8]

2022-11-22 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created [v7]

2022-11-22 Thread Mark Powers
On Tue, 22 Nov 2022 16:44:56 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v7]

2022-11-22 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created [v6]

2022-11-22 Thread Weijun Wang
On Tue, 22 Nov 2022 16:22:44 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add test >> >> only in patch2: >> unchanged: > > src/java.base/share/classes/sun/security/x509/CRLReasonCodeExtens

Re: RFR: 8296742: Illegal X509 Extension should not be created [v6]

2022-11-22 Thread Sean Mullan
On Thu, 17 Nov 2022 23:52:02 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v6]

2022-11-17 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created [v4]

2022-11-17 Thread Weijun Wang
On Thu, 17 Nov 2022 15:57:40 GMT, Weijun Wang wrote: >> Inside JDK we support a lot of X.509 certificate extensions. Almost every >> extension has a rule about what is legal or not. For example, the names in >> `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a >> rule is

Re: RFR: 8296742: Illegal X509 Extension should not be created [v5]

2022-11-17 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created [v4]

2022-11-17 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created [v3]

2022-11-15 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created [v2]

2022-11-14 Thread Weijun Wang
> Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enforced in the `encode()` method, where the extension val

Re: RFR: 8296742: Illegal X509 Extension should not be created

2022-11-14 Thread Mark Powers
On Mon, 14 Nov 2022 16:47:22 GMT, Weijun Wang wrote: > Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enf

Re: RFR: 8296742: Illegal X509 Extension should not be created

2022-11-14 Thread Weijun Wang
On Mon, 14 Nov 2022 16:47:22 GMT, Weijun Wang wrote: > Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enf

Re: RFR: 8296742: Illegal X509 Extension should not be created

2022-11-14 Thread Weijun Wang
On Mon, 14 Nov 2022 16:47:22 GMT, Weijun Wang wrote: > Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enf

RFR: 8296742: Illegal X509 Extension should not be created

2022-11-14 Thread Weijun Wang
Inside JDK we support a lot of X.509 certificate extensions. Almost every extension has a rule about what is legal or not. For example, the names in `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule is enforced in the `encode()` method, where the extension value is as

Re: RFR: 8296742: Illegal X509 Extension should not be created

2022-11-14 Thread Weijun Wang
On Mon, 14 Nov 2022 16:47:22 GMT, Weijun Wang wrote: > Inside JDK we support a lot of X.509 certificate extensions. Almost every > extension has a rule about what is legal or not. For example, the names in > `SubjectAlternativeNameExtension` cannot be missing or empty. Usually, a rule > is enf