diff options
author | Matt Caswell <matt@openssl.org> | 2014-07-25 02:54:28 +0400 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-08-08 01:09:21 +0400 |
commit | e24f686e31e40013f7222e745facd9f18e56f4de (patch) | |
tree | 10023d6b0ee7da1b67e96fba64e48ee35697fef5 /ssl/d1_both.c | |
parent | 8506609ca38110eeda86d40416de7ebf3e6f9035 (diff) |
Same fix as in dtls1_process_out_of_seq_message.
Applying same fix as in dtls1_process_out_of_seq_message. A truncated
DTLS fragment would cause *ok to be clear, but the return value would
still be the number of bytes read.
Problem identified by Emilia Käsper, based on previous issue/patch by Adam
Langley.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Imported from upstream's 3d5dceac430d7b9b273331931d4d2303f5a2256f)
Change-Id: Ibe30716266e2ee1489c98b922cf53edda096c23c
Reviewed-on: https://boringssl-review.googlesource.com/1437
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/d1_both.c')
-rw-r--r-- | ssl/d1_both.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c index a5a7aeb5..2430a7ca 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -670,7 +670,9 @@ dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok) /* read the body of the fragment (header has already been read */ i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE, frag->fragment + msg_hdr->frag_off,frag_len,0); - if (i<=0 || (unsigned long)i!=frag_len) + if ((unsigned long)i!=frag_len) + i=-1; + if (i<=0) goto err; RSMBLY_BITMASK_MARK(frag->reassembly, (long)msg_hdr->frag_off, |