summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-09-27 11:03:43 +0000
committerjsing <jsing@openbsd.org>2014-09-27 11:03:43 +0000
commit95e704fbdd81ede63a0954b1d9006be573918cd9 (patch)
tree25b992bfebca2254cde52f55401d488296ffd993 /lib/libssl/src
parentCheck that the specified curve is one of the client preferences. (diff)
downloadwireguard-openbsd-95e704fbdd81ede63a0954b1d9006be573918cd9.tar.xz
wireguard-openbsd-95e704fbdd81ede63a0954b1d9006be573918cd9.zip
There is not much point checking ecdhp is not NULL... twice.
ok miod@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/ssl/d1_srvr.c8
-rw-r--r--lib/libssl/src/ssl/s3_srvr.c11
2 files changed, 5 insertions, 14 deletions
diff --git a/lib/libssl/src/ssl/d1_srvr.c b/lib/libssl/src/ssl/d1_srvr.c
index 051d1e1ccf6..68441fa63a4 100644
--- a/lib/libssl/src/ssl/d1_srvr.c
+++ b/lib/libssl/src/ssl/d1_srvr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_srvr.c,v 1.38 2014/09/07 12:16:23 jsing Exp $ */
+/* $OpenBSD: d1_srvr.c,v 1.39 2014/09/27 11:03:43 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -1109,16 +1109,12 @@ dtls1_send_server_key_exchange(SSL *s)
}
/* Duplicate the ECDH structure. */
- if (ecdhp == NULL) {
- SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_ECDH_LIB);
- goto err;
- }
if ((ecdh = EC_KEY_dup(ecdhp)) == NULL) {
SSLerr(SSL_F_DTLS1_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)) {
diff --git a/lib/libssl/src/ssl/s3_srvr.c b/lib/libssl/src/ssl/s3_srvr.c
index 18663c6ee3b..cba875a3e69 100644
--- a/lib/libssl/src/ssl/s3_srvr.c
+++ b/lib/libssl/src/ssl/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)) {