Skip to content

Commit 0c93bf9

Browse files
authored
Merge pull request #10229 from mattia-moffa/20260415-zd21621
Fix regressions (fast math MAX_ENCODED_SIG_SZ; DTLS export IV buffer size)
2 parents 1fab253 + bd3cf10 commit 0c93bf9

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/internal.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,9 @@ static int ExportKeyState(WOLFSSL* ssl, byte* exp, word32 len, byte ver,
10001000
XMEMCPY(exp + idx, keys->aead_exp_IV, AEAD_MAX_EXP_SZ);
10011001
idx += AEAD_MAX_EXP_SZ;
10021002

1003-
sz = (small)? 0: ssl->specs.iv_size;
1003+
sz = (small) ? 0 :
1004+
(ssl->specs.iv_size > AEAD_MAX_IMP_SZ ? AEAD_MAX_IMP_SZ
1005+
: ssl->specs.iv_size);
10041006
if (idx + (sz * 2) + OPAQUE8_LEN > len) {
10051007
WOLFSSL_MSG("Buffer not large enough for imp IVs");
10061008
return BUFFER_E;

wolfssl/wolfcrypt/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,7 @@ enum Max_ASN {
23212321
MAX_ENCODED_SIG_SZ = 5120,
23222322
#elif !defined(NO_RSA)
23232323
#if defined(USE_FAST_MATH) && defined(FP_MAX_BITS)
2324-
MAX_ENCODED_SIG_SZ = FP_MAX_BITS / 8,
2324+
MAX_ENCODED_SIG_SZ = FP_MAX_BITS / 16,
23252325
#elif (defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)) && \
23262326
defined(SP_INT_BITS)
23272327
MAX_ENCODED_SIG_SZ = WC_BITS_TO_BYTES(SP_INT_BITS),

0 commit comments

Comments
 (0)