check if private key exists before using with private key check function

This commit is contained in:
Jacob Barthelmeh 2021-10-29 10:51:24 -06:00
parent 8775823fa0
commit 03bc45c5b1

View File

@ -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;
}