diff options
| author | jsing <> | 2016-07-13 16:30:48 +0000 |
|---|---|---|
| committer | jsing <> | 2016-07-13 16:30:48 +0000 |
| commit | 6356c57c473f626e89cf1f4fd3931ac373f63f4a (patch) | |
| tree | ce799d1782b76aa2c4699344af2f2beb73b7afa3 /src | |
| parent | a5cfa94ce0f389e794315fe3a4349d56f8d089dd (diff) | |
| download | openbsd-6356c57c473f626e89cf1f4fd3931ac373f63f4a.tar.gz openbsd-6356c57c473f626e89cf1f4fd3931ac373f63f4a.tar.bz2 openbsd-6356c57c473f626e89cf1f4fd3931ac373f63f4a.zip | |
Split the existing TLS cipher suite groups into four:
"secure" (TLSv1.2+AEAD+PFS)
"compat" (HIGH:!aNULL)
"legacy" (HIGH:MEDIUM:!aNULL)
"insecure" (ALL:!aNULL:!eNULL)
This allows for flexibility and finer grained control, rather than having
two extremes (an issue raised by Marko Kreen some time ago).
ok beck@ tedu@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls_config.c | 10 | ||||
| -rw-r--r-- | src/lib/libtls/tls_init.3 | 17 | ||||
| -rw-r--r-- | src/lib/libtls/tls_internal.h | 6 |
3 files changed, 22 insertions, 11 deletions
diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c index 6b47eeb8d1..43f06b0063 100644 --- a/src/lib/libtls/tls_config.c +++ b/src/lib/libtls/tls_config.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls_config.c,v 1.21 2016/07/07 14:09:03 jsing Exp $ */ | 1 | /* $OpenBSD: tls_config.c,v 1.22 2016/07/13 16:30:48 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -289,9 +289,13 @@ tls_config_set_ciphers(struct tls_config *config, const char *ciphers) | |||
| 289 | strcasecmp(ciphers, "default") == 0 || | 289 | strcasecmp(ciphers, "default") == 0 || |
| 290 | strcasecmp(ciphers, "secure") == 0) | 290 | strcasecmp(ciphers, "secure") == 0) |
| 291 | ciphers = TLS_CIPHERS_DEFAULT; | 291 | ciphers = TLS_CIPHERS_DEFAULT; |
| 292 | else if (strcasecmp(ciphers, "compat") == 0 || | 292 | else if (strcasecmp(ciphers, "compat") == 0) |
| 293 | strcasecmp(ciphers, "legacy") == 0) | ||
| 294 | ciphers = TLS_CIPHERS_COMPAT; | 293 | ciphers = TLS_CIPHERS_COMPAT; |
| 294 | else if (strcasecmp(ciphers, "legacy") == 0) | ||
| 295 | ciphers = TLS_CIPHERS_LEGACY; | ||
| 296 | else if (strcasecmp(ciphers, "all") == 0 || | ||
| 297 | strcasecmp(ciphers, "insecure") == 0) | ||
| 298 | ciphers = TLS_CIPHERS_ALL; | ||
| 295 | 299 | ||
| 296 | if ((ssl_ctx = SSL_CTX_new(SSLv23_method())) == NULL) { | 300 | if ((ssl_ctx = SSL_CTX_new(SSLv23_method())) == NULL) { |
| 297 | tls_config_set_errorx(config, "out of memory"); | 301 | tls_config_set_errorx(config, "out of memory"); |
diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3 index cd1f00af23..b4c6a7cc3a 100644 --- a/src/lib/libtls/tls_init.3 +++ b/src/lib/libtls/tls_init.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: tls_init.3,v 1.61 2016/05/27 11:25:57 sthen Exp $ | 1 | .\" $OpenBSD: tls_init.3,v 1.62 2016/07/13 16:30:48 jsing Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> | 3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> |
| 4 | .\" | 4 | .\" |
| @@ -14,7 +14,7 @@ | |||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 16 | .\" | 16 | .\" |
| 17 | .Dd $Mdocdate: May 27 2016 $ | 17 | .Dd $Mdocdate: July 13 2016 $ |
| 18 | .Dt TLS_INIT 3 | 18 | .Dt TLS_INIT 3 |
| 19 | .Os | 19 | .Os |
| 20 | .Sh NAME | 20 | .Sh NAME |
| @@ -322,13 +322,18 @@ sets the list of ciphers that may be used. | |||
| 322 | Lists of ciphers are specified by name, and the | 322 | Lists of ciphers are specified by name, and the |
| 323 | permitted names are: | 323 | permitted names are: |
| 324 | .Pp | 324 | .Pp |
| 325 | .Bl -tag -width "default" -offset indent -compact | 325 | .Bl -tag -width "insecure" -offset indent -compact |
| 326 | .It Dv "secure" | 326 | .It Dv "secure" (or alias "default") |
| 327 | .It Dv "default" (an alias for secure) | 327 | .It Dv "compat" |
| 328 | .It Dv "legacy" | 328 | .It Dv "legacy" |
| 329 | .It Dv "compat" (an alias for legacy) | 329 | .It Dv "insecure" (or alias "all") |
| 330 | .El | 330 | .El |
| 331 | .Pp | 331 | .Pp |
| 332 | Alternatively, libssl cipher strings can be specified. | ||
| 333 | See the CIPHERS section of | ||
| 334 | .Xr openssl 1 | ||
| 335 | for further information. | ||
| 336 | .Pp | ||
| 332 | .Em (Client and server) | 337 | .Em (Client and server) |
| 333 | .It | 338 | .It |
| 334 | .Fn tls_config_set_key_file | 339 | .Fn tls_config_set_key_file |
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h index 886ee1151f..6c56e6fb84 100644 --- a/src/lib/libtls/tls_internal.h +++ b/src/lib/libtls/tls_internal.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls_internal.h,v 1.31 2016/07/07 14:09:03 jsing Exp $ */ | 1 | /* $OpenBSD: tls_internal.h,v 1.32 2016/07/13 16:30:48 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> | 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> |
| 4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| @@ -26,8 +26,10 @@ | |||
| 26 | 26 | ||
| 27 | #define _PATH_SSL_CA_FILE "/etc/ssl/cert.pem" | 27 | #define _PATH_SSL_CA_FILE "/etc/ssl/cert.pem" |
| 28 | 28 | ||
| 29 | #define TLS_CIPHERS_COMPAT "ALL:!aNULL:!eNULL" | ||
| 30 | #define TLS_CIPHERS_DEFAULT "TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE" | 29 | #define TLS_CIPHERS_DEFAULT "TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE" |
| 30 | #define TLS_CIPHERS_COMPAT "HIGH:!aNULL" | ||
| 31 | #define TLS_CIPHERS_LEGACY "HIGH:MEDIUM:!aNULL" | ||
| 32 | #define TLS_CIPHERS_ALL "ALL:!aNULL:!eNULL" | ||
| 31 | 33 | ||
| 32 | union tls_addr { | 34 | union tls_addr { |
| 33 | struct in_addr ip4; | 35 | struct in_addr ip4; |
