Blame SOURCES/mailx-12.5-openssl.patch

9770e7
diff --git a/openssl.c b/openssl.c
9770e7
index b4e33fc..9d1eaf4 100644
9770e7
--- a/openssl.c
9770e7
+++ b/openssl.c
9770e7
@@ -136,6 +136,7 @@ ssl_rand_init(void)
9770e7
 	int state = 0;
9770e7
 
9770e7
 	if ((cp = value("ssl-rand-egd")) != NULL) {
9770e7
+#ifndef OPENSSL_NO_EGD
9770e7
 		cp = expand(cp);
9770e7
 		if (RAND_egd(cp) == -1) {
9770e7
 			fprintf(stderr, catgets(catd, CATSET, 245,
9770e7
@@ -143,6 +144,9 @@ ssl_rand_init(void)
9770e7
 					cp);
9770e7
 		} else
9770e7
 			state = 1;
9770e7
+#else
9770e7
+		fprintf(stderr, "entropy daemon not available\n");
9770e7
+#endif
9770e7
 	} else if ((cp = value("ssl-rand-file")) != NULL) {
9770e7
 		cp = expand(cp);
9770e7
 		if (RAND_load_file(cp, 1024) == -1) {
9770e7
@@ -216,9 +220,16 @@ ssl_select_method(const char *uhp)
9770e7
 
9770e7
 	cp = ssl_method_string(uhp);
9770e7
 	if (cp != NULL) {
9770e7
-		if (equal(cp, "ssl2"))
9770e7
+		if (equal(cp, "ssl2")) {
9770e7
+#if OPENSSL_VERSION_NUMBER < 0x10100000
9770e7
 			method = SSLv2_client_method();
9770e7
-		else if (equal(cp, "ssl3"))
9770e7
+#else
9770e7
+	/* SSLv2 support was removed in OpenSSL 1.1.0 */
9770e7
+			fprintf(stderr, catgets(catd, CATSET, 244,
9770e7
+					"Unsupported SSL method \"%s\"\n"), cp);
9770e7
+			method = SSLv23_client_method();
9770e7
+#endif
9770e7
+		} else if (equal(cp, "ssl3"))
9770e7
 			method = SSLv3_client_method();
9770e7
 		else if (equal(cp, "tls1"))
9770e7
 			method = TLSv1_client_method();