From 4adc04a8a3a27874213c0ccb04a14514ea5a0ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 16 Jul 2020 10:00:48 +0200 Subject: [PATCH] Give a constant a name in test function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Pégourié-Gonnard --- tests/suites/test_suite_ssl.function | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index 40ab19d55..36023dd0b 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -3475,6 +3475,7 @@ void ssl_decrypt_non_etm_cbc( int cipher_type, int hash_id, int trunc_hmac, unsigned char add_data[13]; unsigned char mac[MBEDTLS_MD_MAX_SIZE]; int exp_ret; + const unsigned char pad_max_len = 255; /* Per the standard */ mbedtls_ssl_init( &ssl ); mbedtls_ssl_transform_init( &t0 ); @@ -3492,7 +3493,7 @@ void ssl_decrypt_non_etm_cbc( int cipher_type, int hash_id, int trunc_hmac, if( padlen == block_size ) padlen = 0; if( pad_long ) - padlen += block_size * ( ( 255 - padlen ) / block_size ); + padlen += block_size * ( ( pad_max_len - padlen ) / block_size ); /* Prepare a buffer for record data */ buflen = block_size @@ -3606,7 +3607,7 @@ void ssl_decrypt_non_etm_cbc( int cipher_type, int hash_id, int trunc_hmac, * (Start the loop with correct padding, just to double-check that record * saving did work, and that we're overwriting the correct bytes.) */ - for( i = padlen; i <= 255; i++ ) + for( i = padlen; i <= pad_max_len; i++ ) { test_set_step( i );