Add explicit counter in DTLS record header

This commit is contained in:
Manuel Pégourié-Gonnard 2014-02-14 08:39:32 +01:00 committed by Paul Bakker
parent 507e1e410a
commit 0619348288
3 changed files with 86 additions and 52 deletions

View file

@ -1827,6 +1827,15 @@ void ssl_write_version( int major, int minor, int transport,
void ssl_read_version( int *major, int *minor, int transport,
const unsigned char ver[2] );
static inline size_t ssl_hdr_len( const ssl_context *ssl )
{
#if defined(POLARSSL_SSL_PROTO_DTLS)
if( ssl->transport == SSL_TRANSPORT_DATAGRAM )
return( 13 );
#endif
return( 5 );
}
/* constant-time buffer comparison */
static inline int safer_memcmp( const void *a, const void *b, size_t n )
{