Return error when ripemd160 is used with OpenSSL3

Resolves: #1962067
This commit is contained in:
Petr Kubat 2021-05-27 15:59:48 +02:00
parent 4daa3481e5
commit 63337cb41f
2 changed files with 20 additions and 1 deletions

View File

@ -2,7 +2,7 @@
Name: libarchive
Version: 3.5.1
Release: 4%{?dist}
Release: 5%{?dist}
Summary: A library for handling streaming archive formats
License: BSD
@ -10,6 +10,7 @@ URL: https://www.libarchive.org/
Source0: https://libarchive.org/downloads/%{name}-%{version}.tar.gz
Patch0: libarchive-3.5.1-fix-covscan-rhel-9.patch
Patch1: openssl3-rmd160failure.patch
BuildRequires: automake
BuildRequires: bison
@ -213,6 +214,9 @@ run_testsuite
%changelog
* Thu May 27 2021 Petr Kubat <pkubat@redhat.com> - 3.5.1-5
- Return error when ripemd160 is used with OpenSSL3 (#1962067)
* Mon May 10 2021 Ondrej Dubaj <odubaj@redhat.com> - 3.5.1-4
- Fixed covscan issues (#1938755)

View File

@ -0,0 +1,15 @@
--- libarchive-3.5.1/libarchive/archive_digest.c.old 2021-05-27 15:46:54.988302284 +0200
+++ libarchive-3.5.1/libarchive/archive_digest.c 2021-05-27 15:50:03.519746886 +0200
@@ -432,9 +432,11 @@
static int
__archive_ripemd160init(archive_rmd160_ctx *ctx)
{
+ int ret;
if ((*ctx = EVP_MD_CTX_new()) == NULL)
return (ARCHIVE_FAILED);
- EVP_DigestInit(*ctx, EVP_ripemd160());
+ if (!(ret = EVP_DigestInit(*ctx, EVP_ripemd160())))
+ return (ARCHIVE_FAILED);
return (ARCHIVE_OK);
}