summaryrefslogtreecommitdiff
path: root/ssl/statem
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2016-01-18 13:10:21 -0500
committerViktor Dukhovni <openssl-users@dukhovni.org>2016-01-19 09:57:15 -0500
commit6b01bed206156dbcb1ab150f618c8b24c01fb0d0 (patch)
tree667ea072f731ab8904a121f5b57adb01e40df4af /ssl/statem
parent6ada465fb258ae2c29668c59f3ec9b69dc38f8b3 (diff)
downloadopenssl-new-6b01bed206156dbcb1ab150f618c8b24c01fb0d0.tar.gz
Support disabling any or all TLS or DTLS versions
Some users want to disable SSL 3.0/TLS 1.0/TLS 1.1, and enable just TLS 1.2. In the future they might want to disable TLS 1.2 and enable just TLS 1.3, ... This commit makes it possible to disable any or all of the TLS or DTLS protocols. It also considerably simplifies the SSL/TLS tests, by auto-generating the min/max version tests based on the set of supported protocols (425 explicitly written out tests got replaced by two loops that generate all 425 tests if all protocols are enabled, fewer otherwise). Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/statem')
-rw-r--r--ssl/statem/statem_lib.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c
index 7142128fd7..984df19b58 100644
--- a/ssl/statem/statem_lib.c
+++ b/ssl/statem/statem_lib.c
@@ -727,11 +727,25 @@ typedef struct {
#endif
static const version_info tls_version_table[] = {
+#ifndef OPENSSL_NO_TLS1_2
{ TLS1_2_VERSION, TLSv1_2_client_method, TLSv1_2_server_method },
+#else
+ { TLS1_2_VERSION, NULL, NULL },
+#endif
+#ifndef OPENSSL_NO_TLS1_1
{ TLS1_1_VERSION, TLSv1_1_client_method, TLSv1_1_server_method },
+#else
+ { TLS1_1_VERSION, NULL, NULL },
+#endif
+#ifndef OPENSSL_NO_TLS1
{ TLS1_VERSION, TLSv1_client_method, TLSv1_server_method },
+#else
+ { TLS1_VERSION, NULL, NULL },
+#endif
#ifndef OPENSSL_NO_SSL3
{ SSL3_VERSION, SSLv3_client_method, SSLv3_server_method },
+#else
+ { SSL3_VERSION, NULL, NULL },
#endif
{ 0, NULL, NULL },
};
@@ -741,8 +755,16 @@ static const version_info tls_version_table[] = {
#endif
static const version_info dtls_version_table[] = {
+#ifndef OPENSSL_NO_DTLS1_2
{ DTLS1_2_VERSION, DTLSv1_2_client_method, DTLSv1_2_server_method },
+#else
+ { DTLS1_2_VERSION, NULL, NULL },
+#endif
+#ifndef OPENSSL_NO_DTLS1
{ DTLS1_VERSION, DTLSv1_client_method, DTLSv1_server_method },
+#else
+ { DTLS1_VERSION, NULL, NULL },
+#endif
{ 0, NULL, NULL },
};