From 03bc45c5b12d6a3fc7b210f2691959e2dd7c9841 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 29 Oct 2021 10:51:24 -0600 Subject: [PATCH] check if private key exists before using with private key check function --- src/ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index db597a303..7a5975e26 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -7747,7 +7747,7 @@ int wolfSSL_CTX_check_private_key(const WOLFSSL_CTX* ctx) WOLFSSL_ENTER("wolfSSL_CTX_check_private_key"); - if (ctx == NULL || ctx->certificate == NULL) { + if (ctx == NULL || ctx->certificate == NULL || ctx->privateKey == NULL) { return WOLFSSL_FAILURE; }