diff options
author | jsing <> | 2017-08-10 18:18:30 +0000 |
---|---|---|
committer | jsing <> | 2017-08-10 18:18:30 +0000 |
commit | ae58363a3ade3f9016687060c0c4efe3702141f8 (patch) | |
tree | aa634cd28684f262545acd66044eaf7fc4201389 /src/lib/libtls/tls_client.c | |
parent | f6039d62295a1c6b1188b531731d233d196faf0d (diff) | |
download | openbsd-ae58363a3ade3f9016687060c0c4efe3702141f8.tar.gz openbsd-ae58363a3ade3f9016687060c0c4efe3702141f8.tar.bz2 openbsd-ae58363a3ade3f9016687060c0c4efe3702141f8.zip |
Add a tls_config_set_ecdhecurves() function to libtls, which allows the
names of the elliptic curves that may be used during client and server
key exchange to be specified.
This deprecates tls_config_set_ecdhecurve(), which could only be used to
specify a single supported curve.
ok beck@
Diffstat (limited to 'src/lib/libtls/tls_client.c')
-rw-r--r-- | src/lib/libtls/tls_client.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_client.c b/src/lib/libtls/tls_client.c index b92490f25d..c79f462a3a 100644 --- a/src/lib/libtls/tls_client.c +++ b/src/lib/libtls/tls_client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_client.c,v 1.42 2017/05/07 03:27:06 jsing Exp $ */ | 1 | /* $OpenBSD: tls_client.c,v 1.43 2017/08/10 18:18:30 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -198,6 +198,14 @@ tls_connect_common(struct tls *ctx, const char *servername) | |||
198 | if (tls_configure_ssl_verify(ctx, ctx->ssl_ctx, SSL_VERIFY_PEER) == -1) | 198 | if (tls_configure_ssl_verify(ctx, ctx->ssl_ctx, SSL_VERIFY_PEER) == -1) |
199 | goto err; | 199 | goto err; |
200 | 200 | ||
201 | if (ctx->config->ecdhecurves != NULL) { | ||
202 | if (SSL_CTX_set1_groups(ctx->ssl_ctx, ctx->config->ecdhecurves, | ||
203 | ctx->config->ecdhecurves_len) != 1) { | ||
204 | tls_set_errorx(ctx, "failed to set ecdhe curves"); | ||
205 | goto err; | ||
206 | } | ||
207 | } | ||
208 | |||
201 | if (SSL_CTX_set_tlsext_status_cb(ctx->ssl_ctx, tls_ocsp_verify_cb) != 1) { | 209 | if (SSL_CTX_set_tlsext_status_cb(ctx->ssl_ctx, tls_ocsp_verify_cb) != 1) { |
202 | tls_set_errorx(ctx, "ssl OCSP verification setup failure"); | 210 | tls_set_errorx(ctx, "ssl OCSP verification setup failure"); |
203 | goto err; | 211 | goto err; |