RFR: 8255409: Support the new APIs in PKCS#11 v3.0

Valerie Peng valeriep at openjdk.java.net
Tue Dec 7 04:14:15 UTC 2021


On Mon, 6 Dec 2021 18:50:08 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:

> Should the NSS supporting 3.0 get added to the changeset for testing?

Recall there was a bug filed for updating the artifactory NSS version. There was some window build issue, will follow up with the SQE RE again.

> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java line 406:
> 
>> 404:         token.ensureValid();
>> 405:         if (token.p11.getVersion().major == 3) {
>> 406:             long flags = (encrypt? CKF_ENCRYPT : CKF_DECRYPT);
> 
> I think this is a syntax nit with no space between "encrypt" and '?'

Ok.

> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java line 449:
> 
>> 447:         token.ensureValid();
>> 448:         if (token.p11.getVersion().major == 3) {
>> 449:             long flags = (encrypt? CKF_ENCRYPT : CKF_DECRYPT);
> 
> I think this is a syntax nit with no space between "encrypt" and '?'

Ok.

> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyWrapCipher.java line 291:
> 
>> 289: 
>> 290:         if (token.p11.getVersion().major == 3) {
>> 291:             long flags = (opmode == Cipher.ENCRYPT_MODE? CKF_ENCRYPT :
> 
> I think this is a syntax nit with no space between MODE and '?'

Ok.

> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java line 285:
> 
>> 283: 
>> 284:         if (token.p11.getVersion().major == 3) {
>> 285:             long flags = (mode == M_SIGN? CKF_SIGN : CKF_VERIFY);
> 
> M_SIGN ? ...

Ok. BTW, is there a central place for these syntax? I usually just pick up the convention used in the same file.

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

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


More information about the security-dev mailing list