Re: RFR: 8277224: sun.security.pkcs.PKCS9Attributes.toString() throws NPE [v2]

2021-11-17 Thread Sean Coffey
> Some elements of the PKCS9Attribute.PKCS9_OIDS array may have null value. The 
> PKCS9Attributes.toString() and PKCS9Attributes.getAttributes() methods need 
> to account for that.

Sean Coffey has updated the pull request incrementally with one additional 
commit since the last revision:

  test update

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6433/files
  - new: https://git.openjdk.java.net/jdk/pull/6433/files/9755fa81..a134fab5

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6433&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6433&range=00-01

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6433.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6433/head:pull/6433

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


Re: RFR: 8277224: sun.security.pkcs.PKCS9Attributes.toString() throws NPE [v2]

2021-11-17 Thread Weijun Wang
On Wed, 17 Nov 2021 17:16:38 GMT, Sean Coffey  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.
>
> Sean Coffey has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   test update

Marked as reviewed by weijun (Reviewer).

-

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


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

2021-11-17 Thread Sean Coffey
On Wed, 17 Nov 2021 16:52:46 GMT, Weijun Wang  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]`.

Yes - its also bounded by the "attribs.length" check. I initially thought I'd 
have to build an PKCS9Attributes Object consisting of 10/11+ PKCS9Attribute 
Objects. That didn't seem feasible since many are not supported. 

but on re-read, yes, all I need to do is stick in an OID > PKCS9_OIDS[10] - 
I'll update the testcase.

-

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


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

2021-11-17 Thread Weijun Wang
On Wed, 17 Nov 2021 16:00:04 GMT, Sean Coffey  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


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

2021-11-17 Thread Sean Coffey
Some elements of the PKCS9Attribute.PKCS9_OIDS array may have null value. The 
PKCS9Attributes.toString() and PKCS9Attributes.getAttributes() methods need to 
account for that.

-

Commit messages:
 - 8277224: sun.security.pkcs.PKCS9Attributes.toString() throws NPE

Changes: https://git.openjdk.java.net/jdk/pull/6433/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6433&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8277224
  Stats: 15 lines in 2 files changed: 10 ins; 2 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6433.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6433/head:pull/6433

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