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 2019/12/14 22:24:04 UTC

[incubator-teaclave] branch master updated: Remove unneccessary sgx_launch_check function (#162)

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 b2d3d3a  Remove unneccessary sgx_launch_check function (#162)
b2d3d3a is described below

commit b2d3d3a9161f0c9d76c8215873259007ac48e726
Author: Mingshen Sun <bo...@mssun.me>
AuthorDate: Sat Dec 14 14:23:57 2019 -0800

    Remove unneccessary sgx_launch_check function (#162)
---
 cmake/scripts/sgx_test.sh    |  2 +-
 mesatee_binder/src/binder.rs |  3 +--
 mesatee_core/src/lib.rs      |  1 -
 mesatee_core/src/utils.rs    | 29 -----------------------------
 4 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/cmake/scripts/sgx_test.sh b/cmake/scripts/sgx_test.sh
index 6f0f45c..f622629 100755
--- a/cmake/scripts/sgx_test.sh
+++ b/cmake/scripts/sgx_test.sh
@@ -9,7 +9,7 @@ fi
 source ${SGX_SDK}/environment
 if [ "${SGX_MODE}" = "HW" ]; then
 	if [ -z ${IAS_SPID} ] || [ -z ${IAS_KEY} ] ; then
-        echo "SGX launch check failed: Env var for IAS SPID or IAS KEY does NOT exist. Please follow \"How to Run (SGX)\" in README to obtain, and specify the value in environment variables and put the names of environment variables in config.toml. The default variables are IAS_SPID and IAS_KEY."
+        echo "Please set IAS_SPID and IAS_KEY environment variables."
         exit 1;
     fi
 fi
diff --git a/mesatee_binder/src/binder.rs b/mesatee_binder/src/binder.rs
index aca2aac..bf9782f 100644
--- a/mesatee_binder/src/binder.rs
+++ b/mesatee_binder/src/binder.rs
@@ -31,7 +31,7 @@ use mesatee_core::ipc::protos::ecall::{FinalizeEnclaveInput, FinalizeEnclaveOutp
 use mesatee_core::ipc::protos::ecall::{InitEnclaveInput, InitEnclaveOutput};
 use mesatee_core::ipc::protos::ECallCommand;
 use mesatee_core::ipc::IpcSender;
-use mesatee_core::{utils::sgx_launch_check, Error, ErrorKind, Result};
+use mesatee_core::{Error, ErrorKind, Result};
 
 static ENCLAVE_FILE_SUFFIX: &str = "enclave.signed.so";
 static ENCLAVE_TOKEN_SUFFIX: &str = "enclave.token";
@@ -54,7 +54,6 @@ pub struct TeeBinder {
 
 impl TeeBinder {
     pub fn new(name: &str, debug_launch: i32) -> Result<TeeBinder> {
-        sgx_launch_check()?;
         let name = name.to_string();
         let enclave = init_enclave(&name, debug_launch)?;
         let enclave_id = enclave.geteid();
diff --git a/mesatee_core/src/lib.rs b/mesatee_core/src/lib.rs
index b7af8a1..ca81562 100644
--- a/mesatee_core/src/lib.rs
+++ b/mesatee_core/src/lib.rs
@@ -31,7 +31,6 @@ extern crate ring;
 
 pub mod db;
 pub mod rpc; // Syntax sugar for monadic error handling, defined in mayfail.rs
-pub mod utils;
 
 // MesaTEE Error is defined in error.rs
 mod error;
diff --git a/mesatee_core/src/utils.rs b/mesatee_core/src/utils.rs
deleted file mode 100644
index e239eae..0000000
--- a/mesatee_core/src/utils.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-use crate::error::{ErrorKind, Result};
-
-// check prerequisites to make the launching process smoother
-// the launching may still fail even after passing the check
-pub fn sgx_launch_check() -> Result<()> {
-    // check the existence of env var specified in config.toml
-    if !cfg!(sgx_sim) && (std::env::var("IAS_SPID").is_err() || std::env::var("IAS_KEY").is_err()) {
-        error!("SGX launch check failed: Env var for IAS SPID or IAS KEY does NOT exist. Please follow \"How to Run (SGX)\" in README to obtain, and specify the value in environment variables and put the names of environment variables in config.toml.");
-        return Err(ErrorKind::IASClientKeyCertError.into());
-    }
-    Ok(())
-}


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