On Tue, 30 Mar 2021 22:12:16 GMT, Valerie Peng <[email protected]> wrote:
>> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java
>> line 819:
>>
>>> 817: int startOff = 0;
>>> 818: if (reqBlockUpdates) {
>>> 819: startOff = bytesBuffered;
>>
>> Shouldn't the starting offset be the number of bytes in padBuffer, i.e.
>> padBufferLen?
>
> Then no need for the assert(...) to check the starting offset value.
padBufferLen and bytesBuffered look a bit confusing to me. My suspicion is that
they have the same value every time we need them. I'll make the change you
suggested and check that we have no regressions. If you believe the assertions
are trivial, I'll remove them.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2510