summaryrefslogtreecommitdiff
path: root/secure/lib
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2020-07-01 00:59:28 +0000
committerConrad Meyer <cem@FreeBSD.org>2020-07-01 00:59:28 +0000
commit80a315ffb6053e5e2b1a0d07d7571fad0e0a64bd (patch)
tree80983adc0bdedafd1f7279a7652dbf8745b7edb8 /secure/lib
parent94bc2117b4adaf7101cc412f4277e5812ad61ae2 (diff)
Notes
Diffstat (limited to 'secure/lib')
-rw-r--r--secure/lib/libcrypto/opensslconf.h.in3
-rw-r--r--secure/lib/libssl/Makefile2
-rw-r--r--secure/lib/libssl/dummy_abi.c46
3 files changed, 51 insertions, 0 deletions
diff --git a/secure/lib/libcrypto/opensslconf.h.in b/secure/lib/libcrypto/opensslconf.h.in
index 503a44c68480..1a68649dde0a 100644
--- a/secure/lib/libcrypto/opensslconf.h.in
+++ b/secure/lib/libcrypto/opensslconf.h.in
@@ -79,6 +79,9 @@ extern "C" {
#ifndef OPENSSL_NO_SSL3
# define OPENSSL_NO_SSL3
#endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+# define OPENSSL_NO_SSL3_METHOD
+#endif
#ifndef OPENSSL_NO_UBSAN
# define OPENSSL_NO_UBSAN
#endif
diff --git a/secure/lib/libssl/Makefile b/secure/lib/libssl/Makefile
index ce9771450435..d97775b9afe4 100644
--- a/secure/lib/libssl/Makefile
+++ b/secure/lib/libssl/Makefile
@@ -22,6 +22,8 @@ SRCS+= ssl3_record.c ssl3_record_tls13.c
SRCS+= extensions.c extensions_clnt.c extensions_cust.c extensions_srvr.c
SRCS+= statem.c statem_clnt.c statem_dtls.c statem_lib.c statem_srvr.c
+SRCS+= dummy_abi.c
+
LIBADD= crypto
CFLAGS+= -I${LCRYPTO_SRC}/ssl
diff --git a/secure/lib/libssl/dummy_abi.c b/secure/lib/libssl/dummy_abi.c
new file mode 100644
index 000000000000..79d38a420093
--- /dev/null
+++ b/secure/lib/libssl/dummy_abi.c
@@ -0,0 +1,46 @@
+/* This file is in the public domain. */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <stdbool.h>
+#include <unistd.h>
+
+#include <openssl/ssl.h>
+
+static inline void
+__SSLv3_dummy_method_impl(void)
+{
+ static const char warning[] = "SSLv3 use is deprecated.\n";
+ static bool once = false;
+
+ if (once)
+ return;
+
+ once = true;
+ write(STDERR_FILENO, warning, sizeof(warning) - 1);
+}
+
+const SSL_METHOD *
+__SSLv3_method_fbsd12(void)
+{
+ __SSLv3_dummy_method_impl();
+ return (NULL);
+}
+__sym_compat(SSLv3_method, __SSLv3_method_fbsd12, OPENSSL_1_1_0);
+
+const SSL_METHOD *
+__SSLv3_client_method_fbsd12(void)
+{
+ __SSLv3_dummy_method_impl();
+ return (NULL);
+}
+__sym_compat(SSLv3_client_method, __SSLv3_client_method_fbsd12, OPENSSL_1_1_0);
+
+const SSL_METHOD *
+__SSLv3_server_method_fbsd12(void)
+{
+ __SSLv3_dummy_method_impl();
+ return (NULL);
+}
+__sym_compat(SSLv3_server_method, __SSLv3_server_method_fbsd12, OPENSSL_1_1_0);