diff options
| author | jsing <> | 2020-01-20 08:39:21 +0000 |
|---|---|---|
| committer | jsing <> | 2020-01-20 08:39:21 +0000 |
| commit | 4964c87c6ff167d81b09c143dff53c224a573ccb (patch) | |
| tree | a99f83fd8ff7de867f80b6db4495ae4033f4de29 /src/lib/libtls/tls.c | |
| parent | c922f562f90fd8af4c232301c5dd947462f80f1e (diff) | |
| download | openbsd-4964c87c6ff167d81b09c143dff53c224a573ccb.tar.gz openbsd-4964c87c6ff167d81b09c143dff53c224a573ccb.tar.bz2 openbsd-4964c87c6ff167d81b09c143dff53c224a573ccb.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 '')
| -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, |
