From 32466fa668486b21f490b94890f2ff3a9a08c570 Mon Sep 17 00:00:00 2001 From: Liu Zixian Date: Tue, 23 Aug 2022 18:54:28 +0800 Subject: [PATCH] Update fix-faulty-code.patch --- digest-list-tools.spec | 5 ++++- fix-faulty-code.patch | 27 ++------------------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/digest-list-tools.spec b/digest-list-tools.spec index 170adaf..bef5afd 100644 --- a/digest-list-tools.spec +++ b/digest-list-tools.spec @@ -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 - 0.3.95-8 +- Update fix-faulty-code.patch + * Tue Aug 16 2022 shenxiangwei - 0.3.95-7 - Fix faulty code, file resource leakeage and memory leakage diff --git a/fix-faulty-code.patch b/fix-faulty-code.patch index f8fc6cb..e6b1f8e 100644 --- a/fix-faulty-code.patch +++ b/fix-faulty-code.patch @@ -1,38 +1,15 @@ From f078f852fa618f9f3a6553ff25eafd21cae0b3c1 Mon Sep 17 00:00:00 2001 From: shenxiangwei 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 --- - 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