Update fix-faulty-code.patch

This commit is contained in:
Liu Zixian 2022-08-23 18:54:28 +08:00
parent 646f949ce6
commit 32466fa668
2 changed files with 6 additions and 26 deletions

View File

@ -1,6 +1,6 @@
name: digest-list-tools
Version: 0.3.95
Release: 7
Release: 8
Summary: Utilities for IMA Digest Lists extension
Source0: https://gitee.com/openeuler/%{name}/repository/archive/v%{version}.tar.gz
@ -126,6 +126,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/%{name}.1.gz
%changelog
* Tue Aug 23 2022 shenxiangwei <shenxiangwei1@huawei.com> - 0.3.95-8
- Update fix-faulty-code.patch
* Tue Aug 16 2022 shenxiangwei <shenxiangwei1@huawei.com> - 0.3.95-7
- Fix faulty code, file resource leakeage and memory leakage

View File

@ -1,38 +1,15 @@
From f078f852fa618f9f3a6553ff25eafd21cae0b3c1 Mon Sep 17 00:00:00 2001
From: shenxiangwei <shenxiangwei1@huawei.com>
Date: Tue, 2 Aug 2022 21:11:44 +0800
Subject: [PATCH 1/2] fix faulty code
Subject: [PATCH 1/2] fix echecker scan warning
Signed-off-by: shenxiangwei <shenxiangwei1@huawei.com>
---
lib/crypto.c | 4 ++--
lib/xattr.c | 3 +++
parsers/rpm.c | 4 ++--
src/rpm_parser.c | 4 ++--
4 files changed, 9 insertions(+), 6 deletions(-)
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/crypto.c b/lib/crypto.c
index d81992e..5397feb 100644
--- a/lib/crypto.c
+++ b/lib/crypto.c
@@ -314,7 +314,7 @@ static int sign_file(int dirfd, char *filename, char *key_path, char *keypass,
memcpy(buf + asn1->size, digest, digest_len);
sig_len = RSA_private_encrypt(digest_len + asn1->size, buf, sig, k->key,
- RSA_PKCS1_PADDING);
+ RSA_PKCS1_OAEP_PADDING);
if (sig_len < 0) {
printf("RSA_private_encrypt() failed: %d\n", sig_len);
goto out_buf;
@@ -403,7 +403,7 @@ static int verify_common(struct list_head *head, int dirfd, char *filename,
goto out;
}
- ret = RSA_public_decrypt(sig_len, sig, out, k->key, RSA_PKCS1_PADDING);
+ ret = RSA_public_decrypt(sig_len, sig, out, k->key, RSA_PKCS1_OAEP_PADDING);
if (ret < 0) {
printf("RSA_public_decrypt() failed: %d\n", ret);
goto out;
diff --git a/lib/xattr.c b/lib/xattr.c
index 2aa9c96..3bfb35c 100644
--- a/lib/xattr.c