Skip to content

Commit b98e43e

Browse files
committed
Fix wrong length on test message
1 parent 18c9684 commit b98e43e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

wolfcrypt/test/test.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43735,9 +43735,10 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ecc_test_buffers(void)
4373543735
wc_test_ret_t ret;
4373643736
word32 idx = 0;
4373743737
#ifndef WC_NO_RNG
43738-
/* pad our test message to 32 bytes so evenly divisible by AES_BLOCK_SZ */
43739-
byte in[] = "Everyone gets Friday off. ecc p";
43740-
word32 inLen = (word32)XSTRLEN((char*)in);
43738+
/* 32 bytes: evenly divisible by AES_BLOCK_SZ and meets WC_MIN_DIGEST_SIZE */
43739+
byte in[] = "Everyone gets Friday off. ecc p";
43740+
const word32 inLen = sizeof(in); /* includes null terminator */
43741+
wc_static_assert2(sizeof(in) == 32, "in[] must be exactly 32 bytes");
4374143742
byte out[256];
4374243743
byte plain[256];
4374343744
WOLFSSL_ENTER("ecc_test_buffers");
@@ -43807,7 +43808,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ecc_test_buffers(void)
4380743808

4380843809
#if defined(HAVE_ECC_ENCRYPT) && defined(HAVE_HKDF) && \
4380943810
defined(HAVE_AES_CBC) && defined(WOLFSSL_AES_128)
43810-
ret = ecc_buffers_encrypt_test(cliKey, servKey, tmpKey, in, sizeof(in), out,
43811+
ret = ecc_buffers_encrypt_test(cliKey, servKey, tmpKey, in, inLen, out,
4381143812
plain, inLen);
4381243813
if (ret != 0)
4381343814
goto done;

0 commit comments

Comments
 (0)