Skip to content

Commit

Permalink
Both HAVE_OPENSSL_ENGINE_H and OPENSSL_NO_ENGINE should be checked
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo authored and ned14 committed Dec 15, 2020
1 parent dbd6d31 commit 145f749
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/vtls/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ int cert_stuff(struct connectdata *conn,
}
break;
case SSL_FILETYPE_ENGINE:
#ifdef USE_OPENSSL_ENGINE
#if defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
{ /* XXXX still needs some work */
EVP_PKEY *priv_key = NULL;

Expand Down Expand Up @@ -1261,7 +1261,7 @@ static int Curl_ossl_check_cxn(struct connectdata *conn)
static CURLcode Curl_ossl_set_engine(struct Curl_easy *data,
const char *engine)
{
#ifdef USE_OPENSSL_ENGINE
#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
ENGINE *e;

#if OPENSSL_VERSION_NUMBER >= 0x00909000L
Expand Down Expand Up @@ -1306,7 +1306,7 @@ static CURLcode Curl_ossl_set_engine(struct Curl_easy *data,
*/
static CURLcode Curl_ossl_set_engine_default(struct Curl_easy *data)
{
#ifdef USE_OPENSSL_ENGINE
#if defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
if(data->state.engine) {
if(ENGINE_set_default(data->state.engine, ENGINE_METHOD_ALL) > 0) {
infof(data, "set default crypto engine '%s'\n",
Expand All @@ -1329,7 +1329,7 @@ static CURLcode Curl_ossl_set_engine_default(struct Curl_easy *data)
static struct curl_slist *Curl_ossl_engines_list(struct Curl_easy *data)
{
struct curl_slist *list = NULL;
#ifdef USE_OPENSSL_ENGINE
#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
struct curl_slist *beg;
ENGINE *e;

Expand Down Expand Up @@ -1490,7 +1490,7 @@ static void Curl_ossl_session_free(void *ptr)
*/
static void Curl_ossl_close_all(struct Curl_easy *data)
{
#ifdef USE_OPENSSL_ENGINE
#if defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
if(data->state.engine) {
ENGINE_finish(data->state.engine);
ENGINE_free(data->state.engine);
Expand Down

0 comments on commit 145f749

Please sign in to comment.