From 57c6e688fa05a08527774c040637690ca805300f Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 17 Dec 2024 03:54:55 +0000 Subject: [PATCH] Fix data buffer size in GCMTest.ABI This test used a data buffer of size 16*32, but calls the assembly functions with lengths of up to 16*32+7. This was okay for aesni_gcm_{en,de}crypt which round the length down to a multiple of 16. But aes_gcm_{enc,dec}_update_vaes_avx10_{256,512} process the full length, which caused a buffer overrun. Fix this. Change-Id: Ib3651a38baff35cfd9624d24747a4e53cefe6cff Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/74507 Reviewed-by: David Benjamin Commit-Queue: David Benjamin --- crypto/fipsmodule/modes/gcm_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/fipsmodule/modes/gcm_test.cc b/crypto/fipsmodule/modes/gcm_test.cc index ebcfcbeaf..fafde9c7f 100644 --- a/crypto/fipsmodule/modes/gcm_test.cc +++ b/crypto/fipsmodule/modes/gcm_test.cc @@ -29,7 +29,7 @@ TEST(GCMTest, ABI) { UINT64_C(0x884cfa59ca342b2e), }; static const size_t kBlockCounts[] = {1, 2, 3, 4, 5, 6, 7, 8, 15, 16, 31, 32}; - uint8_t buf[16 * 32]; + uint8_t buf[16 * 32 + 7]; OPENSSL_memset(buf, 42, sizeof(buf)); uint8_t X[16] = {0x92, 0xa3, 0xb3, 0x60, 0xce, 0xda, 0x88, 0x03,