diff options
author | miod <> | 2014-08-06 20:11:09 +0000 |
---|---|---|
committer | miod <> | 2014-08-06 20:11:09 +0000 |
commit | 1209021f0eab25b69c67e06ccd1c6673a9afd996 (patch) | |
tree | 38c3aebc373f092c4faf68cf6b7119dcbb0657c2 /src/lib | |
parent | 0678ffa46b351725550d70c2d443a0c9ea5583f0 (diff) | |
download | openbsd-1209021f0eab25b69c67e06ccd1c6673a9afd996.tar.gz openbsd-1209021f0eab25b69c67e06ccd1c6673a9afd996.tar.bz2 openbsd-1209021f0eab25b69c67e06ccd1c6673a9afd996.zip |
Prevent a possible use after free by mimicing the s3_srvr.c fixes contributed by
Adam Langley close to three years ago, which were commited in
https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e7928282d0148af5f28fa3437a625a2006af0214
ok jsing@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libssl/d1_srvr.c | 5 | ||||
-rw-r--r-- | src/lib/libssl/src/ssl/d1_srvr.c | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c index 6f1d436d18..848bc0f0be 100644 --- a/src/lib/libssl/d1_srvr.c +++ b/src/lib/libssl/d1_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_srvr.c,v 1.34 2014/07/28 04:23:12 guenther Exp $ */ | 1 | /* $OpenBSD: d1_srvr.c,v 1.35 2014/08/06 20:11:09 miod Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -1065,7 +1065,6 @@ dtls1_send_server_key_exchange(SSL *s) | |||
1065 | } | 1065 | } |
1066 | 1066 | ||
1067 | if (s->s3->tmp.dh != NULL) { | 1067 | if (s->s3->tmp.dh != NULL) { |
1068 | DH_free(dh); | ||
1069 | SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); | 1068 | SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); |
1070 | goto err; | 1069 | goto err; |
1071 | } | 1070 | } |
@@ -1110,8 +1109,6 @@ dtls1_send_server_key_exchange(SSL *s) | |||
1110 | } | 1109 | } |
1111 | 1110 | ||
1112 | if (s->s3->tmp.ecdh != NULL) { | 1111 | if (s->s3->tmp.ecdh != NULL) { |
1113 | EC_KEY_free(s->s3->tmp.ecdh); | ||
1114 | |||
1115 | SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); | 1112 | SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); |
1116 | goto err; | 1113 | goto err; |
1117 | } | 1114 | } |
diff --git a/src/lib/libssl/src/ssl/d1_srvr.c b/src/lib/libssl/src/ssl/d1_srvr.c index 6f1d436d18..848bc0f0be 100644 --- a/src/lib/libssl/src/ssl/d1_srvr.c +++ b/src/lib/libssl/src/ssl/d1_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_srvr.c,v 1.34 2014/07/28 04:23:12 guenther Exp $ */ | 1 | /* $OpenBSD: d1_srvr.c,v 1.35 2014/08/06 20:11:09 miod Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -1065,7 +1065,6 @@ dtls1_send_server_key_exchange(SSL *s) | |||
1065 | } | 1065 | } |
1066 | 1066 | ||
1067 | if (s->s3->tmp.dh != NULL) { | 1067 | if (s->s3->tmp.dh != NULL) { |
1068 | DH_free(dh); | ||
1069 | SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); | 1068 | SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); |
1070 | goto err; | 1069 | goto err; |
1071 | } | 1070 | } |
@@ -1110,8 +1109,6 @@ dtls1_send_server_key_exchange(SSL *s) | |||
1110 | } | 1109 | } |
1111 | 1110 | ||
1112 | if (s->s3->tmp.ecdh != NULL) { | 1111 | if (s->s3->tmp.ecdh != NULL) { |
1113 | EC_KEY_free(s->s3->tmp.ecdh); | ||
1114 | |||
1115 | SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); | 1112 | SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); |
1116 | goto err; | 1113 | goto err; |
1117 | } | 1114 | } |