Check if DH's P and G are set

This commit is contained in:
Anthony Hu
2025-06-24 09:59:12 -04:00
parent d45e42e2e6
commit 8c1298a1d8

View File

@@ -6930,9 +6930,10 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
ssl->options.haveRSA = ctx->haveRSA;
ssl->options.haveDH = ctx->haveDH;
#ifndef NO_CERTS
/* Its possible that algorithm parameters were set in the ctx (ie: DH),
* recalculate cipher suites. */
if (ssl->options.haveDH) {
/* Its possible that DH algorithm parameters were set in the ctx, recalc
* cipher suites. */
if (ssl->options.haveDH && ctx->serverDH_P.buffer != NULL &&
ctx->serverDH_G.buffer != NULL) {
if (ssl->suites == NULL) {
if (AllocateSuites(ssl) != 0) {
return MEMORY_E;