diff options
Diffstat (limited to 'src/lib/libtls/tls_config.c')
-rw-r--r-- | src/lib/libtls/tls_config.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c index bec7afcb1b..80242861c7 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.6 2015/02/12 04:35:17 jsing Exp $ */ | 1 | /* $OpenBSD: tls_config.c,v 1.7 2015/02/22 14:50:41 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -74,6 +74,10 @@ tls_config_new(void) | |||
74 | } | 74 | } |
75 | tls_config_set_dheparams(config, "none"); | 75 | tls_config_set_dheparams(config, "none"); |
76 | tls_config_set_ecdhecurve(config, "auto"); | 76 | tls_config_set_ecdhecurve(config, "auto"); |
77 | if (tls_config_set_ciphers(config, "secure") != 0) { | ||
78 | tls_config_free(config); | ||
79 | return (NULL); | ||
80 | } | ||
77 | tls_config_set_protocols(config, TLS_PROTOCOLS_DEFAULT); | 81 | tls_config_set_protocols(config, TLS_PROTOCOLS_DEFAULT); |
78 | tls_config_set_verify_depth(config, 6); | 82 | tls_config_set_verify_depth(config, 6); |
79 | 83 | ||
@@ -201,6 +205,14 @@ tls_config_set_cert_mem(struct tls_config *config, const uint8_t *cert, | |||
201 | int | 205 | int |
202 | tls_config_set_ciphers(struct tls_config *config, const char *ciphers) | 206 | tls_config_set_ciphers(struct tls_config *config, const char *ciphers) |
203 | { | 207 | { |
208 | if (ciphers == NULL || | ||
209 | strcasecmp(ciphers, "default") == 0 || | ||
210 | strcasecmp(ciphers, "secure") == 0) | ||
211 | ciphers = TLS_CIPHERS_DEFAULT; | ||
212 | else if (strcasecmp(ciphers, "compat") == 0 || | ||
213 | strcasecmp(ciphers, "legacy") == 0) | ||
214 | ciphers = TLS_CIPHERS_COMPAT; | ||
215 | |||
204 | return set_string(&config->ciphers, ciphers); | 216 | return set_string(&config->ciphers, ciphers); |
205 | } | 217 | } |
206 | 218 | ||