summaryrefslogtreecommitdiffstats
path: root/patches/02_fix-undefined-references-with-NO_OLD_TLS-and-NO_SESSION_CACHE.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/02_fix-undefined-references-with-NO_OLD_TLS-and-NO_SESSION_CACHE.patch')
-rw-r--r--patches/02_fix-undefined-references-with-NO_OLD_TLS-and-NO_SESSION_CACHE.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/patches/02_fix-undefined-references-with-NO_OLD_TLS-and-NO_SESSION_CACHE.patch b/patches/02_fix-undefined-references-with-NO_OLD_TLS-and-NO_SESSION_CACHE.patch
new file mode 100644
index 0000000..3ceeadd
--- /dev/null
+++ b/patches/02_fix-undefined-references-with-NO_OLD_TLS-and-NO_SESSION_CACHE.patch
@@ -0,0 +1,51 @@
+From: Patrick McDermott <patrick.mcdermott@libiquity.com>
+Subject: Fix undefined references with NO_OLD_TLS and NO_SESSION_CACHE
+
+diff -Naur src.orig/lib/vtls/wolfssl.c src/lib/vtls/wolfssl.c
+--- src.orig/lib/vtls/wolfssl.c 2021-01-03 03:05:41.990032879 -0500
++++ src/lib/vtls/wolfssl.c 2021-01-03 03:19:00.108983191 -0500
+@@ -265,8 +265,12 @@
+ #endif
+ break;
+ case CURL_SSLVERSION_TLSv1_1:
++#ifndef NO_OLD_TLS
+ req_method = wolfTLSv1_1_client_method();
+ use_sni(TRUE);
++#else
++ failf(data, "wolfSSL does not support TLS 1.1");
++#endif
+ break;
+ case CURL_SSLVERSION_TLSv1_2:
+ req_method = wolfTLSv1_2_client_method();
+@@ -500,6 +504,7 @@
+ }
+ #endif /* OPENSSL_EXTRA */
+
++#ifndef NO_SESSION_CACHE
+ /* Check if there's a cached ID we can/should use here! */
+ if(SSL_SET_OPTION(primary.sessionid)) {
+ void *ssl_sessionid = NULL;
+@@ -520,6 +525,7 @@
+ }
+ Curl_ssl_sessionid_unlock(conn);
+ }
++#endif
+
+ /* pass the raw socket into the SSL layer */
+ if(!wolfSSL_set_fd(backend->handle, (int)sockfd)) {
+@@ -759,6 +765,7 @@
+
+ DEBUGASSERT(ssl_connect_3 == connssl->connecting_state);
+
++#ifndef NO_SESSION_CACHE
+ if(SSL_SET_OPTION(primary.sessionid)) {
+ bool incache;
+ WOLFSSL_SESSION *our_ssl_sessionid;
+@@ -788,6 +795,7 @@
+ }
+ Curl_ssl_sessionid_unlock(conn);
+ }
++#endif
+
+ connssl->connecting_state = ssl_connect_done;
+