RFR: 8265372: Simplify PKCS9Attribute [v2]
Ben Perez
duke at openjdk.org
Wed Jan 3 20:39:57 UTC 2024
> Refactored PKCS9Attribute to use a hash map instead of multiple arrays. The key for the hash map is an `ObjectIdentifier` and the values are a record `AttributeInfo` that stores the information previously contained in the arrays `PKCS9_VALUE_TAGS`, `VALUE_CLASSES`, and `SINGLE_VALUED`.
>
> It seems as though we should be able to get rid of constants such as `EMAIL_ADDRESS_OID` since they aren't heavily used with the hash map approach, but since the values are public it might cause compatibility issues.
>
> Another question is how to handle `RSA DSI`, `S/MIME`, `Extended-certificate`, and `Issuer Serial Number` OIDs. The prior version threw an error but in this refactor they are treated as an "unknown OID" and only throw a debug warning. This was addressed in https://bugs.openjdk.org/browse/JDK-8011867 but prior to this refactor the aforementioned OIDs were treated differently than unknown OIDs.
Ben Perez has updated the pull request incrementally with one additional commit since the last revision:
Minor fixes to make the code more readable, inlined init(), removed PKCS9Attributes.getAttributes()
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17132/files
- new: https://git.openjdk.org/jdk/pull/17132/files/b8c2019f..32a2304c
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17132&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17132&range=00-01
Stats: 114 lines in 2 files changed: 12 ins; 51 del; 51 mod
Patch: https://git.openjdk.org/jdk/pull/17132.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17132/head:pull/17132
PR: https://git.openjdk.org/jdk/pull/17132
More information about the security-dev
mailing list