1 diff --git a/src/openssl.c b/src/openssl.c
2 index 4f63ef9..411f9f6 100644
5 @@ -1062,6 +1062,7 @@ _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session,
6 "Unable to extract public key from private key "
7 "file: Unable to open private key file");
9 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
10 if (!EVP_get_cipherbyname("des")) {
11 /* If this cipher isn't loaded it's a pretty good indication that none
12 * are. I have *NO DOUBT* that there's a better way to deal with this
13 @@ -1070,6 +1071,7 @@ _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session,
15 OpenSSL_add_all_ciphers();
19 pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void*)passphrase);
21 @@ -1138,6 +1140,7 @@ _libssh2_pub_priv_keyfilememory(LIBSSH2_SESSION *session,
25 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
26 if (!EVP_get_cipherbyname("des")) {
27 /* If this cipher isn't loaded it's a pretty good indication that none
28 * are. I have *NO DOUBT* that there's a better way to deal with this
29 @@ -1146,6 +1149,7 @@ _libssh2_pub_priv_keyfilememory(LIBSSH2_SESSION *session,
31 OpenSSL_add_all_ciphers();
35 pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void*)passphrase);
37 diff --git a/src/openssl.h b/src/openssl.h
38 index 3ca71fa..7a89793 100644
42 #include <openssl/opensslconf.h>
43 #include <openssl/sha.h>
44 #include <openssl/rsa.h>
45 +#ifndef OPENSSL_NO_ENGINE
46 #include <openssl/engine.h>
48 #ifndef OPENSSL_NO_DSA
49 #include <openssl/dsa.h>
51 @@ -226,10 +228,18 @@ int _libssh2_md5_init(libssh2_md5_ctx *ctx);
52 #define libssh2_hmac_cleanup(ctx) HMAC_cleanup(ctx)
55 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
56 +#ifndef OPENSSL_NO_ENGINE
57 #define libssh2_crypto_init() \
58 OpenSSL_add_all_algorithms(); \
59 ENGINE_load_builtin_engines(); \
60 ENGINE_register_all_complete()
62 +#define libssh2_crypto_init() OpenSSL_add_all_algorithms()
65 +#define libssh2_crypto_init()
68 #define libssh2_crypto_exit()