mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-10 20:25:47 +00:00
Change byte copy to memcpy
Change setting the mki value byte after byte with `memcpy()`. Signed-off-by: Johan Pascal <johan.pascal@belledonne-communications.com>
This commit is contained in:
parent
f0f7c19457
commit
75870ec6a7
|
@ -762,7 +762,7 @@ static void ssl_write_use_srtp_ext( mbedtls_ssl_context *ssl,
|
|||
{
|
||||
unsigned char *p = buf;
|
||||
size_t protection_profiles_index = 0;
|
||||
size_t mki_len = 0, i;
|
||||
size_t mki_len = 0;
|
||||
size_t ext_len = 0;
|
||||
uint16_t profile_value = 0;
|
||||
|
||||
|
@ -836,10 +836,7 @@ static void ssl_write_use_srtp_ext( mbedtls_ssl_context *ssl,
|
|||
|
||||
if( mki_len != 0 )
|
||||
{
|
||||
for( i=0; i < mki_len; i++ )
|
||||
{
|
||||
*p++ = ssl->dtls_srtp_info.mki_value[i];
|
||||
}
|
||||
memcpy( p, ssl->dtls_srtp_info.mki_value, mki_len );
|
||||
MBEDTLS_SSL_DEBUG_BUF( 3, "sending mki", ssl->dtls_srtp_info.mki_value,
|
||||
ssl->dtls_srtp_info.mki_len );
|
||||
}
|
||||
|
|
|
@ -2606,7 +2606,7 @@ static void ssl_write_use_srtp_ext( mbedtls_ssl_context *ssl,
|
|||
unsigned char *buf,
|
||||
size_t *olen )
|
||||
{
|
||||
size_t mki_len = 0, ext_len = 0, i;
|
||||
size_t mki_len = 0, ext_len = 0;
|
||||
uint16_t profile_value = 0;
|
||||
|
||||
if( ssl->dtls_srtp_info.chosen_dtls_srtp_profile == MBEDTLS_SRTP_UNSET_PROFILE )
|
||||
|
@ -2650,10 +2650,7 @@ static void ssl_write_use_srtp_ext( mbedtls_ssl_context *ssl,
|
|||
}
|
||||
|
||||
buf[8] = mki_len & 0xFF;
|
||||
for( i=0; i < mki_len; i++ )
|
||||
{
|
||||
buf[9 + i] = ssl->dtls_srtp_info.mki_value[i];
|
||||
}
|
||||
memcpy( &buf[9], ssl->dtls_srtp_info.mki_value, mki_len );
|
||||
|
||||
*olen = 9 + mki_len;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue