From 0a836efece2783c6ce35868bc26f72df7a2a78c1 Mon Sep 17 00:00:00 2001 From: Morten Stevens Date: Tue, 14 May 2024 10:24:43 +0200 Subject: [PATCH] Update to 3.6.0 --- .gitignore | 1 + mbedtls-gcc14.patch | 27 +++++++++++++++++++++++++++ mbedtls.spec | 20 ++++++++++++-------- sources | 2 +- 4 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 mbedtls-gcc14.patch diff --git a/.gitignore b/.gitignore index 4639e3f..505c66d 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ /mbedtls-2.28.5.tar.gz /mbedtls-2.28.7.tar.gz /mbedtls-2.28.8.tar.bz2 +/mbedtls-3.6.0.tar.bz2 diff --git a/mbedtls-gcc14.patch b/mbedtls-gcc14.patch new file mode 100644 index 0000000..e7d0219 --- /dev/null +++ b/mbedtls-gcc14.patch @@ -0,0 +1,27 @@ +diff --git a/library/common.h b/library/common.h +index 3936ffdfe..d8c407319 100644 +--- a/library/common.h ++++ b/library/common.h +@@ -192,21 +192,21 @@ static inline void mbedtls_xor(unsigned char *r, + #if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS) + #if defined(MBEDTLS_HAVE_NEON_INTRINSICS) && \ + (!(defined(MBEDTLS_COMPILER_IS_GCC) && MBEDTLS_GCC_VERSION < 70300)) + /* Old GCC versions generate a warning here, so disable the NEON path for these compilers */ + for (; (i + 16) <= n; i += 16) { + uint8x16_t v1 = vld1q_u8(a + i); + uint8x16_t v2 = vld1q_u8(b + i); + uint8x16_t x = veorq_u8(v1, v2); + vst1q_u8(r + i, x); + } +-#if defined(__IAR_SYSTEMS_ICC__) ++#if defined(__IAR_SYSTEMS_ICC__) || defined(MBEDTLS_COMPILER_IS_GCC) + /* This if statement helps some compilers (e.g., IAR) optimise out the byte-by-byte tail case + * where n is a constant multiple of 16. + * For other compilers (e.g. recent gcc and clang) it makes no difference if n is a compile-time + * constant, and is a very small perf regression if n is not a compile-time constant. */ + if (n % 16 == 0) { + return; + } + #endif + #elif defined(MBEDTLS_ARCH_IS_X64) || defined(MBEDTLS_ARCH_IS_ARM64) + /* This codepath probably only makes sense on architectures with 64-bit registers */ diff --git a/mbedtls.spec b/mbedtls.spec index 85e75b7..7705929 100644 --- a/mbedtls.spec +++ b/mbedtls.spec @@ -3,12 +3,13 @@ %endif Name: mbedtls -Version: 2.28.8 +Version: 3.6.0 Release: 1%{?dist} Summary: Light-weight cryptographic and SSL/TLS library License: Apache-2.0 URL: https://www.trustedfirmware.org/projects/mbed-tls Source0: https://github.com/Mbed-TLS/%{name}/archive/refs/tags/%{name}-%{version}.tar.bz2 +Patch0: mbedtls-gcc14.patch BuildRequires: make BuildRequires: gcc-c++ @@ -43,10 +44,10 @@ BuildArch: noarch The %{name}-doc package contains documentation. %prep -%autosetup +%autosetup -p1 -sed -i 's|//\(#define MBEDTLS_THREADING_C\)|\1|' include/mbedtls/config.h -sed -i 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' include/mbedtls/config.h +sed -i 's|//\(#define MBEDTLS_THREADING_C\)|\1|' include/mbedtls/mbedtls_config.h +sed -i 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' include/mbedtls/mbedtls_config.h %build export CFLAGS="%{optflags} -Wno-stringop-overflow -Wno-maybe-uninitialized" @@ -59,8 +60,7 @@ export CXXLAGS="%{optflags} -Wno-stringop-overflow -Wno-maybe-uninitialized" -DENABLE_PROGRAMS=OFF \ -DUSE_SHARED_MBEDTLS_LIBRARY=ON \ -DUSE_STATIC_MBEDTLS_LIBRARY=OFF \ - -DGEN_FILES=OFF \ - -DENABLE_TESTING=Off + -DGEN_FILES=OFF %cmake_build make apidoc @@ -74,8 +74,8 @@ make apidoc # - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/PDD6RNQMII472HXM4XAUUWWZKKBGHPTO/ chmod 755 %{buildroot}%{_libdir}/*.so.* -# %check -# %ctest --output-on-failure --force-new-ctest-process --parallel 1 +%check +%ctest --output-on-failure --force-new-ctest-process --parallel 1 %ldconfig_scriptlets @@ -89,6 +89,7 @@ chmod 755 %{buildroot}%{_libdir}/*.so.* %{_includedir}/mbedtls/ %{_includedir}/psa/ %{_includedir}/everest/ +%{_libdir}/cmake/MbedTLS/ %{_libdir}/pkgconfig/ %{_libdir}/*.so @@ -96,6 +97,9 @@ chmod 755 %{buildroot}%{_libdir}/*.so.* %doc apidoc/* %changelog +* Tue May 14 2024 Morten Stevens - 3.6.0-1 +- Update to 3.6.0 + * Mon Apr 01 2024 Morten Stevens - 2.28.8-1 - Update to 2.28.8 diff --git a/sources b/sources index 6db9ce7..1c19b31 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mbedtls-2.28.8.tar.bz2) = c8e91ec50ab2caf1f33e907279dc30fca2a8cd97e6e531be857149589e52aeffb95b445b2a9fa674886f0071f446381da3bb8107f7e850f3390128b069ac9ea7 +SHA512 (mbedtls-3.6.0.tar.bz2) = 5c395890d486144af882aa96c9430103f79df889139969a64a490c0cafbdd5631a72bb668aa59b062204f19a5bb36dfcc5a096b59d76c7ef27f2560cd2388682