!179 fix spec error and the null pointer judgment
From: @zhengxiaoxiaoGitee Reviewed-by: @houmingyong Signed-off-by: @houmingyong
This commit is contained in:
commit
91e48f1cae
@ -3,12 +3,13 @@ From: houmingyong <houmingyong@huawei.com>
|
|||||||
Date: Tue, 28 May 2024 10:25:41 +0800
|
Date: Tue, 28 May 2024 10:25:41 +0800
|
||||||
Subject: [PATCH] init attestation
|
Subject: [PATCH] init attestation
|
||||||
|
|
||||||
The current patch incorporates the following four commit points:
|
The current patch incorporates the following commit points:
|
||||||
|
|
||||||
Reference: https://gitee.com/openeuler/secGear/commit/d06b6beab9ae13898870297e8ef2ae806cd8d6d0
|
Reference: https://gitee.com/openeuler/secGear/commit/d06b6beab9ae13898870297e8ef2ae806cd8d6d0
|
||||||
https://gitee.com/openeuler/secGear/commit/b90e039631f1031a485ef038174c0bef831223a5
|
https://gitee.com/openeuler/secGear/commit/b90e039631f1031a485ef038174c0bef831223a5
|
||||||
https://gitee.com/openeuler/secGear/commit/dad056809c5e94b50c47063d728d5f1e47800512
|
https://gitee.com/openeuler/secGear/commit/dad056809c5e94b50c47063d728d5f1e47800512
|
||||||
https://gitee.com/openeuler/secGear/commit/ce4c7b6a8c013cd208004a3cec13a15fff100b1a
|
https://gitee.com/openeuler/secGear/commit/ce4c7b6a8c013cd208004a3cec13a15fff100b1a
|
||||||
|
https://gitee.com/openeuler/secGear/commit/8e02b257d9bec81bc557d6431e90448522ad6270
|
||||||
Conflict:no
|
Conflict:no
|
||||||
---
|
---
|
||||||
.../attestation/attestation-agent/Cargo.toml | 30 ++
|
.../attestation/attestation-agent/Cargo.toml | 30 ++
|
||||||
@ -18,7 +19,7 @@ Conflict:no
|
|||||||
.../attestation-agent/agent/src/agent.rs | 144 +++++++
|
.../attestation-agent/agent/src/agent.rs | 144 +++++++
|
||||||
.../agent/src/bin/aa-test/main.rs | 68 ++++
|
.../agent/src/bin/aa-test/main.rs | 68 ++++
|
||||||
.../agent/src/bin/generate-headers/main.rs | 4 +
|
.../agent/src/bin/generate-headers/main.rs | 4 +
|
||||||
.../attestation-agent/agent/src/lib.rs | 53 +++
|
.../attestation-agent/agent/src/lib.rs | 84 ++++
|
||||||
.../attestation-agent/attester/Cargo.toml | 24 ++
|
.../attestation-agent/attester/Cargo.toml | 24 ++
|
||||||
.../attester/src/itrustee/itrustee.rs | 51 +++
|
.../attester/src/itrustee/itrustee.rs | 51 +++
|
||||||
.../attester/src/itrustee/mod.rs | 130 ++++++
|
.../attester/src/itrustee/mod.rs | 130 ++++++
|
||||||
@ -32,7 +33,7 @@ Conflict:no
|
|||||||
.../verifier/src/itrustee/mod.rs | 58 +++
|
.../verifier/src/itrustee/mod.rs | 58 +++
|
||||||
.../attestation-service/verifier/src/lib.rs | 51 +++
|
.../attestation-service/verifier/src/lib.rs | 51 +++
|
||||||
.../verifier/src/virtcca/mod.rs | 373 ++++++++++++++++++
|
.../verifier/src/virtcca/mod.rs | 373 ++++++++++++++++++
|
||||||
21 files changed, 1474 insertions(+)
|
21 files changed, 1505 insertions(+)
|
||||||
create mode 100644 service/attestation/attestation-agent/Cargo.toml
|
create mode 100644 service/attestation/attestation-agent/Cargo.toml
|
||||||
create mode 100644 service/attestation/attestation-agent/README.md
|
create mode 100644 service/attestation/attestation-agent/README.md
|
||||||
create mode 100644 service/attestation/attestation-agent/agent/Cargo.toml
|
create mode 100644 service/attestation/attestation-agent/agent/Cargo.toml
|
||||||
@ -394,7 +395,7 @@ new file mode 100644
|
|||||||
index 0000000..0f1efc2
|
index 0000000..0f1efc2
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/service/attestation/attestation-agent/agent/src/lib.rs
|
+++ b/service/attestation/attestation-agent/agent/src/lib.rs
|
||||||
@@ -0,0 +1,53 @@
|
@@ -0,0 +1,72 @@
|
||||||
+use agent::*;
|
+use agent::*;
|
||||||
+pub mod agent;
|
+pub mod agent;
|
||||||
+
|
+
|
||||||
@ -404,10 +405,19 @@ index 0000000..0f1efc2
|
|||||||
+use attester::EvidenceRequest;
|
+use attester::EvidenceRequest;
|
||||||
+
|
+
|
||||||
+#[ffi_export]
|
+#[ffi_export]
|
||||||
+pub fn get_reprot(c_uuid: &repr_c::String, c_challenge: &repr_c::Vec<u8>) -> repr_c::Vec<u8> {
|
+pub fn get_reprot(c_uuid: Option<&repr_c::String>, c_challenge: Option<&repr_c::Vec<u8>>) -> repr_c::Vec<u8> {
|
||||||
+ let input = EvidenceRequest {
|
+ let uuid = match c_uuid {
|
||||||
+ uuid: c_uuid.clone().to_string(),
|
+ None => {println!("uuid is null"); return Vec::new().into();},
|
||||||
+ challenge: c_challenge.clone().to_vec(),
|
+ Some(uuid) => uuid.clone().to_string(),
|
||||||
|
+ };
|
||||||
|
+ let challenge = match c_challenge {
|
||||||
|
+ None => {println!("challenge is null"); return Vec::new().into();},
|
||||||
|
+ Some(cha) => cha.clone().to_vec(),
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ let input: EvidenceRequest = EvidenceRequest {
|
||||||
|
+ uuid: uuid,
|
||||||
|
+ challenge: challenge,
|
||||||
+ };
|
+ };
|
||||||
+
|
+
|
||||||
+ let fut = async {
|
+ let fut = async {
|
||||||
@ -425,9 +435,19 @@ index 0000000..0f1efc2
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#[ffi_export]
|
+#[ffi_export]
|
||||||
+pub fn verify_report(c_challenge: &repr_c::Vec<u8>, report: &repr_c::Vec<u8>) -> safer_ffi::libc::c_int {
|
+pub fn verify_report(c_challenge: Option<&repr_c::Vec<u8>>, report: Option<&repr_c::Vec<u8>>) -> safer_ffi::libc::c_int {
|
||||||
|
+ let challenge = match c_challenge {
|
||||||
|
+ None => {println!("challenge is null"); return 1;},
|
||||||
|
+ Some(cha) => cha.clone().to_vec(),
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ let report = match report {
|
||||||
|
+ None => {println!("report is null"); return 1;},
|
||||||
|
+ Some(report) => report.clone().to_vec(),
|
||||||
|
+ };
|
||||||
|
+
|
||||||
+ let fut = async {agent::AttestationAgent::default().verify_evidence(
|
+ let fut = async {agent::AttestationAgent::default().verify_evidence(
|
||||||
+ &c_challenge.clone().to_vec(), &report.clone().to_vec()).await};
|
+ &challenge, &report).await};
|
||||||
+ let ret = block_on(fut);
|
+ let ret = block_on(fut);
|
||||||
+ if ret.is_err() {
|
+ if ret.is_err() {
|
||||||
+ println!("verfiy report failed");
|
+ println!("verfiy report failed");
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Name: secGear
|
Name: secGear
|
||||||
Version: 0.1.0
|
Version: 0.1.0
|
||||||
Release: 36
|
Release: 37
|
||||||
Summary: secGear is an SDK to develop confidential computing apps based on hardware enclave features
|
Summary: secGear is an SDK to develop confidential computing apps based on hardware enclave features
|
||||||
|
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ replace-with = "vendored-sources"
|
|||||||
[source.vendored-sources]
|
[source.vendored-sources]
|
||||||
directory = "vendor"
|
directory = "vendor"
|
||||||
EOF
|
EOF
|
||||||
cargo build --features virtcca --lib --release
|
%{_cargo} build --features virtcca,no_as --lib --release
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -251,6 +251,9 @@ popd
|
|||||||
systemctl restart rsyslog
|
systemctl restart rsyslog
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jun 3 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 0.1.0-37
|
||||||
|
- fix spec error and the null pointer judgment
|
||||||
|
|
||||||
* Tue May 28 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 0.1.0-36
|
* Tue May 28 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 0.1.0-36
|
||||||
- add init-attestation.patch
|
- add init-attestation.patch
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user