From 8b77f40f991d22fc835397900be673077f69f662 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Jun 2002 12:38:10 +0000 Subject: [PATCH] =?UTF-8?q?This=20fix=20MIGHT=20make=20us=20build=20nicely?= =?UTF-8?q?=20with=20OpenSSL=200.9.7.=20This=20fix=20is=20based=20on=20a?= =?UTF-8?q?=20patch=20from=20Jacob=20Meuser,=20input=20from=20G=F6tz=20Bab?= =?UTF-8?q?in-Ebell=20and=20my=20own=20browsing=20of=20the=20latest=20incl?= =?UTF-8?q?ude=20files.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ssluse.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/ssluse.c b/lib/ssluse.c index 7a4d685a5..3c7f1ba21 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -55,6 +55,15 @@ #undef HAVE_USERDATA_IN_PWD_CALLBACK #endif +#if OPENSSL_VERSION_NUMBER >= 0x00907001L +/* ENGINE_load_private_key() takes four arguments */ +#define HAVE_ENGINE_LOAD_FOUR_ARGS +#else +/* ENGINE_load_private_key() takes three arguments */ +#undef HAVE_ENGINE_LOAD_FOUR_ARGS +#endif + + #ifndef HAVE_USERDATA_IN_PWD_CALLBACK static char global_passwd[64]; #endif @@ -275,11 +284,17 @@ int cert_stuff(struct connectdata *conn, { /* XXXX still needs some work */ EVP_PKEY *priv_key = NULL; if (conn && conn->data && conn->data->engine) { +#ifdef HAVE_ENGINE_LOAD_FOUR_ARGS + UI_METHOD *ui_method = UI_OpenSSL(); +#endif if (!key_file || !key_file[0]) { failf(data, "no key set to load from crypto engine\n"); return 0; } priv_key = ENGINE_load_private_key(conn->data->engine,key_file, +#ifdef HAVE_ENGINE_LOAD_FOUR_ARGS + ui_method, +#endif data->set.key_passwd); if (!priv_key) { failf(data, "failed to load private key from crypto engine\n");