From dabf23ff6bf00ad0d94bbbcdc18ee032a35060e2 Mon Sep 17 00:00:00 2001 From: Derek Schrock Date: Wed, 9 Jan 2019 18:18:56 -0500 Subject: [PATCH] Fix www/elinks SSL when egd is missing For newer openssl/libressl when RAND_egd is disabled patch-src_network_ssl_ssl.c removed RAND_egd() and the RAND_file_name() leaving f_randfile uninitialized resulting odd files in $HOME/ when elinks initialized ssl. $ ls -ld $'\x01' -rw------- 1 dereks wheel 1024 Jan 9 18:24 ? The file should be ~/.rnd set but RAND_file_name() Fixed upstram is but this commit: https://repo.or.cz/elinks.git/blobdiff/6eba447e8ae12cacac3b479c7148d189bea3e8ea..f4a58ba3b574a478fd5954ba2c5b29e8b809ff9b:/src/network/ssl/ssl.c --- www/elinks/files/patch-src_network_ssl_ssl.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/www/elinks/files/patch-src_network_ssl_ssl.c b/www/elinks/files/patch-src_network_ssl_ssl.c index e1497ae2e927..088bb65b0e93 100644 --- a/www/elinks/files/patch-src_network_ssl_ssl.c +++ b/www/elinks/files/patch-src_network_ssl_ssl.c @@ -1,14 +1,21 @@ ---- src/network/ssl/ssl.c.orig 2009-08-22 13:15:08.000000000 +0200 -+++ src/network/ssl/ssl.c 2015-03-21 12:41:15.886709287 +0100 -@@ -49,7 +49,10 @@ init_openssl(struct module *module) +--- src/network/ssl/ssl.c.orig 2019-01-09 23:04:06 UTC ++++ src/network/ssl/ssl.c +@@ -49,11 +49,17 @@ init_openssl(struct module *module) * cannot initialize the PRNG and so every attempt to use SSL fails. * It's actually an OpenSSL FAQ, and according to them, it's up to the * application coders to seed the RNG. -- William Yodlowsky */ - if (RAND_egd(RAND_file_name(f_randfile, sizeof(f_randfile))) < 0) { -+#ifndef OPENSSL_NO_EGD -+ if (RAND_egd(RAND_file_name(f_randfile, sizeof(f_randfile))) < 0) -+#endif ++ RAND_file_name(f_randfile, sizeof(f_randfile)); ++#ifdef HAVE_RAND_EGD ++ if (RAND_egd(f_randfile) < 0) + { /* Not an EGD, so read and write to it */ ++#endif if (RAND_load_file(f_randfile, -1)) RAND_write_file(f_randfile); ++#ifdef HAVE_RAND_EGD + } ++#endif + + SSLeay_add_ssl_algorithms(); + context = SSL_CTX_new(SSLv23_client_method()); -- 2.20.1