RFR: 8255409: Support the new APIs in PKCS#11 v3.0
Weijun Wang
weijun at openjdk.java.net
Tue Dec 7 01:49:10 UTC 2021
On Tue, 7 Dec 2021 00:08:03 GMT, Valerie Peng <valeriep at openjdk.org> wrote:
>> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java line 405:
>>
>>> 403: private void cancelOperation() {
>>> 404: // cancel operation by finishing it; avoid killSession as some
>>> 405: // hardware vendors may require re-login
>>
>> The new `cancelOperation()` methods seems identical everywhere. Is it possible to consolidate it to a helper method like `trySessionCancel(token, session, flags)`? It can return true if canceled successfully, false if needs a fallback, and can still throw a `ProviderException`.
>
> I assume you mean the if-() block of code? I can move the code into a helper method inside the P11Util class.
Yes, just keep duplicated lines as few as possible.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6655
More information about the security-dev
mailing list