boringssl/include/openssl
David Benjamin 13e81fc971 Fix DTLS asynchronous write handling.
Although the DTLS transport layer logic drops failed writes on the floor, it is
actually set up to work correctly. If an SSL_write fails at the transport,
dropping the buffer is fine. Arguably it works better than in TLS because we
don't have the weird "half-committed to data" behavior. Likewise, the handshake
keeps track of how far its gotten and resumes the message at the right point.

This broke when the buffering logic was rewritten because I didn't understand
what the DTLS code was doing. The one thing that doesn't work as one might
expect is non-fatal write errors during rexmit are not recoverable. The next
timeout must fire before we try again.

This code is quite badly sprinkled in here, so add tests to guard it against
future turbulence. Because of the rexmit issues, the tests need some hacks
around calls which may trigger them. It also changes the Go DTLS implementation
from being completely strict about sequence numbers to only requiring they be
monotonic.

The tests also revealed another bug. This one seems to be upstream's fault, not
mine. The logic to reset the handshake hash on the second ClientHello (in the
HelloVerifyRequest case) was a little overenthusiastic and breaks if the
ClientHello took multiple tries to send.

Change-Id: I9b38b93fff7ae62faf8e36c4beaf848850b3f4b9
Reviewed-on: https://boringssl-review.googlesource.com/6417
Reviewed-by: Adam Langley <agl@google.com>
2015-11-02 23:16:22 +00:00
..
aead.h Fix aead.h header typo. 2015-10-28 17:50:23 +00:00
aes.h Fix documentation typo. 2015-07-01 21:33:29 +00:00
arm_arch.h Allow ARM capabilities to be set at compile time. 2015-10-20 22:40:15 +00:00
asn1_mac.h Ditch remaining filename comments from public headers and ssl/ 2015-10-20 18:40:05 +00:00
asn1.h Ditch remaining filename comments from public headers and ssl/ 2015-10-20 18:40:05 +00:00
asn1t.h Ditch remaining filename comments from public headers and ssl/ 2015-10-20 18:40:05 +00:00
base64.h Deprecate basically the entire base64 implementation. 2015-09-28 21:53:39 +00:00
base.h Deprecate basically the entire base64 implementation. 2015-09-28 21:53:39 +00:00
bio.h Better handle IPv6. 2015-10-26 21:06:01 +00:00
blowfish.h
bn.h Remove BN_MONT_CTX_init. 2015-10-26 19:47:26 +00:00
buf.h Get rid of err function codes. 2015-07-16 02:02:08 +00:00
buffer.h
bytestring.h Convert ssl3_send_client_hello to CBB. 2015-10-20 17:56:19 +00:00
cast.h
chacha.h Change |CRYPTO_chacha_20| to use 96-bit nonces, 32-bit counters. 2015-10-26 23:58:46 +00:00
cipher.h Re-add |EVP_des_ede|, which is ECB. 2015-08-20 21:33:21 +00:00
cmac.h Style: fix some header guards 2015-10-26 18:47:51 +00:00
conf.h Get rid of err function codes. 2015-07-16 02:02:08 +00:00
cpu.h iOS builds use the static ARM CPU configuration. 2015-10-28 17:25:25 +00:00
crypto.h Add no-op functions |CRYPTO_malloc_init| and |ENGINE_load_builtin_engines|. 2015-10-27 16:41:40 +00:00
des.h Fix shared library build on OS X. 2015-10-26 23:39:47 +00:00
dh.h Fix pub_key comment in dh.h. 2015-08-17 20:32:51 +00:00
digest.h Documentation typo. 2015-09-28 22:18:40 +00:00
dsa.h Get rid of err function codes. 2015-07-16 02:02:08 +00:00
dtls1.h
ec_key.h Fix o2i_ECPublicKey documentation. 2015-07-20 20:39:43 +00:00
ec.h Change the type of |EC_GROUP_get_degree| and friends to |unsigned|. 2015-10-27 16:48:04 +00:00
ecdh.h Clean up |ECDH_compute_key|. 2015-10-27 17:00:25 +00:00
ecdsa.h Fix several minor points noticed by Kenny. 2015-09-24 22:08:50 +00:00
engine.h
err.h Fix minor documentation mistake. 2015-09-15 23:19:57 +00:00
evp.h Revert "pound-define EVP_R_BAD_DECRYPT CIPHER_R_BAD_DECRYPT." 2015-08-05 12:16:11 -07:00
ex_data.h Correct various documentation typos 2015-06-10 22:06:01 +00:00
hkdf.h Get rid of err function codes. 2015-07-16 02:02:08 +00:00
hmac.h
lhash_macros.h
lhash.h Style: fix some header guards 2015-10-26 18:47:51 +00:00
md4.h Fix some typos in license headers. 2015-07-29 19:23:51 +00:00
md5.h Fix some typos in license headers. 2015-07-29 19:23:51 +00:00
mem.h Fix some typos in license headers. 2015-07-29 19:23:51 +00:00
obj_mac.h
obj.h Style: fix some header guards 2015-10-26 18:47:51 +00:00
objects.h
opensslfeatures.h
opensslv.h
ossl_typ.h
pem.h Get rid of err function codes. 2015-07-16 02:02:08 +00:00
pkcs7.h
pkcs8.h Add |PKCS12_verify_mac|. 2015-09-29 20:30:35 +00:00
pkcs12.h
poly1305.h Fix several minor points noticed by Kenny. 2015-09-24 22:08:50 +00:00
pqueue.h
rand.h Buffer reads of urandom, if you promise no forking. 2015-09-09 01:02:54 +00:00
rc4.h
rsa.h size_t RSA functions. 2015-10-19 23:54:47 +00:00
safestack.h
sha.h
srtp.h Fold srtp.h into ssl.h. 2015-09-14 23:59:37 +00:00
ssl3.h Add server-side support for asynchronous RSA decryption. 2015-10-26 20:26:20 +00:00
ssl.h Fix DTLS asynchronous write handling. 2015-11-02 23:16:22 +00:00
stack_macros.h Implement custom extensions. 2015-07-31 01:12:00 +00:00
stack.h Drop DEFINE_STACK_OF. 2015-08-05 21:30:08 +00:00
thread.h
time_support.h Style: fix some header guards 2015-10-26 18:47:51 +00:00
tls1.h Fix even more ChaCha20 rename deadlocks. 2015-10-28 21:09:46 +00:00
type_check.h
x509_vfy.h Ditch remaining filename comments from public headers and ssl/ 2015-10-20 18:40:05 +00:00
x509.h Ditch remaining filename comments from public headers and ssl/ 2015-10-20 18:40:05 +00:00
x509v3.h Get rid of err function codes. 2015-07-16 02:02:08 +00:00