Skip to content

Commit c4bedf2

Browse files
committed
Fix RSA exponent printing (ZD 21426)
Increase buff size from 8 to 24 bytes in PrintPubKeyRSA and related EVP PKEY print functions.
1 parent 32506fc commit c4bedf2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

wolfcrypt/src/evp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11834,7 +11834,7 @@ static int PrintHexWithColon(WOLFSSL_BIO* out, const byte* input,
1183411834
static int PrintPubKeyRSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
1183511835
int indent, int bitlen, WOLFSSL_ASN1_PCTX* pctx)
1183611836
{
11837-
byte buff[8] = { 0 };
11837+
byte buff[24] = { 0 };
1183811838
int res = WC_NO_ERR_TRACE(WOLFSSL_FAILURE);
1183911839
word32 inOutIdx = 0;
1184011840
word32 nSz; /* size of modulus */
@@ -11978,7 +11978,7 @@ static int PrintPubKeyEC(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
1197811978
{
1197911979
byte* pub = NULL;
1198011980
word32 pubSz = 0;
11981-
byte buff[8] = { 0 };
11981+
byte buff[24] = { 0 };
1198211982
int res = WOLFSSL_SUCCESS;
1198311983
word32 inOutIdx = 0;
1198411984
int curveId = 0;
@@ -12167,7 +12167,7 @@ static int PrintPubKeyDSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
1216712167
int indent, int bitlen, WOLFSSL_ASN1_PCTX* pctx)
1216812168
{
1216912169

12170-
byte buff[8] = { 0 };
12170+
byte buff[24] = { 0 };
1217112171
int length;
1217212172
int res = WC_NO_ERR_TRACE(WOLFSSL_FAILURE);
1217312173
word32 inOutIdx = 0;
@@ -12374,7 +12374,7 @@ static int PrintPubKeyDH(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
1237412374
int indent, int bitlen, WOLFSSL_ASN1_PCTX* pctx)
1237512375
{
1237612376

12377-
byte buff[8] = { 0 };
12377+
byte buff[24] = { 0 };
1237812378
int res = WC_NO_ERR_TRACE(WOLFSSL_FAILURE);
1237912379
word32 length;
1238012380
word32 inOutIdx;

0 commit comments

Comments
 (0)