RFR: JDK-6676643: Improve current C_GetAttributeValue native implementation [v3]
Xue-Lei Andrew Fan
xuelei at openjdk.java.net
Fri May 14 00:17:37 UTC 2021
On Thu, 13 May 2021 23:53:18 GMT, Valerie Peng <valeriep at openjdk.org> wrote:
>> Anyone can help review this somewhat trivial fix? The main change is inside src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_objmgmt.c. This is to help better troubleshooting by reporting the type of unavailable attributes in PKCS11 exception message when C_GetAttributeValue(...) call failed. The java file changes are just cleanup for consolidating the CKR_* constants definition into PKCS11Exception class.
>>
>> Thanks,
>> Valerie
>
> Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:
>
> PKCS11Exception class refactoring - use enum instead of HashMap
src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java line 212:
> 210: long value() {
> 211: return value;
> 212: }
I guess it is safe to use the 'value' variable directly for enum. The value() method may be not necessary. Just a personal preference, ignore it if you like the current way.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3709
More information about the security-dev
mailing list