Skip to content

Commit 8c1298a

Browse files
committed
Check if DH's P and G are set
1 parent d45e42e commit 8c1298a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/internal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6930,9 +6930,10 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
69306930
ssl->options.haveRSA = ctx->haveRSA;
69316931
ssl->options.haveDH = ctx->haveDH;
69326932
#ifndef NO_CERTS
6933-
/* Its possible that algorithm parameters were set in the ctx (ie: DH),
6934-
* recalculate cipher suites. */
6935-
if (ssl->options.haveDH) {
6933+
/* Its possible that DH algorithm parameters were set in the ctx, recalc
6934+
* cipher suites. */
6935+
if (ssl->options.haveDH && ctx->serverDH_P.buffer != NULL &&
6936+
ctx->serverDH_G.buffer != NULL) {
69366937
if (ssl->suites == NULL) {
69376938
if (AllocateSuites(ssl) != 0) {
69386939
return MEMORY_E;

0 commit comments

Comments
 (0)