Use mbedtls_xor in TLS messaging layer
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
74b345f282
commit
c36a56e890
1 changed files with 1 additions and 4 deletions
|
@ -511,15 +511,12 @@ static void ssl_build_record_nonce( unsigned char *dst_iv,
|
|||
unsigned char const *dynamic_iv,
|
||||
size_t dynamic_iv_len )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
/* Start with Fixed IV || 0 */
|
||||
memset( dst_iv, 0, dst_iv_len );
|
||||
memcpy( dst_iv, fixed_iv, fixed_iv_len );
|
||||
|
||||
dst_iv += dst_iv_len - dynamic_iv_len;
|
||||
for( i = 0; i < dynamic_iv_len; i++ )
|
||||
dst_iv[i] ^= dynamic_iv[i];
|
||||
mbedtls_xor( dst_iv, dst_iv, dynamic_iv, dynamic_iv_len );
|
||||
}
|
||||
#endif /* MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C */
|
||||
|
||||
|
|
Loading…
Reference in a new issue