Skip to content

Commit

Permalink
Applying same fix as in dtls1_process_out_of_seq_message. A truncated…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
mattcaswell committed Aug 6, 2014
1 parent aad61c0 commit 3d5dcea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ssl/d1_both.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,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,
Expand Down

0 comments on commit 3d5dcea

Please sign in to comment.