Fix return code for truncated DTLS fragment.
authorAdam Langley <agl@imperialviolet.org>
Fri, 6 Jun 2014 21:44:20 +0000 (14:44 -0700)
committerMatt Caswell <matt@openssl.org>
Wed, 6 Aug 2014 19:41:23 +0000 (20:41 +0100)
commitaad61c0a57a3b6371496034db61675abcdb81811
tree7a93f9e035fa080944047e72dd49ab36f8a58217
parent8ca4c4b25e050b881f3aad7017052842b888722d
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>
ssl/d1_both.c