summaryrefslogtreecommitdiff
path: root/src/lib/libressl/ressl_server.c
diff options
context:
space:
mode:
authorjsing <>2014-10-03 14:09:09 +0000
committerjsing <>2014-10-03 14:09:09 +0000
commit9f8a5da13b6653b86f949e67554dafa4591353c0 (patch)
tree6cf018dd426c014234a3ebaa517ad35b852e74d5 /src/lib/libressl/ressl_server.c
parentf42035acfafef5f2efe92cd8eef619164f7144f2 (diff)
downloadopenbsd-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_server.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libressl/ressl_server.c b/src/lib/libressl/ressl_server.c
index 33ac8fc33d..1d5ee2a3f9 100644
--- a/src/lib/libressl/ressl_server.c
+++ b/src/lib/libressl/ressl_server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ressl_server.c,v 1.9 2014/09/29 15:31:38 jsing Exp $ */ 1/* $OpenBSD: ressl_server.c,v 1.10 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 *
@@ -62,7 +62,9 @@ ressl_configure_server(struct ressl *ctx)
62 if (ressl_configure_keypair(ctx) != 0) 62 if (ressl_configure_keypair(ctx) != 0)
63 goto err; 63 goto err;
64 64
65 if (ctx->config->ecdhcurve != NID_undef) { 65 if (ctx->config->ecdhcurve == -1) {
66 SSL_CTX_set_ecdh_auto(ctx->ssl_ctx, 1);
67 } else if (ctx->config->ecdhcurve != NID_undef) {
66 if ((ecdh_key = EC_KEY_new_by_curve_name( 68 if ((ecdh_key = EC_KEY_new_by_curve_name(
67 ctx->config->ecdhcurve)) == NULL) { 69 ctx->config->ecdhcurve)) == NULL) {
68 ressl_set_error(ctx, "failed to set ECDH curve"); 70 ressl_set_error(ctx, "failed to set ECDH curve");