diff options
author | jsing <> | 2014-10-03 14:09:09 +0000 |
---|---|---|
committer | jsing <> | 2014-10-03 14:09:09 +0000 |
commit | 9f8a5da13b6653b86f949e67554dafa4591353c0 (patch) | |
tree | 6cf018dd426c014234a3ebaa517ad35b852e74d5 /src/lib/libressl/ressl_config.c | |
parent | f42035acfafef5f2efe92cd8eef619164f7144f2 (diff) | |
download | openbsd-9f8a5da13b6653b86f949e67554dafa4591353c0.tar.gz openbsd-9f8a5da13b6653b86f949e67554dafa4591353c0.tar.bz2 openbsd-9f8a5da13b6653b86f949e67554dafa4591353c0.zip |
Allow "auto" to be specified as an ECDH curve name and make this the
default. This enables automatic handling of ephemeral EC keys.
Discussed with reyk@ and tedu@
Diffstat (limited to '')
-rw-r--r-- | src/lib/libressl/ressl_config.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/libressl/ressl_config.c b/src/lib/libressl/ressl_config.c index c92886330e..6d535e2b42 100644 --- a/src/lib/libressl/ressl_config.c +++ b/src/lib/libressl/ressl_config.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ressl_config.c,v 1.12 2014/09/29 15:11:29 jsing Exp $ */ | 1 | /* $OpenBSD: ressl_config.c,v 1.13 2014/10/03 14:09:09 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -71,10 +71,9 @@ ressl_config_new(void) | |||
71 | ressl_config_free(config); | 71 | ressl_config_free(config); |
72 | return (NULL); | 72 | return (NULL); |
73 | } | 73 | } |
74 | ressl_config_set_ecdhcurve(config, "auto"); | ||
74 | ressl_config_set_protocols(config, RESSL_PROTOCOLS_DEFAULT); | 75 | ressl_config_set_protocols(config, RESSL_PROTOCOLS_DEFAULT); |
75 | ressl_config_set_verify_depth(config, 6); | 76 | ressl_config_set_verify_depth(config, 6); |
76 | /* ? use function ? */ | ||
77 | config->ecdhcurve = NID_X9_62_prime256v1; | ||
78 | 77 | ||
79 | ressl_config_verify(config); | 78 | ressl_config_verify(config); |
80 | 79 | ||
@@ -141,12 +140,17 @@ ressl_config_set_ciphers(struct ressl_config *config, const char *ciphers) | |||
141 | int | 140 | int |
142 | ressl_config_set_ecdhcurve(struct ressl_config *config, const char *name) | 141 | ressl_config_set_ecdhcurve(struct ressl_config *config, const char *name) |
143 | { | 142 | { |
144 | int nid = NID_undef; | 143 | int nid; |
145 | 144 | ||
146 | if (name != NULL && (nid = OBJ_txt2nid(name)) == NID_undef) | 145 | if (name == NULL) |
146 | nid = NID_undef; | ||
147 | else if (strcasecmp(name, "auto") == 0) | ||
148 | nid = -1; | ||
149 | else if ((nid = OBJ_txt2nid(name)) == NID_undef) | ||
147 | return (-1); | 150 | return (-1); |
148 | 151 | ||
149 | config->ecdhcurve = nid; | 152 | config->ecdhcurve = nid; |
153 | |||
150 | return (0); | 154 | return (0); |
151 | } | 155 | } |
152 | 156 | ||