openssl/ssl
Matt Caswell e3d0dae7cf DTLSv1_listen rewrite
The existing implementation of DTLSv1_listen() is fundamentally flawed. This
function is used in DTLS solutions to listen for new incoming connections
from DTLS clients. A client will send an initial ClientHello. The server
will respond with a HelloVerifyRequest containing a unique cookie. The
client the responds with a second ClientHello - which this time contains the
cookie.

Once the cookie has been verified then DTLSv1_listen() returns to user code,
which is typically expected to continue the handshake with a call to (for
example) SSL_accept().

Whilst listening for incoming ClientHellos, the underlying BIO is usually in
an unconnected state. Therefore ClientHellos can come in from *any* peer.
The arrival of the first ClientHello without the cookie, and the second one
with it, could be interspersed with other intervening messages from
different clients.

The whole purpose of this mechanism is as a defence against DoS attacks. The
idea is to avoid allocating state on the server until the client has
verified that it is capable of receiving messages at the address it claims
to come from. However the existing DTLSv1_listen() implementation completely
fails to do this. It attempts to super-impose itself on the standard state
machine and reuses all of this code. However the standard state machine
expects to operate in a stateful manner with a single client, and this can
cause various problems.

A second more minor issue is that the return codes from this function are
quite confused, with no distinction made between fatal and non-fatal errors.
Most user code treats all errors as non-fatal, and simply retries the call
to DTLSv1_listen().

This commit completely rewrites the implementation of DTLSv1_listen() and
provides a stand alone implementation that does not rely on the existing
state machine. It also provides more consistent return codes.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-09-23 13:53:26 +01:00
..
record DTLSv1_listen rewrite 2015-09-23 13:53:26 +01:00
bio_ssl.c Handle SSL_ERROR_WANT_X509_LOOKUP 2015-09-20 14:19:49 +01:00
d1_both.c DTLSv1_listen rewrite 2015-09-23 13:53:26 +01:00
d1_clnt.c Fix DTLS session ticket renewal 2015-08-26 10:17:49 +01:00
d1_lib.c DTLSv1_listen rewrite 2015-09-23 13:53:26 +01:00
d1_meth.c
d1_msg.c
d1_srtp.c PACKETise ServerHello processing 2015-09-07 10:45:38 +01:00
d1_srvr.c DTLSv1_listen rewrite 2015-09-23 13:53:26 +01:00
install-ssl.com
Makefile make update 2015-09-16 12:40:55 +01:00
packet_locl.h PACKET: simplify 2015-09-22 20:42:18 +02:00
s3_both.c Remove Gost94 signature algorithm. 2015-08-11 18:23:29 -04:00
s3_cbc.c
s3_clnt.c Remove ssl_put_cipher_by_char 2015-09-22 20:34:25 +02:00
s3_enc.c Avoid duplication. 2015-06-23 22:24:09 +01:00
s3_lib.c Add and use OPENSSL_zalloc 2015-09-02 22:05:37 -04:00
s3_msg.c
s3_srvr.c Remove ssl_put_cipher_by_char 2015-09-22 20:34:25 +02:00
ssl_algs.c CCM support. 2015-08-14 06:56:11 +01:00
ssl_asn1.c Enable -Wmissing-variable-declarations and 2015-09-11 04:51:55 +01:00
ssl_cert.c RT4047: Set reference count earlier 2015-09-17 11:58:24 -04:00
ssl_ciph.c Match SUITEB strings at start of cipher list. 2015-09-04 21:17:59 +01:00
ssl_conf.c remove 0 assignments. 2015-09-03 16:26:34 -04:00
ssl_err2.c
ssl_err.c DTLSv1_listen rewrite 2015-09-23 13:53:26 +01:00
ssl_lib.c Remove ssl_put_cipher_by_char 2015-09-22 20:34:25 +02:00
ssl_locl.h DTLSv1_listen rewrite 2015-09-23 13:53:26 +01:00
ssl_rsa.c Fix return values when adding serverinfo fails. 2015-09-16 20:54:51 +02:00
ssl_sess.c remove 0 assignments. 2015-09-03 16:26:34 -04:00
ssl_stat.c
ssl_txt.c
ssl_utst.c
ssl-lib.com
t1_clnt.c
t1_enc.c ccm8 support 2015-08-14 06:56:11 +01:00
t1_ext.c
t1_lib.c Remove PACKET_(get|goto)_bookmark 2015-09-17 18:47:33 +02:00
t1_meth.c
t1_reneg.c PACKETise ServerHello processing 2015-09-07 10:45:38 +01:00
t1_srvr.c
t1_trce.c Add full PSK trace support 2015-07-30 14:43:35 +01:00
tls_srp.c Use single master secret generation function. 2015-06-29 11:47:59 +01:00