summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-10-22 15:29:31 +0000
committerjsing <jsing@openbsd.org>2014-10-22 15:29:31 +0000
commitbb69e32a1b07094cd9835b477885b495ba6354d7 (patch)
tree2614e0b235c05f01ae2e2c9ac33d8578708ebba5 /lib
parent#undef LIBRESSL_INTERNAL for the RAND_pseudo_bytes() test. (diff)
downloadwireguard-openbsd-bb69e32a1b07094cd9835b477885b495ba6354d7.tar.xz
wireguard-openbsd-bb69e32a1b07094cd9835b477885b495ba6354d7.zip
Avoid a NULL pointer dereference that can be triggered by
SSL3_RT_HANDSHAKE replays. Reported by Markus Stenberg <markus.stenberg at iki.fi> - thanks! ok deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/d1_pkt.c4
-rw-r--r--lib/libssl/src/ssl/d1_pkt.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libssl/d1_pkt.c b/lib/libssl/d1_pkt.c
index 6f3ee262175..7aa5aac7523 100644
--- a/lib/libssl/d1_pkt.c
+++ b/lib/libssl/d1_pkt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_pkt.c,v 1.35 2014/10/18 16:13:16 jsing Exp $ */
+/* $OpenBSD: d1_pkt.c,v 1.36 2014/10/22 15:29:31 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -586,7 +586,7 @@ again:
* would be dropped unnecessarily.
*/
if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE &&
- *p == SSL3_MT_CLIENT_HELLO) &&
+ p != NULL && *p == SSL3_MT_CLIENT_HELLO) &&
!dtls1_record_replay_check(s, bitmap)) {
rr->length = 0;
s->packet_length=0; /* dump this record */
diff --git a/lib/libssl/src/ssl/d1_pkt.c b/lib/libssl/src/ssl/d1_pkt.c
index 6f3ee262175..7aa5aac7523 100644
--- a/lib/libssl/src/ssl/d1_pkt.c
+++ b/lib/libssl/src/ssl/d1_pkt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_pkt.c,v 1.35 2014/10/18 16:13:16 jsing Exp $ */
+/* $OpenBSD: d1_pkt.c,v 1.36 2014/10/22 15:29:31 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -586,7 +586,7 @@ again:
* would be dropped unnecessarily.
*/
if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE &&
- *p == SSL3_MT_CLIENT_HELLO) &&
+ p != NULL && *p == SSL3_MT_CLIENT_HELLO) &&
!dtls1_record_replay_check(s, bitmap)) {
rr->length = 0;
s->packet_length=0; /* dump this record */