1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Allow the configuration of padding when using CID extension

This commit is contained in:
Hanno Becker
2019-05-08 17:37:58 +01:00
parent 4c3eb7c919
commit b1aa1b3616
5 changed files with 32 additions and 4 deletions

View File

@ -2013,7 +2013,9 @@ static int ssl_cid_build_inner_plaintext( unsigned char *content,
uint8_t rec_type )
{
size_t len = *content_size;
size_t pad = ~len & 0xF; /* Pad to a multiple of 16 */
/* MBEDTLS_SSL_CID_PADDING_GRANULARITY must be a power of 2. */
size_t pad = ~len & ( MBEDTLS_SSL_CID_PADDING_GRANULARITY - 1 );
/* Write real content type */
if( remaining == 0 )