Skip to content

Commit 735c0f6

Browse files
committed
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().
1 parent 9781c1f commit 735c0f6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

wolfcrypt/src/ecc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10229,7 +10229,8 @@ static int _ecc_pairwise_consistency_test(ecc_key* key, WC_RNG* rng)
1022910229

1023010230
if (!err && (flags & WC_ECC_FLAG_DEC_SIGN)) {
1023110231
#ifndef WOLFSSL_SMALL_STACK
10232-
byte sig[MAX_ECC_BYTES + WC_SHA256_DIGEST_SIZE];
10232+
#define SIG_SZ ((MAX_ECC_BYTES * 2) + SIG_HEADER_SZ + ECC_MAX_PAD_SZ)
10233+
byte sig[SIG_SZ + WC_SHA256_DIGEST_SIZE];
1023310234
#else
1023410235
byte* sig;
1023510236
#endif

0 commit comments

Comments
 (0)