diff options
author | jsing <> | 2020-01-20 08:39:21 +0000 |
---|---|---|
committer | jsing <> | 2020-01-20 08:39:21 +0000 |
commit | 9ea343cf6ccda35b4aa4c4e74dd80b7a59029076 (patch) | |
tree | a99f83fd8ff7de867f80b6db4495ae4033f4de29 /src/lib/libtls/tls.c | |
parent | 30f0a4c063ba95ea915d4ead9ad0ea6630bf5271 (diff) | |
download | openbsd-9ea343cf6ccda35b4aa4c4e74dd80b7a59029076.tar.gz openbsd-9ea343cf6ccda35b4aa4c4e74dd80b7a59029076.tar.bz2 openbsd-9ea343cf6ccda35b4aa4c4e74dd80b7a59029076.zip |
Add support for TLSv1.3 as a protocol to libtls.
This makes tls_config_parse_protocols() recognise and handle "tlsv1.3".
If TLSv1.3 is enabled libtls will also request libssl to enable it.
ok beck@ tb@
Diffstat (limited to 'src/lib/libtls/tls.c')
-rw-r--r-- | src/lib/libtls/tls.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.c b/src/lib/libtls/tls.c index 46ed8180d1..1931f4838a 100644 --- a/src/lib/libtls/tls.c +++ b/src/lib/libtls/tls.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls.c,v 1.83 2019/04/01 15:58:02 jsing Exp $ */ | 1 | /* $OpenBSD: tls.c,v 1.84 2020/01/20 08:39:21 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -414,6 +414,7 @@ tls_configure_ssl(struct tls *ctx, SSL_CTX *ssl_ctx) | |||
414 | SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1); | 414 | SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1); |
415 | SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1_1); | 415 | SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1_1); |
416 | SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1_2); | 416 | SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1_2); |
417 | SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1_3); | ||
417 | 418 | ||
418 | if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_0) == 0) | 419 | if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_0) == 0) |
419 | SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1); | 420 | SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1); |
@@ -421,6 +422,8 @@ tls_configure_ssl(struct tls *ctx, SSL_CTX *ssl_ctx) | |||
421 | SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_1); | 422 | SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_1); |
422 | if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_2) == 0) | 423 | if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_2) == 0) |
423 | SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_2); | 424 | SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_2); |
425 | if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_3) == 0) | ||
426 | SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_3); | ||
424 | 427 | ||
425 | if (ctx->config->alpn != NULL) { | 428 | if (ctx->config->alpn != NULL) { |
426 | if (SSL_CTX_set_alpn_protos(ssl_ctx, ctx->config->alpn, | 429 | if (SSL_CTX_set_alpn_protos(ssl_ctx, ctx->config->alpn, |