mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
fix valgrind warnings from yesterday changes
This commit is contained in:
@@ -4082,6 +4082,7 @@ int CyaSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz);
|
||||
/* Set cert issuer from issuerFile in PEM */
|
||||
int SetIssuer(Cert* cert, const char* issuerFile)
|
||||
{
|
||||
int ret;
|
||||
int derSz;
|
||||
byte* der = (byte*)XMALLOC(EIGHTK_BUF, NULL, DYNAMIC_TYPE_CERT);
|
||||
|
||||
@@ -4091,16 +4092,17 @@ int SetIssuer(Cert* cert, const char* issuerFile)
|
||||
}
|
||||
derSz = CyaSSL_PemCertToDer(issuerFile, der, EIGHTK_BUF);
|
||||
cert->selfSigned = 0;
|
||||
|
||||
ret = SetNameFromCert(&cert->issuer, der, derSz);
|
||||
XFREE(der, NULL, DYNAMIC_TYPE_CERT);
|
||||
|
||||
return SetNameFromCert(&cert->issuer, der, derSz);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Set cert subject from subjectFile in PEM */
|
||||
int SetSubject(Cert* cert, const char* subjectFile)
|
||||
{
|
||||
int ret;
|
||||
int derSz;
|
||||
byte* der = (byte*)XMALLOC(EIGHTK_BUF, NULL, DYNAMIC_TYPE_CERT);
|
||||
|
||||
@@ -4109,10 +4111,10 @@ int SetSubject(Cert* cert, const char* subjectFile)
|
||||
return MEMORY_E;
|
||||
}
|
||||
derSz = CyaSSL_PemCertToDer(subjectFile, der, EIGHTK_BUF);
|
||||
|
||||
ret = SetNameFromCert(&cert->subject, der, derSz);
|
||||
XFREE(der, NULL, DYNAMIC_TYPE_CERT);
|
||||
|
||||
return SetNameFromCert(&cert->subject, der, derSz);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -4121,6 +4123,7 @@ int SetSubject(Cert* cert, const char* subjectFile)
|
||||
/* Set atl names from file in PEM */
|
||||
int SetAltNames(Cert* cert, const char* file)
|
||||
{
|
||||
int ret;
|
||||
int derSz;
|
||||
byte* der = (byte*)XMALLOC(EIGHTK_BUF, NULL, DYNAMIC_TYPE_CERT);
|
||||
|
||||
@@ -4129,9 +4132,10 @@ int SetAltNames(Cert* cert, const char* file)
|
||||
return MEMORY_E;
|
||||
}
|
||||
derSz = CyaSSL_PemCertToDer(file, der, EIGHTK_BUF);
|
||||
ret = SetAltNamesFromCert(cert, der, derSz);
|
||||
XFREE(der, NULL, DYNAMIC_TYPE_CERT);
|
||||
|
||||
return SetAltNamesFromCert(cert, der, derSz);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CYASSL_ALT_NAMES */
|
||||
|
@@ -498,7 +498,7 @@ int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng)
|
||||
err = mp_init_multi(&key->n, &key->e, &key->d, &key->p, &key->q, NULL);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_init_multi(&key->dP, &key->dP, &key->u, NULL, NULL, NULL);
|
||||
err = mp_init_multi(&key->dP, &key->dQ, &key->u, NULL, NULL, NULL);
|
||||
|
||||
if (err == MP_OKAY)
|
||||
err = mp_sub_d(&p, 1, &tmp2); /* tmp2 = p-1 */
|
||||
|
@@ -1679,6 +1679,7 @@ int rsa_test(void)
|
||||
fclose(pemFile);
|
||||
free(pem);
|
||||
free(derCert);
|
||||
FreeRsaKey(&caKey);
|
||||
}
|
||||
#ifdef HAVE_NTRU
|
||||
{
|
||||
@@ -1795,6 +1796,7 @@ int rsa_test(void)
|
||||
fclose(ntruPrivFile);
|
||||
free(pem);
|
||||
free(derCert);
|
||||
FreeRsaKey(&caKey);
|
||||
}
|
||||
#endif /* HAVE_NTRU */
|
||||
#endif /* CYASSL_CERT_GEN */
|
||||
|
Reference in New Issue
Block a user