mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-02 06:14:16 +01:00
Remove restriction on value of MBEDTLS_SSL_CID_PADDING_GRANULARITY
This commit is contained in:
parent
ddf775a97f
commit
b9ec44fcf6
@ -3365,7 +3365,8 @@
|
|||||||
* Note: A value of \c 1 means that no padding will be used
|
* Note: A value of \c 1 means that no padding will be used
|
||||||
* for outgoing records.
|
* for outgoing records.
|
||||||
*
|
*
|
||||||
* The value MUST be a power of 2.
|
* Note: On systems lacking division instructions,
|
||||||
|
* a power of two should be preferred.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//#define MBEDTLS_SSL_CID_PADDING_GRANULARITY 16
|
//#define MBEDTLS_SSL_CID_PADDING_GRANULARITY 16
|
||||||
|
@ -2013,9 +2013,9 @@ static int ssl_cid_build_inner_plaintext( unsigned char *content,
|
|||||||
uint8_t rec_type )
|
uint8_t rec_type )
|
||||||
{
|
{
|
||||||
size_t len = *content_size;
|
size_t len = *content_size;
|
||||||
|
size_t pad = ( MBEDTLS_SSL_CID_PADDING_GRANULARITY -
|
||||||
/* MBEDTLS_SSL_CID_PADDING_GRANULARITY must be a power of 2. */
|
( len + 1 ) % MBEDTLS_SSL_CID_PADDING_GRANULARITY ) %
|
||||||
size_t pad = ~len & ( MBEDTLS_SSL_CID_PADDING_GRANULARITY - 1 );
|
MBEDTLS_SSL_CID_PADDING_GRANULARITY;
|
||||||
|
|
||||||
/* Write real content type */
|
/* Write real content type */
|
||||||
if( remaining == 0 )
|
if( remaining == 0 )
|
||||||
|
Loading…
Reference in New Issue
Block a user