diff --git a/include/mbedtls/ssl_internal.h b/include/mbedtls/ssl_internal.h index 579a682b7..30505e306 100644 --- a/include/mbedtls/ssl_internal.h +++ b/include/mbedtls/ssl_internal.h @@ -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 )