Skip to content

Commit 5003c03

Browse files
committed
Fix DH encoding check in wolfSSL_CTX_set_tmp_dh: && to || and < to <= to catch single-param failure and zero-length, matching wolfSSL_set_tmp_dh.
1 parent 939f978 commit 5003c03

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ssl_load.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5864,7 +5864,7 @@ long wolfSSL_CTX_set_tmp_dh(WOLFSSL_CTX* ctx, WOLFSSL_DH* dh)
58645864
pSz = wolfSSL_BN_bn2bin(dh->p, p);
58655865
gSz = wolfSSL_BN_bn2bin(dh->g, g);
58665866
/* Check encoding worked. */
5867-
if ((pSz < 0) && (gSz < 0)) {
5867+
if ((pSz <= 0) || (gSz <= 0)) {
58685868
ret = WOLFSSL_FATAL_ERROR;
58695869
}
58705870
}

0 commit comments

Comments
 (0)