You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by ms...@apache.org on 2020/06/11 00:46:34 UTC

[incubator-teaclave] branch master updated: Fix issues to use teaclave_proto in the app part (#347)

This is an automated email from the ASF dual-hosted git repository.

mssun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git


The following commit(s) were added to refs/heads/master by this push:
     new fbc14ee  Fix issues to use teaclave_proto in the app part (#347)
fbc14ee is described below

commit fbc14ee711dd8c8eff766f5a8ba831c474e9b15f
Author: luoyanhua2011 <53...@users.noreply.github.com>
AuthorDate: Thu Jun 11 08:46:26 2020 +0800

    Fix issues to use teaclave_proto in the app part (#347)
---
 rpc/Cargo.toml        |  3 ++-
 rpc/src/config.rs     | 13 ++++++++++++-
 rpc/src/utils.rs      |  1 +
 third_party/crates-io |  2 +-
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml
index b2ce117..67ce32c 100644
--- a/rpc/Cargo.toml
+++ b/rpc/Cargo.toml
@@ -9,6 +9,7 @@ edition = "2018"
 [features]
 default = []
 mesalock_sgx = [
+    "sgx_trts",
     "sgx_tstd",
     "teaclave_types/mesalock_sgx",
 ]
@@ -29,5 +30,5 @@ teaclave_types       = { path = "../types" }
 teaclave_attestation = { path = "../attestation" }
 teaclave_rpc_proc_macro = { path = "./proc_macro" }
 
-sgx_trts = { version = "1.1.2" }
+sgx_trts = { version = "1.1.2", optional = true }
 sgx_tstd = { version = "1.1.2", features = ["net", "backtrace", "thread"], optional = true }
diff --git a/rpc/src/config.rs b/rpc/src/config.rs
index 9558146..88685c3 100644
--- a/rpc/src/config.rs
+++ b/rpc/src/config.rs
@@ -17,10 +17,19 @@
 
 use anyhow::{anyhow, bail, Result};
 use log::debug;
+#[cfg(feature = "mesalock_sgx")]
 use std::prelude::v1::*;
-use std::sync::{Arc, SgxRwLock as RwLock};
+#[cfg(not(feature = "mesalock_sgx"))]
+use std::sync::RwLock;
+#[cfg(feature = "mesalock_sgx")]
+use std::sync::SgxRwLock as RwLock;
+
+use std::sync::Arc;
 use std::time::SystemTime;
+
+#[cfg(feature = "mesalock_sgx")]
 use std::untrusted::time::SystemTimeEx;
+
 use teaclave_attestation::report::AttestationReport;
 use teaclave_attestation::verifier::AttestationReportVerifier;
 use teaclave_attestation::AttestedTlsConfig;
@@ -75,6 +84,8 @@ impl SgxTrustedTlsServerConfig {
         Ok(config)
     }
 
+    // Disable this function for non-SGX targets.
+    #[cfg(feature = "mesalock_sgx")]
     pub fn attestation_report_verifier(
         mut self,
         accepted_enclave_attrs: Vec<EnclaveAttr>,
diff --git a/rpc/src/utils.rs b/rpc/src/utils.rs
index c3997a4..39f8d90 100644
--- a/rpc/src/utils.rs
+++ b/rpc/src/utils.rs
@@ -16,6 +16,7 @@
 // under the License.
 
 #[allow(dead_code)]
+#[cfg(feature = "mesalock_sgx")]
 pub(crate) fn get_tcs_num() -> usize {
     if sgx_trts::enclave::rsgx_is_supported_EDMM() {
         sgx_trts::enclave::SgxGlobalData::new().get_dyn_tcs_num() as usize
diff --git a/third_party/crates-io b/third_party/crates-io
index 3a067d5..dd10153 160000
--- a/third_party/crates-io
+++ b/third_party/crates-io
@@ -1 +1 @@
-Subproject commit 3a067d518aa475d5daa2f6471d6d8aaec2793d5a
+Subproject commit dd10153ccb910b83d095bc290300a95a35a260c4


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org