mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8314045: ArithmeticException in GaloisCounterMode
Co-authored-by: Ioana Nedelcu <ioannanedelcu@google.com> Reviewed-by: ascarpino
This commit is contained in:
parent
911d1dbbf7
commit
f41c267f85
2 changed files with 65 additions and 0 deletions
|
@ -1572,6 +1572,13 @@ abstract class GaloisCounterMode extends CipherSpi {
|
|||
len += buffer.remaining();
|
||||
}
|
||||
|
||||
// Check that input data is long enough to fit the expected tag.
|
||||
if (len < 0) {
|
||||
throw new AEADBadTagException("Input data too short to " +
|
||||
"contain an expected tag length of " + tagLenBytes +
|
||||
"bytes");
|
||||
}
|
||||
|
||||
checkDataLength(len);
|
||||
|
||||
// Verify dst is large enough
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue