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.
(cherry picked from commit 173e72e64c)
This commit is contained in:
@@ -251,6 +251,8 @@ extern "C" {
|
||||
#define SSL3_SESSION_ID_SIZE 32
|
||||
#define SSL3_RT_HEADER_LENGTH 5
|
||||
|
||||
#define SSL3_HM_HEADER_LENGTH 4
|
||||
|
||||
#ifndef SSL3_ALIGN_PAYLOAD
|
||||
/* Some will argue that this increases memory footprint, but it's
|
||||
* not actually true. Point is that malloc has to return at least
|
||||
|
||||
Reference in New Issue
Block a user