diff -Naur heirloom-mailx-12.5/openssl.c heirloom-mailx-12.5-p/openssl.c --- heirloom-mailx-12.5/openssl.c 2011-04-26 23:23:22.000000000 +0200 +++ heirloom-mailx-12.5-p/openssl.c 2019-04-05 21:21:54.876846795 +0200 @@ -63,6 +63,7 @@ #include #include #include +#include #include "rcv.h" #include @@ -137,7 +138,12 @@ if ((cp = value("ssl-rand-egd")) != NULL) { cp = expand(cp); - if (RAND_egd(cp) == -1) { +#ifndef OPENSSL_NO_EGD + if (RAND_egd(cp) == -1) +#else + if (1) +#endif + { fprintf(stderr, catgets(catd, CATSET, 245, "entropy daemon at \"%s\" not available\n"), cp); @@ -171,6 +177,10 @@ verbose = value("verbose") != NULL; if (initialized == 0) { SSL_library_init(); +/* Load all bundled ENGINEs into memory and make them visible */ + ENGINE_load_builtin_engines(); + /* Register all of them for every algorithm they collectively implement */ + ENGINE_register_all_complete(); initialized = 1; } if (rand_init == 0) @@ -216,9 +226,13 @@ cp = ssl_method_string(uhp); if (cp != NULL) { +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010006fL +#ifndef OPENSSL_NO_SSL2 if (equal(cp, "ssl2")) method = SSLv2_client_method(); - else if (equal(cp, "ssl3")) + else +#endif + if (equal(cp, "ssl3")) method = SSLv3_client_method(); else if (equal(cp, "tls1")) method = TLSv1_client_method(); @@ -227,8 +241,25 @@ "Invalid SSL method \"%s\"\n"), cp); method = SSLv23_client_method(); } +#else + method = NULL; + if (equal(cp, "tls")) + method = TLS_client_method(); + else if (equal(cp, "dtls")) + method = DTLS_client_method(); + + if (!method) { + fprintf(stderr, catgets(catd, CATSET, 244, + "Invalid SSL method \"%s\"\n"), cp); + method = TLS_client_method(); + } +#endif } else +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010006fL method = SSLv23_client_method(); +#else + method = TLS_client_method(); +#endif return method; }