mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Prepare moving away from memmove() on incoming HS
This commit is contained in:
committed by
Paul Bakker
parent
4a1753657c
commit
f899583f94
@ -1974,6 +1974,23 @@ static inline int safer_memcmp( const void *a, const void *b, size_t n )
|
||||
return( diff );
|
||||
}
|
||||
|
||||
/*
|
||||
* Temporary function while transitionning away from memmove()
|
||||
* on received DTLS handshake messages
|
||||
*/
|
||||
static inline void ssl_hs_rm_dtls_hdr( ssl_context *ssl )
|
||||
{
|
||||
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
||||
if( ssl->transport == SSL_TRANSPORT_DATAGRAM )
|
||||
{
|
||||
memmove( ssl->in_msg + 4, ssl->in_msg + 12, ssl->in_hslen - 12 );
|
||||
ssl->in_hslen -= 8;
|
||||
}
|
||||
#else
|
||||
(void) ssl;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user