On Thu, 8 Oct 2020 15:32:46 GMT, Anthony Scarpino <ascarp...@openjdk.org> wrote:

>> src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java line 
>> 1253:
>> 
>>> 1251:         if (decrypting) {
>>> 1252:             if (buffered > 0) {
>>> 1253:                 cipher.decrypt(buffer, 0, buffered, new byte[0], 0);
>> 
>> This looks a bit strange? The output buffer is 0-length which would lead to 
>> ShortBufferException when the buffered bytes is enough to produce some 
>> output.
>
> This is right.  decrypt() puts the data into GaloisCounterMode.ibuffer and 
> never uses the output

Hmm, right, I forgot that GCM cipher has that internal buffering.

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

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

Reply via email to