diff options
author | 2017-08-10 17:18:38 +0000 | |
---|---|---|
committer | 2017-08-10 17:18:38 +0000 | |
commit | 203d15d2e2a26c100a0f08ed580a0a6f54c9d7ef (patch) | |
tree | af78aa5a0463c1389f3b5f855818956c7eefb18f /lib/libssl/t1_lib.c | |
parent | Add IMSG_SET_RESOLV_CONF and keep the cached contents (diff) | |
download | wireguard-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/t1_lib.c')
-rw-r--r-- | lib/libssl/t1_lib.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/libssl/t1_lib.c b/lib/libssl/t1_lib.c index ea44e7579a8..42fd18fe2d6 100644 --- a/lib/libssl/t1_lib.c +++ b/lib/libssl/t1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_lib.c,v 1.123 2017/08/09 22:24:25 jsing Exp $ */ +/* $OpenBSD: t1_lib.c,v 1.124 2017/08/10 17:18:38 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -611,18 +611,13 @@ tls1_check_ec_tmp_key(SSL *s) EC_KEY *ec = s->cert->ecdh_tmp; uint16_t curve_id; - if (s->cert->ecdh_tmp_auto != 0) { - /* Need a shared curve. */ - if (tls1_get_shared_curve(s) != NID_undef) - return (1); - return (0); - } + /* Need a shared curve. */ + if (tls1_get_shared_curve(s) != NID_undef) + return (1); - if (ec == NULL) { - if (s->cert->ecdh_tmp_cb != NULL) - return (1); + if (ec == NULL) return (0); - } + if (tls1_set_ec_id(&curve_id, NULL, ec) != 1) return (0); |