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
commitfc839d9230234d61b47127e0e8f7aa65b0b4fbf1 (patch)
tree6cf018dd426c014234a3ebaa517ad35b852e74d5 /src/lib/libressl/ressl_server.c
parent00aab6e9fe0cafba69f2b8ba7716f378e303cf92 (diff)
downloadopenbsd-fc839d9230234d61b47127e0e8f7aa65b0b4fbf1.tar.gz
openbsd-fc839d9230234d61b47127e0e8f7aa65b0b4fbf1.tar.bz2
openbsd-fc839d9230234d61b47127e0e8f7aa65b0b4fbf1.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 'src/lib/libressl/ressl_server.c')
-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");