Re-implement mbedtls_ssl_{in/out}_hdr_len() via in/out pointers

This commit is contained in:
Hanno Becker 2019-05-03 15:05:27 +01:00
parent 4339576208
commit ccc2456db9

View file

@ -877,28 +877,12 @@ void mbedtls_ssl_read_version( int *major, int *minor, int transport,
static inline size_t mbedtls_ssl_in_hdr_len( const mbedtls_ssl_context *ssl )
{
#if defined(MBEDTLS_SSL_PROTO_DTLS)
if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM )
{
return( 13 );
}
#else
((void) ssl);
#endif
return( 5 );
return( (size_t) ( ssl->in_iv - ssl->in_hdr ) );
}
static inline size_t mbedtls_ssl_out_hdr_len( const mbedtls_ssl_context *ssl )
{
#if defined(MBEDTLS_SSL_PROTO_DTLS)
if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM )
{
return( 13 );
}
#else
((void) ssl);
#endif
return( 5 );
return( (size_t) ( ssl->out_iv - ssl->out_hdr ) );
}
static inline size_t mbedtls_ssl_hs_hdr_len( const mbedtls_ssl_context *ssl )