From 57face2f0b3c18368c7ac21f03e45f3b5a92233d Mon Sep 17 00:00:00 2001 From: JoeSubbiani Date: Thu, 17 Jun 2021 15:00:01 +0100 Subject: [PATCH 1/7] Free context in at the end of aes_crypt_xts_size() in file tests/suite/test_suite_aes.function, aes_crypt_xts_size() did not free the context upon the function exit. The function now frees the context on exit. Fixes #4176 Signed-off-by: JoeSubbiani --- tests/suites/test_suite_aes.function | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/suites/test_suite_aes.function b/tests/suites/test_suite_aes.function index aa3df92fa5..dac6edc958 100644 --- a/tests/suites/test_suite_aes.function +++ b/tests/suites/test_suite_aes.function @@ -207,6 +207,8 @@ void aes_crypt_xts_size( int size, int retval ) memset( data_unit, 0x00, sizeof( data_unit ) ); TEST_ASSERT( mbedtls_aes_crypt_xts( &ctx, MBEDTLS_AES_ENCRYPT, length, data_unit, src, output ) == retval ); +exit: + mbedtls_aes_xts_free(&ctx); } /* END_CASE */ From 26e8608fcb2af9e73025c17c0727ef22c0719580 Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 18 Jun 2021 12:01:11 +0100 Subject: [PATCH 2/7] Changelog entry for Free Context in test_suite_aes fix Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ChangeLog.d/issue4176.txt diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt new file mode 100644 index 0000000000..35cc8470ef --- /dev/null +++ b/ChangeLog.d/issue4176.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix an issue where resource is never freed when running one particular test suite with an alternative AES implementation +Fixes #4176 \ No newline at end of file From 487b4ae426c22e819fd73697658be0cafb22b78b Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 18 Jun 2021 15:37:21 +0100 Subject: [PATCH 3/7] Update changelog formatting - Missing Free Context The original formatting was in dos and the changelog assembler would fail. The length of the description was too long horizontally. This has been updated. Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index 35cc8470ef..8ca386f41a 100644 --- a/ChangeLog.d/issue4176.txt +++ b/ChangeLog.d/issue4176.txt @@ -1,3 +1,3 @@ -Bugfix - * Fix an issue where resource is never freed when running one particular test suite with an alternative AES implementation -Fixes #4176 \ No newline at end of file +Bugfix + * Fix an issue where resource is never freed when running one particular + test suite with an alternative AES implementation. Fixes #4176 From dc5660c4c0d951a8e586aef9e5780efe8d5d98ac Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 18 Jun 2021 17:40:54 +0100 Subject: [PATCH 4/7] Update changlog formatting - Missing Free Context Trailing white space causing `check_files.py` to fail Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index 8ca386f41a..e1ed5d6e19 100644 --- a/ChangeLog.d/issue4176.txt +++ b/ChangeLog.d/issue4176.txt @@ -1,3 +1,3 @@ Bugfix - * Fix an issue where resource is never freed when running one particular + * Fix an issue where resource is never freed when running one particular test suite with an alternative AES implementation. Fixes #4176 From e6ef5febfb938432c80173f9d2d1183e522045ee Mon Sep 17 00:00:00 2001 From: Joe Subbiani <85489920+JoeSubbiani@users.noreply.github.com> Date: Fri, 18 Jun 2021 18:51:27 +0100 Subject: [PATCH 5/7] Update changelog formatting - Missing Free Context Missing trailing full stop added to the end of the fixed issue number Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index e1ed5d6e19..d362f1080e 100644 --- a/ChangeLog.d/issue4176.txt +++ b/ChangeLog.d/issue4176.txt @@ -1,3 +1,3 @@ Bugfix * Fix an issue where resource is never freed when running one particular - test suite with an alternative AES implementation. Fixes #4176 + test suite with an alternative AES implementation. Fixes #4176. From 3f9e64c03c3b4f275af7b3a125417a4014f5ac7e Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Mon, 21 Jun 2021 09:10:55 +0100 Subject: [PATCH 6/7] Fix improper spacing Spacing between brackets did not follow the appropriate coding style Signed-off-by: Joe Subbiani --- tests/suites/test_suite_aes.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/test_suite_aes.function b/tests/suites/test_suite_aes.function index dac6edc958..1892c2595a 100644 --- a/tests/suites/test_suite_aes.function +++ b/tests/suites/test_suite_aes.function @@ -208,7 +208,7 @@ void aes_crypt_xts_size( int size, int retval ) TEST_ASSERT( mbedtls_aes_crypt_xts( &ctx, MBEDTLS_AES_ENCRYPT, length, data_unit, src, output ) == retval ); exit: - mbedtls_aes_xts_free(&ctx); + mbedtls_aes_xts_free( &ctx ); } /* END_CASE */ From 08b5ab2b812b5efbac71462039e8288d64d1cd9f Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Mon, 21 Jun 2021 16:50:51 +0100 Subject: [PATCH 7/7] Reword changelog - Test Resource Leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - “Fix an issue where X happens” → ”Fix X“ the extra words are just a distraction. - “resource” → “a resource” - “where resource is never freed” has a name: it's a resource leak - “when running one particular test suite” → “in a test suite” Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index d362f1080e..ddca37f9be 100644 --- a/ChangeLog.d/issue4176.txt +++ b/ChangeLog.d/issue4176.txt @@ -1,3 +1,3 @@ Bugfix - * Fix an issue where resource is never freed when running one particular - test suite with an alternative AES implementation. Fixes #4176. + * Fix a resource leak in a test suite with an alternative AES + implementation. Fixes #4176.