Integrated: 8296736: Some PKCS9Attribute can be created but cannot be encoded

Weijun Wang weijun at openjdk.org
Tue Nov 15 15:36:21 UTC 2022


On Wed, 9 Nov 2022 21:54:49 GMT, Weijun Wang <weijun at openjdk.org> 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 `SigningCertificateInfo` class so we can encode it.
> 
> After this change, unsupported `PKCSAttribute` object simply cannot be created. The `new(DerValue)` constructor rejects them (type 9-13, 15) in a `switch` block, and the `new(ObjectIdentifier, Object)` constructor rejects them because `VALUE_CLASSES` for them are null.
> 
> In the `encode()` method, we now throw `IllegalArgumentException` for these types and they will not happen.

This pull request has now been integrated.

Changeset: d3051a75
Author:    Weijun Wang <weijun at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/d3051a75a37db5c8582c3040a220d15f4c29a851
Stats:     82 lines in 3 files changed: 35 ins; 4 del; 43 mod

8296736: Some PKCS9Attribute can be created but cannot be encoded

Reviewed-by: xuelei, valeriep

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

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


More information about the security-dev mailing list