16285ea800
This fixes a number of bugs with the original logic: - If handshake messages are fragmented and writes need to be retried, frag_off gets completely confused. - The BIO_flush call didn't set rwstate, so it wasn't resumable at that point. - The msg_callback call gets garbage because the fragment header would get scribbled over the handshake buffer. The original logic was also extremely confusing with how it handles init_off. (init_off gets rewound to make room for the fragment header. Depending on where you pause, resuming may or may not have already been rewound.) For simplicity, just allocate a new buffer to assemble the fragment in and avoid clobbering the old one. I don't think it's worth the complexity to optimize that. If we want to optimize this sort of thing, not clobbering seems better anyway because the message may need to be retransmitted. We could avoid doing a copy when buffering the outgoing message for retransmission later. We do still need to track how far we are in sending the current message via init_off, so I haven't opted to disconnect this function from init_{buf,off,num} yet. Test the fix to the retry + fragment case by having the splitHandshake option to the state machine tests, in DTLS, also clamp the MTU to force handshake fragmentation. Change-Id: I66f634d6c752ea63649db8ed2f898f9cc2b13908 Reviewed-on: https://boringssl-review.googlesource.com/6421 Reviewed-by: Adam Langley <agl@google.com> |
||
---|---|---|
.. | ||
pqueue | ||
test | ||
CMakeLists.txt | ||
custom_extensions.c | ||
d1_both.c | ||
d1_clnt.c | ||
d1_lib.c | ||
d1_meth.c | ||
d1_pkt.c | ||
d1_srtp.c | ||
d1_srvr.c | ||
dtls_record.c | ||
internal.h | ||
s3_both.c | ||
s3_clnt.c | ||
s3_enc.c | ||
s3_lib.c | ||
s3_meth.c | ||
s3_pkt.c | ||
s3_srvr.c | ||
ssl_aead_ctx.c | ||
ssl_asn1.c | ||
ssl_buffer.c | ||
ssl_cert.c | ||
ssl_cipher.c | ||
ssl_file.c | ||
ssl_lib.c | ||
ssl_rsa.c | ||
ssl_session.c | ||
ssl_stat.c | ||
ssl_test.cc | ||
t1_enc.c | ||
t1_lib.c | ||
tls_record.c |