Skip to content

Instantly share code, notes, and snippets.

@jaykishanmutkawoa
Created March 17, 2018 16:34
Show Gist options
  • Save jaykishanmutkawoa/fa381dc0f2578fa0051b024c3e5f2279 to your computer and use it in GitHub Desktop.
Save jaykishanmutkawoa/fa381dc0f2578fa0051b024c3e5f2279 to your computer and use it in GitHub Desktop.
Socat
root@Socat-TLS-Client:~/tls13_new/socat-1.7.3.2# diff -uNp sslcls.c.orig sslcls.c
--- sslcls.c.orig 2018-03-17 10:47:30.239634794 -0400
+++ sslcls.c 2018-03-17 04:40:53.144981137 -0400
@@ -147,6 +147,26 @@ const SSL_METHOD *sycTLSv1_2_server_meth
}
#endif
+#if HAVE_TLSv1_3_client_method
+const SSL_METHOD *sycTLSv1_3_client_method(void) {
+ const SSL_METHOD *result;
+ Debug("TLSv1_3_client_method()");
+ result = TLSv1_3_client_method();
+ Debug1("TLSv1_3_client_method() -> %p", result);
+ return result;
+}
+#endif
+
+#if HAVE_TLSv1_3_server_method
+const SSL_METHOD *sycTLSv1_3_server_method(void) {
+ const SSL_METHOD *result;
+ Debug("TLSv1_3_server_method()");
+ result = TLSv1_3_server_method();
+ Debug1("TLSv1_3_server_method() -> %p", result);
+ return result;
+}
+#endif
+
#if HAVE_DTLSv1_client_method
const SSL_METHOD *sycDTLSv1_client_method(void) {
const SSL_METHOD *result;
==============================================================================
root@Socat-TLS-Client:~/tls13_new/socat-1.7.3.2# diff -uNp sslcls.h.orig sslcls.h
--- sslcls.h.orig 2018-03-17 10:45:41.508001821 -0400
+++ sslcls.h 2018-03-17 03:18:55.582244832 -0400
@@ -22,6 +22,8 @@ const SSL_METHOD *sycTLSv1_1_client_meth
const SSL_METHOD *sycTLSv1_1_server_method(void);
const SSL_METHOD *sycTLSv1_2_client_method(void);
const SSL_METHOD *sycTLSv1_2_server_method(void);
+const SSL_METHOD *sysTLSv1_3_client_method(void);
+const SSL_METHOD *sysTLSv1_3_server_method(void);
const SSL_METHOD *sycDTLSv1_client_method(void);
const SSL_METHOD *sycDTLSv1_server_method(void);
SSL_CTX *sycSSL_CTX_new(const SSL_METHOD *method);
@@ -81,6 +83,8 @@ const char *sycSSL_COMP_get_name(const C
#define sycTLSv1_1_server_method() TLSv1_1_server_method()
#define sycTLSv1_2_client_method() TLSv1_2_client_method()
#define sycTLSv1_2_server_method() TLSv1_2_server_method()
+#define sysTLSv1_3_client_method() TLSv1_3_client_method()
+#define sysTLSv1_3_server_method() TLSv1_3_server_method()
#define sycDTLSv1_client_method() DTLSv1_client_method()
#define sycDTLSv1_server_method() DTLSv1_server_method()
#define sycSSL_CTX_new(m) SSL_CTX_new(m)
======================================================================
root@Socat-TLS-Client:~/tls13_new/socat-1.7.3.2# diff -uNp xio-openssl.c.orig xio-openssl.c
--- xio-openssl.c.orig 2018-03-17 10:39:43.564229949 -0400
+++ xio-openssl.c 2018-03-17 04:57:54.046430711 -0400
@@ -798,6 +798,10 @@ int
} else if (!strcasecmp(me_str, "TLS1.2")) {
method = sycTLSv1_2_client_method();
#endif
+#if HAVE_TLSv1_3_client_method
+ } else if (!strcasecmp(me_str, "TLS1.3")) {
+ method = sycTLSv1_3_client_method();
+#endif
#if HAVE_DTLSv1_client_method
} else if (!strcasecmp(me_str, "DTLS") || !strcasecmp(me_str, "DTLS1")) {
method = sycDTLSv1_client_method();
@@ -808,7 +812,9 @@ int
} else {
#if HAVE_SSLv23_client_method
method = sycSSLv23_client_method();
-#elif HAVE_TLSv1_2_client_method
+#elif HAVE_TLSv1_3_client_method
+ method = sycTLSv1_3_client_method();
+#elif HAVE_TLSv1_2_client_method
method = sycTLSv1_2_client_method();
#elif HAVE_TLSv1_1_client_method
method = sycTLSv1_1_client_method();
@@ -851,6 +857,10 @@ int
} else if (!strcasecmp(me_str, "TLS1.2")) {
method = sycTLSv1_2_server_method();
#endif
+#if HAVE_TLSv1_3_server_method
+ } else if (!strcasecmp(me_str, "TLS1.3")) {
+ method = sycTLSv1_3_server_method();
+#endif
#if HAVE_DTLSv1_server_method
} else if (!strcasecmp(me_str, "DTLS") || !strcasecmp(me_str, "DTLS1")) {
method = sycDTLSv1_server_method();
@@ -861,6 +871,8 @@ int
} else {
#if HAVE_SSLv23_server_method
method = sycSSLv23_server_method();
+#elif HAVE_TLSv1_3_server_method
+ method = sycTLSv1_3_server_method();
#elif HAVE_TLSv1_2_server_method
method = sycTLSv1_2_server_method();
#elif HAVE_TLSv1_1_server_method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment