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

Valerie Peng valeriep at openjdk.org
Tue Nov 15 00:56:04 UTC 2022


On Mon, 14 Nov 2022 21:44:14 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> test/jdk/sun/security/pkcs/pkcs9/PKCS9AttrTypeTests.java line 176:
>> 
>>> 174:                 // Encoding is supported
>>> 175:                 DerOutputStream dos = new DerOutputStream();
>>> 176:                 p9Attr.encode(dos);
>> 
>> Should we check the encoding has the expected value? Otherwise, it looks like we only require that no exception is thrown?
>
> 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 checking that it's not empty? Or even that may not hold true?

-------------

PR: https://git.openjdk.org/jdk/pull/11070



More information about the security-dev mailing list