8261462: GCM ByteBuffer decryption problems

Reviewed-by: valeriep
This commit is contained in:
Anthony Scarpino 2021-03-08 21:28:07 +00:00
parent eb4a8af559
commit 414ee95b8e
4 changed files with 158 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -907,6 +907,7 @@ final class GaloisCounterMode extends FeedbackCipher {
// Decrypt the all the input data and put it into dst
doLastBlock(buffer, ct, dst);
restoreDst(dst);
src.position(src.limit());
// 'processed' from the gctr decryption operation, not ghash
return processed;
}