Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@imperialviolet.org>2014-06-07 01:44:20 +0400
committerAdam Langley <agl@google.com>2014-08-08 01:09:12 +0400
commit8506609ca38110eeda86d40416de7ebf3e6f9035 (patch)
treed813a43a1add0d6f51e27ea025927adbb987a171 /ssl/d1_both.c
parente951ff4fc3fe9582561f7f25ad793ab7e23da785 (diff)
Fix return code for truncated DTLS fragment.
Previously, a truncated DTLS fragment in |dtls1_process_out_of_seq_message| would cause *ok to be cleared, but the return value would still be the number of bytes read. This would cause |dtls1_get_message| not to consider it an error and it would continue processing as normal until the calling function noticed that *ok was zero. I can't see an exploit here because |dtls1_get_message| uses |s->init_num| as the length, which will always be zero from what I can see. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> (Imported from upstream's aad61c0a57a3b6371496034db61675abcdb81811.) Change-Id: I2fb0ea93b6e812e19723ada3351f842cc7b2fa91 Reviewed-on: https://boringssl-review.googlesource.com/1436 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/d1_both.c')
-rw-r--r--ssl/d1_both.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index e2fb70cb..a5a7aeb5 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -778,7 +778,9 @@ dtls1_process_out_of_seq_message(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,frag_len,0);
- if (i<=0 || (unsigned long)i!=frag_len)
+ if ((unsigned long)i!=frag_len)
+ i = -1;
+ if (i<=0)
goto err;
}