DTLS revision.
authorDr. Stephen Henson <steve@openssl.org>
Mon, 11 Mar 2013 15:34:28 +0000 (15:34 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 18 Mar 2013 14:36:43 +0000 (14:36 +0000)
commit173e72e64c6a07ae97660c322396b66215009f33
treeebabc3004e4f306bc89b43376dd13f5f58da9e61
parent80ccc66d7eedb2d06050130c77c482ae1584199a
DTLS revision.

Revise DTLS code. There was a *lot* of code duplication in the
DTLS code that generates records. This makes it harder to maintain and
sometimes a TLS update is omitted by accident from the DTLS code.

Specifically almost all of the record generation functions have code like
this:

some_pointer = buffer + HANDSHAKE_HEADER_LENGTH;
... Record creation stuff ...
set_handshake_header(ssl, SSL_MT_SOMETHING, message_len);

...

write_handshake_message(ssl);

Where the "Record creation stuff" is identical between SSL/TLS and DTLS or
in some cases has very minor differences.

By adding a few fields to SSL3_ENC to include the header length, some flags
and function pointers for handshake header setting and handshake writing the
code can cope with both cases.

Note: although this passes "make test" and some simple DTLS tests there may
be some minor differences in the DTLS code that have to be accounted for.
ssl/d1_both.c
ssl/d1_clnt.c
ssl/d1_lib.c
ssl/d1_srvr.c
ssl/s3_both.c
ssl/s3_clnt.c
ssl/s3_lib.c
ssl/s3_srvr.c
ssl/ssl3.h
ssl/ssl_locl.h
ssl/t1_lib.c