Skip to content

Commit a1e2ba2

Browse files
Merge pull request #9036 from kareem-wolfssl/zd20239
Fix size used by signature context struct with WOLFSSL_NO_MALLOC.
2 parents d7f85c5 + f130a9d commit a1e2ba2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

wolfssl/wolfcrypt/asn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ struct SignatureCtx {
13861386
#endif
13871387
#if !defined(NO_RSA) || !defined(NO_DSA)
13881388
#ifdef WOLFSSL_NO_MALLOC
1389-
byte sigCpy[MAX_SIG_SZ];
1389+
byte sigCpy[MAX_ENCODED_SIG_SZ];
13901390
#else
13911391
byte* sigCpy;
13921392
#endif

wolfssl/wolfcrypt/types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2071,7 +2071,6 @@ enum Max_ASN {
20712071
#else
20722072
MAX_ENCODED_SIG_SZ = 64,
20732073
#endif
2074-
MAX_SIG_SZ = 256,
20752074
MAX_ALGO_SZ = 20,
20762075
MAX_LENGTH_SZ = WOLFSSL_ASN_MAX_LENGTH_SZ, /* Max length size for DER encoding */
20772076
MAX_SHORT_SZ = (1 + 1 + 5), /* asn int + byte len + 5 byte length */
@@ -2128,6 +2127,8 @@ enum Max_ASN {
21282127
#define WC_MAX_BLOCK_SIZE 128
21292128
#endif
21302129

2130+
#define MAX_SIG_SZ MAX_ENCODED_SIG_SZ
2131+
21312132
#ifdef WOLFSSL_CERT_GEN
21322133
/* Used in asn.c MakeSignature for ECC and RSA non-blocking/async */
21332134
enum CertSignState {

0 commit comments

Comments
 (0)