Skip to content

Commit 9f8d8b9

Browse files
authored
Revert PR 302 (#308)
+ A randomized test failes with this PR. We'll revert till the root cause is found and the gap in testing is added to CI.
1 parent 852f0ef commit 9f8d8b9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/com/amazon/corretto/crypto/provider/AesGcmSpi.java

+16
Original file line numberDiff line numberDiff line change
@@ -993,4 +993,20 @@ private void stateReset() {
993993
hasConsumedData = false;
994994
contextInitialized = false;
995995
}
996+
997+
@Override
998+
protected int engineDoFinal(final ByteBuffer input, final ByteBuffer output)
999+
throws ShortBufferException, IllegalBlockSizeException, BadPaddingException {
1000+
int initialPosition = output.position();
1001+
1002+
engineUpdate(input, output);
1003+
1004+
ShimArray shim = new ShimArray(output, engineGetOutputSize(0));
1005+
int finalBytes = engineDoFinal(EMPTY_ARRAY, 0, 0, shim.array, shim.offset);
1006+
1007+
shim.writeback();
1008+
output.position(output.position() + finalBytes);
1009+
1010+
return output.position() - initialPosition;
1011+
}
9961012
}

0 commit comments

Comments
 (0)