Re-implement mbedtls_ssl_{in/out}_hdr_len() via in/out pointers
@@ -912,28 +912,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 )
