RFR: 8277224: sun.security.pkcs.PKCS9Attributes.toString() throws NPE

Weijun Wang weijun at openjdk.java.net
Wed Nov 17 16:55:36 UTC 2021


On Wed, 17 Nov 2021 16:00:04 GMT, Sean Coffey <coffeys at openjdk.org> wrote:

> Some elements of the PKCS9Attribute.PKCS9_OIDS array may have null value. The PKCS9Attributes.toString() and PKCS9Attributes.getAttributes() methods need to account for that.

test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java line 67:

> 65:         // test PKCS9Attributes.toString(), PKCS9Attributes.getAttributes()
> 66:         System.out.println(authed);
> 67:         authed.getAttributes();

Looks like the old `getAttributes()` would only throw NPE if one of the attribute is of a type after `PKCS9_OIDS[10]`.

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

PR: https://git.openjdk.java.net/jdk/pull/6433



More information about the security-dev mailing list