summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2017-08-10 17:18:38 +0000
committerjsing <jsing@openbsd.org>2017-08-10 17:18:38 +0000
commit203d15d2e2a26c100a0f08ed580a0a6f54c9d7ef (patch)
treeaf78aa5a0463c1389f3b5f855818956c7eefb18f /lib/libssl/ssl_lib.c
parentAdd IMSG_SET_RESOLV_CONF and keep the cached contents (diff)
downloadwireguard-openbsd-203d15d2e2a26c100a0f08ed580a0a6f54c9d7ef.tar.xz
wireguard-openbsd-203d15d2e2a26c100a0f08ed580a0a6f54c9d7ef.zip
Clean up the EC key/curve configuration handling.
Over the years OpenSSL grew multiple ways of being able to specify EC keys (and/or curves) for use with ECDH and ECDHE key exchange. You could specify a static EC key (SSL{_CTX,}_set_tmp_ecdh()), use that as a curve and generate ephemeral keys (SSL_OP_SINGLE_ECDH_USE), provide the EC key via a callback that was provided with insufficient information (SSL{_CTX,}_set_tmp_ecdh_cb()) or enable automatic selection and generation of EC keys via SSL{_CTX,}_set_ecdh_auto(). This complexity leads to problems (like ECDHE not being enabled) and potential weird configuration (like being able to do ECDHE without the ephemeral part...). We no longer support ECDH and ECDHE can be disabled by removing ECDHE ciphers from the cipher list. As such, permanently enable automatic EC curve selection and generation, effectively disabling all of the configuration knobs. The only exception is the SSL{_CTX,}_set_tmp_ecdh() functions, which retain part of their previous behaviour by configuring the curve of the given EC key as the only curve being enabled. Everything else becomes a no-op. ok beck@ doug@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index d933acb32d1..bc8b56d3be9 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.162 2017/08/09 22:24:25 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.163 2017/08/10 17:18:38 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -2042,7 +2042,7 @@ void
ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher)
{
int rsa_enc, rsa_sign, dh_tmp, dsa_sign;
- int have_ecc_cert, have_ecdh_tmp;
+ int have_ecc_cert;
unsigned long mask_k, mask_a;
X509 *x = NULL;
CERT_PKEY *cpk;
@@ -2053,9 +2053,6 @@ ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher)
dh_tmp = (c->dh_tmp != NULL || c->dh_tmp_cb != NULL ||
c->dh_tmp_auto != 0);
- have_ecdh_tmp = (c->ecdh_tmp != NULL || c->ecdh_tmp_cb != NULL ||
- c->ecdh_tmp_auto != 0);
-
cpk = &(c->pkeys[SSL_PKEY_RSA_ENC]);
rsa_enc = (cpk->x509 != NULL && cpk->privatekey != NULL);
cpk = &(c->pkeys[SSL_PKEY_RSA_SIGN]);
@@ -2104,8 +2101,7 @@ ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher)
mask_a|=SSL_aECDSA;
}
- if (have_ecdh_tmp)
- mask_k|=SSL_kECDHE;
+ mask_k |= SSL_kECDHE;
c->mask_k = mask_k;
c->mask_a = mask_a;