From 735c0f6b3ae4c8e1684770edec65da68237fbd4c Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 20 Sep 2024 17:25:21 -0700 Subject: [PATCH] ECC Test Fix The ECC key generation test was failing due not using large enough of a buffer. Fixed to use a better size. 1. Set the shared digest/sig buffer size in _ecc_pairwise_consistency_test() to the maximum possible based on the math in wc_ecc_sig_sz(). --- wolfcrypt/src/ecc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 5c14b94ef8..ee031a6aa9 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -10229,7 +10229,8 @@ static int _ecc_pairwise_consistency_test(ecc_key* key, WC_RNG* rng) if (!err && (flags & WC_ECC_FLAG_DEC_SIGN)) { #ifndef WOLFSSL_SMALL_STACK - byte sig[MAX_ECC_BYTES + WC_SHA256_DIGEST_SIZE]; + #define SIG_SZ ((MAX_ECC_BYTES * 2) + SIG_HEADER_SZ + ECC_MAX_PAD_SZ) + byte sig[SIG_SZ + WC_SHA256_DIGEST_SIZE]; #else byte* sig; #endif