Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v4]

2022-11-15 Thread Weijun Wang
> One `PKCS9Attribute` can be created but cannot be encoded. Since the > `SigningCertificateInfo::parse` method has not fully parsed the data > (`PolicyInformation` is left out), this code change add the encoding itself > as a field to the `SigningCertificateInfo` class so we can encode it. > >

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v2]

2022-11-15 Thread Weijun Wang
On Tue, 15 Nov 2022 00:49:23 GMT, Valerie Peng wrote: >> You mean comparing it with the original value? I tried that but not always >> the same. For example, a string might be an IA5String at the beginning but >> becomes a UTF8String after re-encoding. > > I see, not surprising, perhaps just ch

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v2]

2022-11-14 Thread Valerie Peng
On Mon, 14 Nov 2022 21:44:14 GMT, Weijun Wang wrote: >> test/jdk/sun/security/pkcs/pkcs9/PKCS9AttrTypeTests.java line 176: >> >>> 174: // Encoding is supported >>> 175: DerOutputStream dos = new DerOutputStream(); >>> 176: p9Attr.encode(dos); >> >

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v3]

2022-11-14 Thread Valerie Peng
On Mon, 14 Nov 2022 22:19:32 GMT, Weijun Wang wrote: >> One `PKCS9Attribute` can be created but cannot be encoded. Since the >> `SigningCertificateInfo::parse` method has not fully parsed the data >> (`PolicyInformation` is left out), this code change add the encoding itself >> as a field to t

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v3]

2022-11-14 Thread Weijun Wang
> One `PKCS9Attribute` can be created but cannot be encoded. Since the > `SigningCertificateInfo::parse` method has not fully parsed the data > (`PolicyInformation` is left out), this code change add the encoding itself > as a field to the `SigningCertificateInfo` class so we can encode it. > >

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v2]

2022-11-14 Thread Valerie Peng
On Thu, 10 Nov 2022 02:43:21 GMT, Weijun Wang wrote: >> One `PKCS9Attribute` can be created but cannot be encoded. Since the >> `SigningCertificateInfo::parse` method has not fully parsed the data >> (`PolicyInformation` is left out), this code change add the encoding itself >> as a field to t

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v2]

2022-11-14 Thread Weijun Wang
On Mon, 14 Nov 2022 21:47:38 GMT, Valerie Peng wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> make class package private > > src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java line 381: > >> 379:

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v2]

2022-11-14 Thread Valerie Peng
On Thu, 10 Nov 2022 02:43:21 GMT, Weijun Wang wrote: >> One `PKCS9Attribute` can be created but cannot be encoded. Since the >> `SigningCertificateInfo::parse` method has not fully parsed the data >> (`PolicyInformation` is left out), this code change add the encoding itself >> as a field to t

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v2]

2022-11-10 Thread Mark Powers
On Thu, 10 Nov 2022 02:43:21 GMT, Weijun Wang wrote: >> One `PKCS9Attribute` can be created but cannot be encoded. Since the >> `SigningCertificateInfo::parse` method has not fully parsed the data >> (`PolicyInformation` is left out), this code change add the encoding itself >> as a field to t

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v2]

2022-11-09 Thread Xue-Lei Andrew Fan
On Thu, 10 Nov 2022 02:43:21 GMT, Weijun Wang wrote: >> One `PKCS9Attribute` can be created but cannot be encoded. Since the >> `SigningCertificateInfo::parse` method has not fully parsed the data >> (`PolicyInformation` is left out), this code change add the encoding itself >> as a field to t

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded

2022-11-09 Thread Weijun Wang
On Thu, 10 Nov 2022 02:18:35 GMT, Xue-Lei Andrew Fan wrote: >> The whole class is only used in the same package at the moment. Making only >> one method package private is not fair. > > Hm, maybe making this class package private as well? The returned array is > not cloned. It may not worthy

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded

2022-11-09 Thread Weijun Wang
On Wed, 9 Nov 2022 21:54:49 GMT, Weijun Wang wrote: > One `PKCS9Attribute` can be created but cannot be encoded. Since the > `SigningCertificateInfo::parse` method has not fully parsed the data > (`PolicyInformation` is left out), this code change add the encoding itself > as a field to the `S

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded [v2]

2022-11-09 Thread Weijun Wang
> One `PKCS9Attribute` can be created but cannot be encoded. Since the > `SigningCertificateInfo::parse` method has not fully parsed the data > (`PolicyInformation` is left out), this code change add the encoding itself > as a field to the `SigningCertificateInfo` class so we can encode it. > >

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded

2022-11-09 Thread Xue-Lei Andrew Fan
On Thu, 10 Nov 2022 02:08:54 GMT, Weijun Wang wrote: >> src/java.base/share/classes/sun/security/pkcs/SigningCertificateInfo.java >> line 92: >> >>> 90: } >>> 91: >>> 92: public byte[] toByteArray() { >> >> Is it possible to have the method package private? > > The whole class is only

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded

2022-11-09 Thread Weijun Wang
On Thu, 10 Nov 2022 02:01:32 GMT, Xue-Lei Andrew Fan wrote: > Is it a real problem reported in productive environment? No. I am just cleaning up the code to make encoding and decoding symmetric and consistent. You can see I'm working on several PRs at the same time. - PR: https://

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded

2022-11-09 Thread Weijun Wang
On Thu, 10 Nov 2022 01:56:29 GMT, Xue-Lei Andrew Fan wrote: >> One `PKCS9Attribute` can be created but cannot be encoded. Since the >> `SigningCertificateInfo::parse` method has not fully parsed the data >> (`PolicyInformation` is left out), this code change add the encoding itself >> as a fie

Re: RFR: 8296736: Some PKCS9Attribute can be created but cannot be encoded

2022-11-09 Thread Xue-Lei Andrew Fan
On Wed, 9 Nov 2022 21:54:49 GMT, Weijun Wang wrote: > One `PKCS9Attribute` can be created but cannot be encoded. Since the > `SigningCertificateInfo::parse` method has not fully parsed the data > (`PolicyInformation` is left out), this code change add the encoding itself > as a field to the `S