Skip to content

Commit 5bd5f36

Browse files
anhuJacobBarthelmeh
authored andcommitted
Fix RSA exponent printing (ZD 21426)
Increase buff size from 8 to 24 bytes in PrintPubKeyRSA and related EVP PKEY print functions.
1 parent 985ccea commit 5bd5f36

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

wolfcrypt/src/evp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11877,7 +11877,7 @@ static int PrintHexWithColon(WOLFSSL_BIO* out, const byte* input,
1187711877
static int PrintPubKeyRSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
1187811878
int indent, int bitlen, WOLFSSL_ASN1_PCTX* pctx)
1187911879
{
11880-
byte buff[8] = { 0 };
11880+
byte buff[24] = { 0 };
1188111881
int res = WC_NO_ERR_TRACE(WOLFSSL_FAILURE);
1188211882
word32 inOutIdx = 0;
1188311883
word32 nSz; /* size of modulus */
@@ -12021,7 +12021,7 @@ static int PrintPubKeyEC(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
1202112021
{
1202212022
byte* pub = NULL;
1202312023
word32 pubSz = 0;
12024-
byte buff[8] = { 0 };
12024+
byte buff[24] = { 0 };
1202512025
int res = WOLFSSL_SUCCESS;
1202612026
word32 inOutIdx = 0;
1202712027
int curveId = 0;
@@ -12210,7 +12210,7 @@ static int PrintPubKeyDSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
1221012210
int indent, int bitlen, WOLFSSL_ASN1_PCTX* pctx)
1221112211
{
1221212212

12213-
byte buff[8] = { 0 };
12213+
byte buff[24] = { 0 };
1221412214
int length;
1221512215
int res = WC_NO_ERR_TRACE(WOLFSSL_FAILURE);
1221612216
word32 inOutIdx = 0;
@@ -12417,7 +12417,7 @@ static int PrintPubKeyDH(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
1241712417
int indent, int bitlen, WOLFSSL_ASN1_PCTX* pctx)
1241812418
{
1241912419

12420-
byte buff[8] = { 0 };
12420+
byte buff[24] = { 0 };
1242112421
int res = WC_NO_ERR_TRACE(WOLFSSL_FAILURE);
1242212422
word32 length;
1242312423
word32 inOutIdx;

0 commit comments

Comments
 (0)