diff options
author | jsing <> | 2014-06-05 17:53:02 +0000 |
---|---|---|
committer | jsing <> | 2014-06-05 17:53:02 +0000 |
commit | cdf40bdf9747645f289603813ca763593348e29f (patch) | |
tree | 06d57d828b0009bb27455976f2a0022cd2402ce8 /src/lib/libssl/d1_both.c | |
parent | e6aea325b431722badc843e83c34e3213006d354 (diff) | |
download | openbsd-cdf40bdf9747645f289603813ca763593348e29f.tar.gz openbsd-cdf40bdf9747645f289603813ca763593348e29f.tar.bz2 openbsd-cdf40bdf9747645f289603813ca763593348e29f.zip |
Do not recurse when a 'Hello Request' message is received while getting
DTLS fragments. A stream of 'Hello Request' messages will result in
infinite recursion, eventually crashing the DTLS client or server.
Fixes CVE-2014-0221, from OpenSSL.
Reported to OpenSSL by Imre Rad.
Diffstat (limited to 'src/lib/libssl/d1_both.c')
-rw-r--r-- | src/lib/libssl/d1_both.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c index 3674ed6046..6625055645 100644 --- a/src/lib/libssl/d1_both.c +++ b/src/lib/libssl/d1_both.c | |||
@@ -743,6 +743,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) | |||
743 | int i, al; | 743 | int i, al; |
744 | struct hm_header_st msg_hdr; | 744 | struct hm_header_st msg_hdr; |
745 | 745 | ||
746 | again: | ||
746 | /* see if we have the required fragment already */ | 747 | /* see if we have the required fragment already */ |
747 | if ((frag_len = dtls1_retrieve_buffered_fragment(s, max, ok)) || *ok) { | 748 | if ((frag_len = dtls1_retrieve_buffered_fragment(s, max, ok)) || *ok) { |
748 | if (*ok) | 749 | if (*ok) |
@@ -801,7 +802,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) | |||
801 | s->msg_callback_arg); | 802 | s->msg_callback_arg); |
802 | 803 | ||
803 | s->init_num = 0; | 804 | s->init_num = 0; |
804 | return dtls1_get_message_fragment(s, st1, stn, max, ok); | 805 | goto again; |
805 | } | 806 | } |
806 | else /* Incorrectly formated Hello request */ | 807 | else /* Incorrectly formated Hello request */ |
807 | { | 808 | { |