From 4629af5f52834387e417041b5b12535f5bdb22d6 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 1 Mar 2021 21:07:49 -0800 Subject: mbedtls: Fix gcc11 stringop-overflow warning Signed-off-by: Khem Raj --- ...001-ssl_tls-Increase-size-of-padbuf-to-64.patch | 34 ++++++++++++++++++++++ .../recipes-connectivity/mbedtls/mbedtls_2.25.0.bb | 1 + 2 files changed, 35 insertions(+) create mode 100644 meta-networking/recipes-connectivity/mbedtls/mbedtls/0001-ssl_tls-Increase-size-of-padbuf-to-64.patch (limited to 'meta-networking/recipes-connectivity/mbedtls') diff --git a/meta-networking/recipes-connectivity/mbedtls/mbedtls/0001-ssl_tls-Increase-size-of-padbuf-to-64.patch b/meta-networking/recipes-connectivity/mbedtls/mbedtls/0001-ssl_tls-Increase-size-of-padbuf-to-64.patch new file mode 100644 index 0000000000..f3ba04f51f --- /dev/null +++ b/meta-networking/recipes-connectivity/mbedtls/mbedtls/0001-ssl_tls-Increase-size-of-padbuf-to-64.patch @@ -0,0 +1,34 @@ +From c3d7321d59e959b357a7d3d69782d9105f3d04aa Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 1 Mar 2021 21:04:57 -0800 +Subject: [PATCH] ssl_tls: Increase size of padbuf to 64 + +This fixes warnings with gcc11 + +git/library/ssl_tls.c: In function 'ssl_calc_finished_tls_sha384': +git/library/ssl_tls.c:3267:5: error: 'mbedtls_sha512_finish_ret' accessing 64 bytes in a region of size 48 [-Werror=stringop-overflow=] + 3267 | finish( &sha512, padbuf ); + | ^~~~~~~~~~~~~~~~~~~~~~~~~ +git/library/ssl_tls.c:3267:5: note: referencing argument 2 of type 'unsigned char *' + +Signed-off-by: Khem Raj +--- + library/ssl_tls.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/library/ssl_tls.c b/library/ssl_tls.c +index a1a5859f0..4c98a4104 100644 +--- a/library/ssl_tls.c ++++ b/library/ssl_tls.c +@@ -3205,7 +3205,7 @@ static void ssl_calc_finished_tls_sha384( + { + int len = 12; + const char *sender; +- unsigned char padbuf[48]; ++ unsigned char padbuf[64]; + #if defined(MBEDTLS_USE_PSA_CRYPTO) + size_t hash_size; + psa_hash_operation_t sha384_psa = PSA_HASH_OPERATION_INIT; +-- +2.30.1 + diff --git a/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.25.0.bb b/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.25.0.bb index 27c1b209dc..481e7ea949 100644 --- a/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.25.0.bb +++ b/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.25.0.bb @@ -25,6 +25,7 @@ SECTION = "libs" S = "${WORKDIR}/git" SRCREV = "1c54b5410fd48d6bcada97e30cac417c5c7eea67" SRC_URI = "git://github.com/ARMmbed/mbedtls.git;protocol=https;branch=development" +SRC_URI += "file://0001-ssl_tls-Increase-size-of-padbuf-to-64.patch" inherit cmake -- cgit 1.2.3-korg