diff -Nru '--exclude=build' '--exclude=encfs-1.9.4.kdev4' encfs-1.9.4.orig/encfs/encfsctl.cpp encfs-1.9.4/encfs/encfsctl.cpp --- encfs-1.9.4.orig/encfs/encfsctl.cpp 2018-01-28 22:07:41.000000000 +0100 +++ encfs-1.9.4/encfs/encfsctl.cpp 2018-03-03 23:33:32.769470790 +0100 @@ -721,8 +721,10 @@ textdomain(PACKAGE); #endif +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_load_error_strings(); SSL_library_init(); +#endif if (argc < 2) { usage(argv[0]); diff -Nru '--exclude=build' '--exclude=encfs-1.9.4.kdev4' encfs-1.9.4.orig/encfs/openssl.cpp encfs-1.9.4/encfs/openssl.cpp --- encfs-1.9.4.orig/encfs/openssl.cpp 2018-01-28 22:07:41.000000000 +0100 +++ encfs-1.9.4/encfs/openssl.cpp 2018-03-03 23:23:07.039379639 +0100 @@ -35,6 +35,7 @@ namespace encfs { +#if OPENSSL_VERSION_NUMBER < 0x10100000L unsigned long pthreads_thread_id() { return (unsigned long)pthread_self(); } static pthread_mutex_t *crypto_locks = nullptr; @@ -67,11 +68,14 @@ crypto_locks = nullptr; } } +#endif void openssl_init(bool threaded) { +#if OPENSSL_VERSION_NUMBER < 0x10100000L // initialize the SSL library SSL_load_error_strings(); SSL_library_init(); +#endif unsigned int randSeed = 0; RAND_bytes((unsigned char *)&randSeed, sizeof(randSeed)); @@ -84,15 +88,18 @@ ENGINE_register_all_complete(); #endif // NO_ENGINE +#if OPENSSL_VERSION_NUMBER < 0x10100000L if (threaded) { // provide locking functions to OpenSSL since we'll be running with // threads accessing openssl in parallel. CRYPTO_set_id_callback(pthreads_thread_id); CRYPTO_set_locking_callback(pthreads_locking_callback); } +#endif } void openssl_shutdown(bool threaded) { +#if OPENSSL_VERSION_NUMBER < 0x10100000L #ifndef OPENSSL_NO_ENGINE ENGINE_cleanup(); #endif @@ -100,6 +107,7 @@ if (threaded) { pthreads_locking_cleanup(); } +#endif } } // namespace encfs diff -Nru '--exclude=build' '--exclude=encfs-1.9.4.kdev4' encfs-1.9.4.orig/encfs/SSL_Cipher.cpp encfs-1.9.4/encfs/SSL_Cipher.cpp --- encfs-1.9.4.orig/encfs/SSL_Cipher.cpp 2018-01-28 22:07:41.000000000 +0100 +++ encfs-1.9.4/encfs/SSL_Cipher.cpp 2018-03-03 23:29:17.471053784 +0100 @@ -315,6 +315,7 @@ mlock(buffer, (size_t)keySize + (size_t)ivLength); block_enc = EVP_CIPHER_CTX_new(); +#if OPENSSL_VERSION_NUMBER < 0x10100000L EVP_CIPHER_CTX_init(block_enc); block_dec = EVP_CIPHER_CTX_new(); EVP_CIPHER_CTX_init(block_dec); @@ -323,6 +324,16 @@ stream_dec = EVP_CIPHER_CTX_new(); EVP_CIPHER_CTX_init(stream_dec); mac_ctx = HMAC_CTX_new(); +#else + EVP_CIPHER_CTX_reset(block_enc); + block_dec = EVP_CIPHER_CTX_new(); + EVP_CIPHER_CTX_reset(block_dec); + stream_enc = EVP_CIPHER_CTX_new(); + EVP_CIPHER_CTX_reset(stream_enc); + stream_dec = EVP_CIPHER_CTX_new(); + EVP_CIPHER_CTX_reset(stream_dec); + mac_ctx = HMAC_CTX_new(); +#endif HMAC_CTX_reset(mac_ctx); } diff -Nru '--exclude=build' '--exclude=encfs-1.9.4.kdev4' encfs-1.9.4.orig/encfs/test.cpp encfs-1.9.4/encfs/test.cpp --- encfs-1.9.4.orig/encfs/test.cpp 2018-01-28 22:07:41.000000000 +0100 +++ encfs-1.9.4/encfs/test.cpp 2018-03-03 23:32:54.352054068 +0100 @@ -399,8 +399,10 @@ START_EASYLOGGINGPP(argc, argv); encfs::initLogging(); +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_load_error_strings(); SSL_library_init(); +#endif #ifndef OPENSSL_NO_ENGINE ENGINE_load_builtin_engines();