[jdk11u-dev] Integrated: 8242151: Improve OID mapping and reuse among JDK security providers for aliases registration

Goetz Lindenmaier goetz at openjdk.org
Wed Jun 14 08:58:05 UTC 2023


On Mon, 29 May 2023 10:34:44 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:

> This change required some work to get it backported. 
> I touched the following files to resolve or get the code/test working:
> 
> src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java
> 
> These entries are not in 11:
>         List<String> macSHA512_224Aliases = createAliasesWithOid(macOidBase + "12");
>         List<String> macSHA512_256Aliases = createAliasesWithOid(macOidBase + "13");
> 
>         String nistHashAlgsOidBase = "2.16.840.1.101.3.4.2.";
>         List<String> macSHA3_224Aliases =
>             createAliasesWithOid(nistHashAlgsOidBase + "13");
>         List<String> macSHA3_256Aliases =
>             createAliasesWithOid(nistHashAlgsOidBase + "14");
>         List<String> macSHA3_384Aliases =
>             createAliasesWithOid(nistHashAlgsOidBase + "15");
>         List<String> macSHA3_512Aliases =
>             createAliasesWithOid(nistHashAlgsOidBase + "16");
> 
> Thus I could not remove them.
> Also, the Hmac keys differ. Some are not in 11.
> 
> src/java.base/share/classes/java/security/cert/CertificateRevokedException.java
> Copyright.
> 
> src/java.base/share/classes/sun/security/pkcs/PKCS7.java
> src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java
> Already applied in "8268801: Improve PKCS attribute handling"
> 
> src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
> Resolve imports due to context.
> 
> src/java.base/share/classes/sun/security/provider/KeyProtector.java
> Copyright
> 
> src/java.base/share/classes/sun/security/ssl/SunJSSE.java
> Resolved due to context.
> 
> src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java
> Copyright.
> 
> src/java.base/share/classes/sun/security/tools/keytool/Main.java
> Basically applied by hand.
> 
> src/java.base/share/classes/sun/security/util/ConstraintsParameters.java
> This file was turned into an interface by "8249906: Enhance opening JARs" which
> moved the implementation to CertPathConstraintsParameters.java and DisabledAlgorithmConstraints.
> 8249906 was applied later than this change, but is already in 11.
> 
> The method getNamedCurveFromKey(Key key) was moved to DisabledAlgorithmConstraints, I
> applied the hunk there similar as in 17.
> 
> src/java.base/share/classes/sun/security/util/CurveDB.java
> I had to resolve because "8226307: Curve names should be case-insensitive" is not in 11.
> 
> src/java.base/share/classes/sun/security/util/KnownOIDs.java,
> Already in 11, a small difference in line 428 which seem fine to me.
> 
> src/java.base/share/classes/sun/security/util/ObjectIdentifier.java
> Most parts already backported by "8268801...

This pull request has now been integrated.

Changeset: 3bc72d04
Author:    Goetz Lindenmaier <goetz at openjdk.org>
URL:       https://git.openjdk.org/jdk11u-dev/commit/3bc72d04cb0eb8e2d55db2e7623ea1cc57517e69
Stats:     2070 lines in 76 files changed: 307 ins; 778 del; 985 mod

8242151: Improve OID mapping and reuse among JDK security providers for aliases registration

Use sun.security.util.KnownOIDs enum instead of hardcoding oid strings everywhere

Reviewed-by: mbaesken, mbalao
Backport-of: 080b3b83ebffe5149fbc9ac48e921fb51e9c3c63

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

PR: https://git.openjdk.org/jdk11u-dev/pull/1908


More information about the jdk-updates-dev mailing list