1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Add space for new DTLS fields in handshake

This commit is contained in:
Manuel Pégourié-Gonnard
2014-02-18 17:40:52 +01:00
committed by Paul Bakker
parent a59543af30
commit ce441b3442
2 changed files with 62 additions and 18 deletions

View File

@ -354,7 +354,7 @@ static int ssl_parse_ticket( ssl_context *ssl,
#if defined(POLARSSL_SSL_SERVER_NAME_INDICATION)
/*
* Wrapper around f_sni, allowing use of ssl_set_own_cert() but
* making it act on ssl->hanshake->sni_key_cert instead.
* making it act on ssl->handshake->sni_key_cert instead.
*/
static int ssl_sni_wrapper( ssl_context *ssl,
const unsigned char* name, size_t len )
@ -1205,6 +1205,19 @@ static int ssl_parse_client_hello( ssl_context *ssl )
ssl->handshake->update_checksum( ssl, buf, n );
/*
* For DTLS, we move data so that is looks like TLS handshake format
*/
#if defined(POLARSSL_SSL_PROTO_DTLS)
if( ssl->transport == SSL_TRANSPORT_DATAGRAM )
{
// TODO: DTLS: actually use the additional fields before removing them!
memmove( buf + 4, buf + 12, n - 12 );
n -= 8;
}
#endif /* POLARSSL_SSL_PROTO_DTLS */
/*
* SSL layer:
* 0 . 0 handshake type