From 7f0d86e56a07e6231d5e17e51ff5df4387001c7c Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 27 Sep 2014 11:03:43 +0000 Subject: There is not much point checking ecdhp is not NULL... twice. ok miod@ --- src/lib/libssl/s3_srvr.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/lib/libssl/s3_srvr.c') diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c index 18663c6ee3..cba875a3e6 100644 --- a/src/lib/libssl/s3_srvr.c +++ b/src/lib/libssl/s3_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_srvr.c,v 1.84 2014/09/19 14:32:24 tedu Exp $ */ +/* $OpenBSD: s3_srvr.c,v 1.85 2014/09/27 11:03:43 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1436,8 +1436,8 @@ ssl3_send_server_key_exchange(SSL *s) ERR_R_DH_LIB); goto err; } - s->s3->tmp.dh = dh; + if ((dhp->pub_key == NULL || dhp->priv_key == NULL || (s->options & SSL_OP_SINGLE_DH_USE))) { if (!DH_generate_key(dh)) { @@ -1482,18 +1482,13 @@ ssl3_send_server_key_exchange(SSL *s) } /* Duplicate the ECDH structure. */ - if (ecdhp == NULL) { - SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, - ERR_R_ECDH_LIB); - goto err; - } if ((ecdh = EC_KEY_dup(ecdhp)) == NULL) { SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_ECDH_LIB); goto err; } - s->s3->tmp.ecdh = ecdh; + if ((EC_KEY_get0_public_key(ecdh) == NULL) || (EC_KEY_get0_private_key(ecdh) == NULL) || (s->options & SSL_OP_SINGLE_ECDH_USE)) { -- cgit v1.2.3-55-g6feb