!104 backport some patches

From: @zhengxiaoxiaoGitee 
Reviewed-by: @houmingyong 
Signed-off-by: @houmingyong
This commit is contained in:
openeuler-ci-bot 2022-10-18 12:44:01 +00:00 committed by Gitee
commit 20ea69bd49
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 68 additions and 55 deletions

View File

@ -1,50 +0,0 @@
From a3a3a1e9e19f5595cb66fdc7928da70ca9f250a5 Mon Sep 17 00:00:00 2001
From: chenmaodong <chenmaodong@huawei.com>
Date: Wed, 8 Sep 2021 16:48:05 +0800
Subject: [PATCH] fix logs redirection error and delete
rsa_public_key_cloud.pem
PrintInfo will send the message from enclave to host with a program
name "[secGear]", however it'll print the wrong program name while
there are multi threads, so we delete this rule. On the same time, we
delete rsa_public_key_cloud.pem, because itrustee_sdk will provide it
Signed-off-by: chenmaodong <chenmaodong@huawei.com>
---
conf/rsyslog.d/secgear.conf | 3 +--
tools/sign_tool/cloud/rsa_public_key_cloud.pem | 11 -----------
2 files changed, 1 insertion(+), 13 deletions(-)
delete mode 100644 tools/sign_tool/cloud/rsa_public_key_cloud.pem
diff --git a/conf/rsyslog.d/secgear.conf b/conf/rsyslog.d/secgear.conf
index b835a94..7f1d898 100644
--- a/conf/rsyslog.d/secgear.conf
+++ b/conf/rsyslog.d/secgear.conf
@@ -1,6 +1,5 @@
#Do not modify this file
-if (($programname == 'teeos') or ($programname == 'secGear')) and \
- ($msg contains '[secGear]') then {
+if ($msg contains '[secGear]') then {
action(type="omfile" fileCreateMode="0600" file="/var/log/secgear/secgear.log")
stop
}
diff --git a/tools/sign_tool/cloud/rsa_public_key_cloud.pem b/tools/sign_tool/cloud/rsa_public_key_cloud.pem
deleted file mode 100644
index a321f63..0000000
--- a/tools/sign_tool/cloud/rsa_public_key_cloud.pem
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAzAPwbnbgBg7JgXERA9Bx
-p7GLI1S3e1zL83RMd2+GXb6kO4yMKUL3NUCE2HhA2BtQYmLyGovx59UUcKnU58is
-Xux++kH+A2shmOPjYvEFuX0Kt8tc19b8M9b/iHsY8ZmKykqia2a5U+IrECRFJo5p
-DWUnl7jrHVtq78BSR1c7iXG1frrEC0AYCuqKJo/fxfmOKL0Y9mENCB3nAwjn9unD
-BsO/OhkqvvB3nkeuMfNKPh4wCqtQPve13eTojbuxjX/3ePijplTI5X2Gr+n6Ximn
-fYRlytQmMgMl/db0ARSKNApq9bmwzVNrnGWWZWJksdRvf6iL7t17Gs4L9AApOuC9
-WkzxPvwp5ZUqjsGd4oJGWeC6ZE6BTw2vxE+xMFI9uAKHxq9pBKkcGMa0g4fANNNV
-+W+8JZGanxEXKB3y/M7BCyQAPCWOHC/RNjmRA1gczLYCPzC4pWu935UZdF1RR6zY
-CD3t+FoOGGET/g4CwWgyhb5qkp65Hs6ayYt/DUAqo+yBAgMBAAE=
------END PUBLIC KEY-----
--
1.8.3.1

View File

@ -0,0 +1,25 @@
From 1f6f2ff01317c6f04de7cab7c3a126e7ce485df7 Mon Sep 17 00:00:00 2001
From: zhengxiaoxiao <zhengxiaoxiao2@huawei.com>
Date: Sun, 15 May 2022 22:00:33 +0800
Subject: [PATCH] fix return value
---
src/host_src/enclave.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/host_src/enclave.c b/src/host_src/enclave.c
index 36a50b9..87a984f 100644
--- a/src/host_src/enclave.c
+++ b/src/host_src/enclave.c
@@ -196,7 +196,7 @@ cc_enclave_result_t cc_enclave_create(const char *path, enclave_type_t type, uin
if (l_path) {
free(l_path);
}
- return CC_FAIL;
+ return res;
}
/* to do: gp support enter enclave debugging */
--
2.36.0.windows.1

View File

@ -0,0 +1,33 @@
From 8877dd937ccb482ab830b9a9d4ca02f6a31045b7 Mon Sep 17 00:00:00 2001
From: zhengxiaoxiao <zhengxiaoxiao2@huawei.com>
Date: Sun, 5 Jun 2022 21:29:41 +0800
Subject: [PATCH] del print uncontrol form string
---
src/host_src/enclave.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/host_src/enclave.c b/src/host_src/enclave.c
index 8d6c8a6..6fd7510 100644
--- a/src/host_src/enclave.c
+++ b/src/host_src/enclave.c
@@ -142,14 +142,14 @@ static bool check_transform_path(cc_enclave_result_t *res, const char *path, cha
/* check file exists and get absolute pathname */
if (realpath(path, real_p) == NULL) {
*res = CC_ERROR_INVALID_PATH;
- print_error_term("Path %s error %s\n", path, strerror(errno));
+ print_error_term("Path error %s\n", strerror(errno));
return false;
}
/* check file permission */
if (access(real_p, R_OK) != 0) {
*res = CC_ERROR_ACCESS_DENIED;
- print_error_term("Path %s error %s\n", path, strerror(errno));
+ print_error_term("Path error %s\n", strerror(errno));
return false;
}
size_t len = strlen(real_p) + 1;
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: secGear
Version: 0.1.0
Release: 25
Release: 26
Summary: secGear is an SDK to develop confidential computing apps based on hardware enclave features
@ -54,19 +54,21 @@ Patch41: 0042-destroy-rwlock-when-create-enclave-failed.patch
Patch42: 0043-fix-partial-resource-leak.patch
Patch43: 0044-fix-pointer-without-init-or-check-NULL.patch
Patch44: 0045-optimize-the-private-key-usage-of-the-single-step-si.patch
Patch45: 0046-Delete-the-null-determination-of-out_buf-in-codegene.patch
Patch45: 0046-fix-return-value.patch
Patch46: 0047-del-print-uncontrol-form-string.patch
Patch47: 0048-Delete-the-null-determination-of-out_buf-in-codegene.patch
BuildRequires: gcc python automake autoconf libtool
BUildRequires: glibc glibc-devel cmake ocaml-dune rpm gcc-c++
%ifarch x86_64
BUildRequires: sgxsdk libsgx-launch libsgx-urts openssl
%else
BUildRequires: itrustee_sdk
BUildRequires: itrustee_sdk itrustee_sdk-devel
%endif
Requires: rsyslog
%ifarch x86_64
Requires: linux-sgx-driver libsgx-launch libsgx-urts libsgx-aesm-launch-plugin
Requires: linux-sgx-driver sgxsdk libsgx-launch libsgx-urts libsgx-aesm-launch-plugin
%else
Requires: itrustee_sdk
%endif
@ -80,7 +82,7 @@ Requires: %{name}%{?isa} = %{version}-%{release} cmake
%ifarch x86_64
Requires: sgxsdk
%else
Requires: itrustee_sdk
Requires: itrustee_sdk-devel
%endif
%description devel
The %{name}-devel is package contains Header file for developing applications that
@ -172,6 +174,9 @@ popd
systemctl restart rsyslog
%changelog
* Tue Oct 18 2022 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 0.1.0-26
- DESC: backport some patches
* Thu May 19 2022 wangyu <wangyu283@huawei.com> - 0.1.0-25
- DESC: change requires for secGear