forked from wolfSSL/wolfssl
Merge pull request #4779 from SparkiDev/dyn_cert
Cert: allow allocation of fields even with WOLFSSL_NO_MALLOC
This commit is contained in:
@ -17653,7 +17653,7 @@ static int DecodeCertReq(DecodedCert* cert, int* criticalExt)
|
|||||||
int ParseCert(DecodedCert* cert, int type, int verify, void* cm)
|
int ParseCert(DecodedCert* cert, int type, int verify, void* cm)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
#ifndef WOLFSSL_NO_MALLOC
|
#if !defined(WOLFSSL_NO_MALLOC) || defined(WOLFSSL_DYN_CERT)
|
||||||
char* ptr;
|
char* ptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -17661,7 +17661,7 @@ int ParseCert(DecodedCert* cert, int type, int verify, void* cm)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#ifndef WOLFSSL_NO_MALLOC
|
#if !defined(WOLFSSL_NO_MALLOC) || defined(WOLFSSL_DYN_CERT)
|
||||||
/* cert->subjectCN not stored as copy of WOLFSSL_NO_MALLOC defind */
|
/* cert->subjectCN not stored as copy of WOLFSSL_NO_MALLOC defind */
|
||||||
if (cert->subjectCNLen > 0) {
|
if (cert->subjectCNLen > 0) {
|
||||||
ptr = (char*) XMALLOC(cert->subjectCNLen + 1, cert->heap,
|
ptr = (char*) XMALLOC(cert->subjectCNLen + 1, cert->heap,
|
||||||
@ -17675,7 +17675,7 @@ int ParseCert(DecodedCert* cert, int type, int verify, void* cm)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WOLFSSL_NO_MALLOC
|
#if !defined(WOLFSSL_NO_MALLOC) || defined(WOLFSSL_DYN_CERT)
|
||||||
/* cert->publicKey not stored as copy if WOLFSSL_NO_MALLOC defined */
|
/* cert->publicKey not stored as copy if WOLFSSL_NO_MALLOC defined */
|
||||||
if (cert->keyOID == RSAk &&
|
if (cert->keyOID == RSAk &&
|
||||||
cert->publicKey != NULL && cert->pubKeySize > 0) {
|
cert->publicKey != NULL && cert->pubKeySize > 0) {
|
||||||
|
Reference in New Issue
Block a user