diff --git a/backport-Fix-compiler-warning.patch b/backport-Fix-compiler-warning.patch new file mode 100644 index 0000000000000000000000000000000000000000..3d01d62451afcce27b4c0328fd8af37975c3bc53 --- /dev/null +++ b/backport-Fix-compiler-warning.patch @@ -0,0 +1,44 @@ +From 349d56e38c802dfeeaff0036639972616311622f Mon Sep 17 00:00:00 2001 +From: Steffen Jaeckel +Date: Mon, 26 Aug 2024 14:48:53 +0200 +Subject: [PATCH] Fix compiler warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Repeated from 97edea362a34cb89b0e83bb503bde9e13ae817ba + +``` +src/encauth/ccm/ccm_add_nonce.c: In function ‘ccm_add_nonce’: +src/encauth/ccm/ccm_add_nonce.c:61:21: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] + 61 | ccm->PAD[x++] = (unsigned char)((len >> 24) & 255); + | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In file included from ./src/headers/tomcrypt.h:82, + from ./src/headers/tomcrypt_private.h:4, + from src/encauth/ccm/ccm_add_nonce.c:3: +./src/headers/tomcrypt_mac.h:410:24: note: at offset 16 into destination object ‘PAD’ of size 16 + 410 | unsigned char PAD[16], /* flags | Nonce N | l(m) */ +``` + +Signed-off-by: Steffen Jaeckel +--- + src/encauth/ccm/ccm_add_nonce.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/encauth/ccm/ccm_add_nonce.c b/src/encauth/ccm/ccm_add_nonce.c +index a48d48d3..a56a43a5 100644 +--- a/src/encauth/ccm/ccm_add_nonce.c ++++ b/src/encauth/ccm/ccm_add_nonce.c +@@ -58,6 +58,9 @@ int ccm_add_nonce(ccm_state *ccm, + ccm->PAD[x++] = 0; + } + for (; y < ccm->L; y++) { ++ if (x >= sizeof(ccm->PAD)) { ++ return CRYPT_INVALID_ARG; ++ } + ccm->PAD[x++] = (unsigned char)((len >> 24) & 255); + len <<= 8; + } +-- +2.43.0 + diff --git a/libtomcrypt.spec b/libtomcrypt.spec index 2aa4466586b99030cacb4ccff14a06d1864eb482..94c1a8e417f6928fdd6bfc78b2a19a82301fe0af 100644 --- a/libtomcrypt.spec +++ b/libtomcrypt.spec @@ -1,12 +1,15 @@ Name: libtomcrypt Version: 1.18.2 -Release: 6 +Release: 7 Summary: A comprehensive, portable cryptographic toolkit License: Public Domain or WTFPL URL: http://www.libtom.net/ Source0: https://github.com/libtom/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz + Patch0: CVE-2019-17362.patch Patch1: backport-fix-missing-mutex-unlock.patch +Patch2: backport-Fix-compiler-warning.patch + BuildRequires: libtommath-devel libtool %description @@ -54,6 +57,9 @@ make test %{_libdir}/pkgconfig/*.pc %changelog +* Fri Aug 29 2025 yixiangzhike - 1.18.2-7 +- backport upstream patch to fix compiler warning + * Tue Jul 2 2024 yixiangzhike - 1.18.2-6 - backport upstream patch to fix missing mutex unlock