From 6762664e7e82e334f6e0d0d1719f0e57c044d186 Mon Sep 17 00:00:00 2001 From: Will Cosgrove Date: Fri, 9 Jun 2017 14:59:18 -0700 Subject: [PATCH] Fix for #188 (#189) * Update openssl.c * Create openssl.h --- src/openssl.c | 11 +---------- src/openssl.h | 1 + 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/openssl.c b/src/openssl.c index 25cef082..ff52785e 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -1056,16 +1056,7 @@ _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session, "Unable to extract public key from private key " "file: Unable to open private key file"); } -#if OPENSSL_VERSION_NUMBER < 0x10100000L - if (!EVP_get_cipherbyname("des")) { - /* If this cipher isn't loaded it's a pretty good indication that none - * are. I have *NO DOUBT* that there's a better way to deal with this - * ($#&%#$(%$#( Someone buy me an OpenSSL manual and I'll read up on - * it. - */ - OpenSSL_add_all_ciphers(); - } -#endif + BIO_reset(bp); pk = PEM_read_bio_PrivateKey(bp, NULL, NULL, (void*)passphrase); BIO_free(bp); diff --git a/src/openssl.h b/src/openssl.h index d8874286..0de14b01 100644 --- a/src/openssl.h +++ b/src/openssl.h @@ -233,6 +233,7 @@ int _libssh2_md5_init(libssh2_md5_ctx *ctx); #else #define libssh2_crypto_init() \ OpenSSL_add_all_algorithms(); \ + OpenSSL_add_all_ciphers(); \ ENGINE_load_builtin_engines(); \ ENGINE_register_all_complete() #endif