From e9212cd315251bee8af8e1f95d27dc8156978807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= Date: Tue, 20 Aug 2024 10:49:34 +0200 Subject: [PATCH] Fix filehash58 probe on s390x architecture Resolves: RHEL-53981 --- openscap-1.4.1-PR2154-filehash58.patch | 31 ++++++++++++++++++++++++++ openscap.spec | 6 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 openscap-1.4.1-PR2154-filehash58.patch diff --git a/openscap-1.4.1-PR2154-filehash58.patch b/openscap-1.4.1-PR2154-filehash58.patch new file mode 100644 index 0000000..7d83033 --- /dev/null +++ b/openscap-1.4.1-PR2154-filehash58.patch @@ -0,0 +1,31 @@ +From 106ffad93e3145747b9d6ea2a4872ed1bdc5f595 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= +Date: Tue, 20 Aug 2024 08:18:15 +0200 +Subject: [PATCH] Fix a cast + +The size_t is implementation-dependent data type, it shouldn't be +cast to unsigned int. +Fixes failing test probes/filehash58/test_probes_filehash58.sh +on s390x architecture. +--- + src/OVAL/probes/crapi/digest.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/OVAL/probes/crapi/digest.c b/src/OVAL/probes/crapi/digest.c +index 96f638d4a..2fc1c6998 100644 +--- a/src/OVAL/probes/crapi/digest.c ++++ b/src/OVAL/probes/crapi/digest.c +@@ -252,7 +252,9 @@ static int crapi_digest_update(struct crapi_digest_ctx *ctx, void *bptr, size_t + static int crapi_digest_fini(struct crapi_digest_ctx *ctx, crapi_alg_t alg) + { + #if defined(HAVE_NSS3) +- HASH_End (ctx->ctx, ctx->dst, (unsigned int *)ctx->size, *ctx->size); ++ unsigned int result_len; ++ HASH_End(ctx->ctx, ctx->dst, &result_len, *ctx->size); ++ *ctx->size = result_len; + HASH_Destroy (ctx->ctx); + #elif defined(HAVE_GCRYPT) + void *buffer; +-- +2.46.0 + diff --git a/openscap.spec b/openscap.spec index 2fbd113..f69f6f5 100644 --- a/openscap.spec +++ b/openscap.spec @@ -1,12 +1,13 @@ Name: openscap Version: 1.4.0 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 Summary: Set of open source libraries enabling integration of the SCAP line of standards License: LGPL-2.1-or-later URL: http://www.open-scap.org/ VCS: https://github.com/OpenSCAP/openscap Source0: https://github.com/OpenSCAP/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz +Patch1: openscap-1.4.1-PR2154-filehash58.patch %global common_description %{expand: OpenSCAP is a set of open source libraries providing an easier path @@ -157,6 +158,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %changelog +* Tue Aug 20 2024 Jan Černý - 1:1.4.0-2 +- Fix filehash58 probe on s390x architecture + * Thu Aug 01 2024 Jan Černý - 1:1.4.0-1 - Update to the latest upstream release (RHEL-53981) - Remove openscap-devel, openscap-engine-sce-devel and openscap-python3 subpackages