Fixed uninitialized parameter for Base16_Encode

This commit is contained in:
TakayukiMatsuo
2021-06-14 13:45:12 +09:00
parent 50526cfe67
commit ebec2fbd25
4 changed files with 7 additions and 7 deletions

View File

@ -33404,7 +33404,7 @@ WOLFSSL_DH* wolfSSL_DH_dup(WOLFSSL_DH* dh)
/* Set the members of DhKey into WOLFSSL_DH
* Specify elements to set via the 2nd parmeter
*/
int SetDhExternal_ex(WOLFSSL_DH *dh, Element_Set elm)
int SetDhExternal_ex(WOLFSSL_DH *dh, int elm)
{
DhKey *key;
WOLFSSL_MSG("Entering SetDhExternal_ex");
@ -33460,7 +33460,7 @@ int SetDhExternal_ex(WOLFSSL_DH *dh, Element_Set elm)
*/
int SetDhExternal(WOLFSSL_DH *dh)
{
Element_Set elements = ELEMENT_P | ELEMENT_G | ELEMENT_PUB | ELEMENT_PRV;
int elements = ELEMENT_P | ELEMENT_G | ELEMENT_PUB | ELEMENT_PRV;
WOLFSSL_MSG("Entering SetDhExternal");
return SetDhExternal_ex(dh, elements);
}

View File

@ -2607,7 +2607,6 @@ static void test_wolfSSL_EVP_PKEY_print_public(void)
char line1[256] = { 0 };
int i;
(void)line1;
printf(testingFmt, "EVP_PKEY_print_public()");
/* test error cases */
AssertIntEQ( EVP_PKEY_print_public(NULL,NULL,0,NULL),0L);
@ -2862,6 +2861,7 @@ static void test_wolfSSL_EVP_PKEY_print_public(void)
(void)wbio;
(void)rbio;
(void)line;
(void)line1;
(void)i;
printf(resultFmt, passed);
#endif /* OPENSSL_EXTRA */

View File

@ -7225,9 +7225,10 @@ static int PrintHexWithColon(WOLFSSL_BIO* out, const byte* input,
for (in = 0; in < (word32)inlen && ret == WOLFSSL_SUCCESS; in += 15 ) {
Indent(out, indent);
for (i = 0; i < 15 && in + i < (word32)inlen; i++) {
for (i = 0; (i < 15) && (in + i < (word32)inlen); i++) {
if (ret == WOLFSSL_SUCCESS) {
outSz = sizeof(outHex);
ret = Base16_Encode((const byte*)&data[in + i], 1,
outHex, &outSz) == 0;
}
@ -7368,7 +7369,6 @@ static int PrintPubKeyRSA(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
if (wolfSSL_BIO_write(out, line, (int)XSTRLEN(line)) <= 0) {
return WOLFSSL_FAILURE;
}
idx = 0;
XMEMSET(buff, 0, sizeof(buff));
if (mp_tohex(&a, (char*)buff) != 0) {
return WOLFSSL_FAILURE;
@ -7530,7 +7530,7 @@ static int PrintPubKeyEC(WOLFSSL_BIO* out, const byte* pkey, int pkeySz,
XFREE(pub, NULL, DYNAMIC_TYPE_ECC_BUFFER);
pub = NULL;
}
return res;
}
#endif /* HAVE_ECC */

View File

@ -4827,7 +4827,7 @@ typedef enum elem_set {
ELEMENT_PUB = 0x08,
ELEMENT_PRV = 0x10,
} Element_Set;
WOLFSSL_LOCAL int SetDhExternal_ex(WOLFSSL_DH *dh, Element_Set elm );
WOLFSSL_LOCAL int SetDhExternal_ex(WOLFSSL_DH *dh, int elm );
WOLFSSL_LOCAL int SetDhInternal(WOLFSSL_DH* dh);
WOLFSSL_LOCAL int SetDhExternal(WOLFSSL_DH *dh);