[jdk11u-dev] RFR: 8255410: Add ChaCha20 and Poly1305 support to SunPKCS11 provider [v3]
Goetz Lindenmaier
goetz at openjdk.java.net
Fri Feb 11 07:15:07 UTC 2022
> I backport this for parity with 11.0.15-oracle.
>
> I had to do a row of adaptions. There are some implementation
> differences, and many Java 17 usages that had to be changed.
>
> In the original change in SunPKCS11.java, dA() is used
> to give alias names of algorithms. It calls to
> SecurityProviderConstants.getAliases().
> In SunPKCS11.java of jdk11 neither dA() nore getAliases()
> are available. It uses d() instead of da() and calls a
> s() with a list of literal strings to give the alias names.
> SecurityProviderConstants.java is in java.base. The jdk11
> version does not contain the list of aliases that can be
> found in 17.
>
> I looked up whether there are aliases listed for
> "ChaCha20-Poly1305" in 17, but found none, so I added
> an empty call s() in SunPKCS11.java.
>
> In P11AEADCipher.java I had to modify the syntax of
> a switch statement.
>
> In CK_SALSA20_CHACHA20_POLY1305_PARAMS.java
> I had to replace HexFormat.of().formatHex(...)
> which is a java.util class not in 11.
>
> The tests use HexFormat heavily.
> I replaced it by HexToBytes() from TestKATForGCM and
> by toHexString() from TestLeadingZeroesP11.java.
> To make these methods available I moved them to the
> superclass PKCS11Test.java.
> This way they can be used for potential later backports, too.
> I also had to adapt a switch statement using '->' to syntax
> know to 11.
Goetz Lindenmaier has updated the pull request incrementally with two additional commits since the last revision:
- One more tiny detail
- These changes sneaked in from anonther backport
-------------
Changes:
- all: https://git.openjdk.java.net/jdk11u-dev/pull/805/files
- new: https://git.openjdk.java.net/jdk11u-dev/pull/805/files/e5dea49a..7a7ba53d
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk11u-dev&pr=805&range=02
- incr: https://webrevs.openjdk.java.net/?repo=jdk11u-dev&pr=805&range=01-02
Stats: 6 lines in 1 file changed: 0 ins; 3 del; 3 mod
Patch: https://git.openjdk.java.net/jdk11u-dev/pull/805.diff
Fetch: git fetch https://git.openjdk.java.net/jdk11u-dev pull/805/head:pull/805
PR: https://git.openjdk.java.net/jdk11u-dev/pull/805
More information about the jdk-updates-dev
mailing list