mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 03:07:29 +02:00
Merge pull request #2601 from SparkiDev/certs_exts_fix
ProcessPeerCerts allocating memory for exts with OPENSSL_EXTRA properly
This commit is contained in:
@ -9963,12 +9963,21 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
#endif
|
#endif
|
||||||
args->idx += ctxSz;
|
args->idx += ctxSz;
|
||||||
|
|
||||||
|
#ifdef OPENSSL_EXTRA
|
||||||
|
/* allocate buffer for cert extensions */
|
||||||
|
args->exts = (buffer*)XMALLOC(sizeof(buffer) *
|
||||||
|
(ssl->verifyDepth + 1), ssl->heap, DYNAMIC_TYPE_CERT_EXT);
|
||||||
|
if (args->exts == NULL) {
|
||||||
|
ERROR_OUT(MEMORY_E, exit_ppc);
|
||||||
|
}
|
||||||
|
#else
|
||||||
/* allocate buffer for cert extensions */
|
/* allocate buffer for cert extensions */
|
||||||
args->exts = (buffer*)XMALLOC(sizeof(buffer) * MAX_CHAIN_DEPTH,
|
args->exts = (buffer*)XMALLOC(sizeof(buffer) * MAX_CHAIN_DEPTH,
|
||||||
ssl->heap, DYNAMIC_TYPE_CERT_EXT);
|
ssl->heap, DYNAMIC_TYPE_CERT_EXT);
|
||||||
if (args->exts == NULL) {
|
if (args->exts == NULL) {
|
||||||
ERROR_OUT(MEMORY_E, exit_ppc);
|
ERROR_OUT(MEMORY_E, exit_ppc);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user