Skip to content

Commit

Permalink
Use enclave_info.toml instead of txt (#155)
Browse files Browse the repository at this point in the history
* Use enclave_info.toml instead of txt
* Move sgx/utils in core to teaclave_utils
  • Loading branch information
mssun committed Dec 14, 2019
1 parent b42caf4 commit 8681ebd
Show file tree
Hide file tree
Showing 48 changed files with 261 additions and 235 deletions.
8 changes: 3 additions & 5 deletions cmake/MesaTEEUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function(add_sgx_build_target sgx_lib_path pkg_name)
if(_module_name STREQUAL "functional_test")
set(_enclave_info "/dev/null")
else()
set(_enclave_info "${MESATEE_OUT_DIR}/${_module_name}_enclave_info.txt")
set(_enclave_info "${MESATEE_OUT_DIR}/${_module_name}_enclave_info.toml")
endif()

add_custom_target(${_target_name} ALL
Expand All @@ -164,10 +164,8 @@ function(add_sgx_build_target sgx_lib_path pkg_name)
COMMAND ${CMAKE_COMMAND} -E env ${TARGET_SGXLIB_ENVS} SGX_COMMON_CFLAGS=${STR_SGX_COMMON_CFLAGS}
CUR_MODULE_NAME=${_module_name} CUR_MODULE_PATH=${sgx_lib_path} CUR_INSTALL_DIR=${_copy_dir} ${MT_SCRIPT_DIR}/sgx_link_sign.sh
${_depends}
COMMAND echo ${_module_name} > ${_enclave_info}
COMMAND grep -m1 -A2 "mrsigner->value" ${MESATEE_OUT_DIR}/${_module_name}.enclave.meta.txt >> ${_enclave_info}
COMMAND grep -m1 -A2 "body.enclave_hash" ${MESATEE_OUT_DIR}/${_module_name}.enclave.meta.txt >> ${_enclave_info}
COMMENT "Building ${_target_name}, enclave info to ${ENCLAVE_INFO}"
COMMAND cat ${MESATEE_OUT_DIR}/${_module_name}.enclave.meta.txt | python ${MT_SCRIPT_DIR}/gen_enclave_info_toml.py ${_module_name} > ${_enclave_info}
COMMENT "Building ${_target_name}, enclave info to ${_enclave_info}"
WORKING_DIRECTORY ${MT_SGXLIB_TOML_DIR}
)
endfunction()
Expand Down
20 changes: 20 additions & 0 deletions cmake/scripts/gen_enclave_info_toml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import sys

def find_hex_value(content, section):
index = content.index(section)
# assume each element in content is ending with '\n'
hex_bytes = ''.join(content[index+1:index+3]).split()
return ''.join(['%02x' % int(x, 16) for x in hex_bytes])

mrsigner = "mrsigner->value:\n"
enclave_hash = "metadata->enclave_css.body.enclave_hash.m:\n"

content = sys.stdin.readlines()

mrsigner_hex = find_hex_value(content, mrsigner)
enclave_hash_hex = find_hex_value(content, enclave_hash)

sys.stdout.write("""[{}]
mrsigner = "{}"
enclave_hash = "{}"
""".format(sys.argv[1], mrsigner_hex, enclave_hash_hex))
8 changes: 4 additions & 4 deletions cmake/scripts/gen_enclave_sig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ for var in "${REQUIRED_ENVS[@]}"; do
[ -z "${!var}" ] && echo "Please set ${var}" && exit -1
done

cd ${MESATEE_OUT_DIR} && cat *_enclave_info.txt > ${MESATEE_SERVICE_INSTALL_DIR}/enclave_info.txt
cd ${MESATEE_OUT_DIR} && cat *_enclave_info.toml > ${MESATEE_SERVICE_INSTALL_DIR}/enclave_info.toml

AUDITOR_PATHS=$(find ${MESATEE_AUDITORS_DIR} -mindepth 1 -maxdepth 1 -type d)
for auditor_path in ${AUDITOR_PATHS}; do
auditor=$(basename ${auditor_path})
openssl dgst -sha256 \
-sign ${MESATEE_AUDITORS_DIR}/${auditor}/${auditor}.private.pem \
-out ${MESATEE_AUDITORS_DIR}/${auditor}/${auditor}.sign.sha256 \
${MESATEE_SERVICE_INSTALL_DIR}/enclave_info.txt;
${MESATEE_SERVICE_INSTALL_DIR}/enclave_info.toml;
done

cp -RT ${MESATEE_AUDITORS_DIR}/ ${MESATEE_EXAMPLE_AUDITORS_DIR}/
cp -r ${MESATEE_AUDITORS_DIR} ${MESATEE_TEST_INSTALL_DIR}/
cp ${MESATEE_SERVICE_INSTALL_DIR}/enclave_info.txt ${MESATEE_EXAMPLE_INSTALL_DIR}/
cp ${MESATEE_SERVICE_INSTALL_DIR}/enclave_info.txt ${MESATEE_TEST_INSTALL_DIR}/
cp ${MESATEE_SERVICE_INSTALL_DIR}/enclave_info.toml ${MESATEE_EXAMPLE_INSTALL_DIR}/
cp ${MESATEE_SERVICE_INSTALL_DIR}/enclave_info.toml ${MESATEE_TEST_INSTALL_DIR}/
2 changes: 1 addition & 1 deletion cmake/scripts/sgx_link_sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ done
LIBENCLAVE_PATH="${TRUSTED_TARGET_DIR}/${TARGET}/lib${CUR_MODULE_NAME}_enclave.a"
CONFIG_PATH="${MESATEE_PROJECT_ROOT}/${CUR_MODULE_PATH}/Enclave.config.xml"
SIGNED_PATH="${CUR_INSTALL_DIR}/${CUR_MODULE_NAME}.enclave.signed.so"
CUR_ENCLAVE_INFO_PATH="${MESATEE_OUT_DIR}/${CUR_MODULE_NAME}_enclave_info.txt"
CUR_ENCLAVE_INFO_PATH="${MESATEE_OUT_DIR}/${CUR_MODULE_NAME}_enclave_info.toml"
if [ ! "$LIBENCLAVE_PATH" -nt "$SIGNED_PATH" ] \
&& [ ! "$CONFIG_PATH" -nt "$SIGNED_PATH" ] \
&& [ ! "$SIGNED_PATH" -nt "$CUR_ENCLAVE_INFO_PATH" ]; then
Expand Down
2 changes: 1 addition & 1 deletion docker/fns-rt.ubuntu-1604.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -O $LIBSGX_ENCLAVE_COMMON "$LIBSGX_ENCLAVE_COMMON_URL" && \

ADD release/services/fns /mesatee/
ADD release/services/fns.enclave.signed.so /mesatee/
ADD release/services/enclave_info.txt /mesatee/
ADD release/services/enclave_info.toml /mesatee/
ADD release/services/auditors /mesatee/auditors

ENTRYPOINT ["/mesatee/fns"]
2 changes: 1 addition & 1 deletion docker/fns-rt.ubuntu-1804.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -O $LIBSGX_ENCLAVE_COMMON "$LIBSGX_ENCLAVE_COMMON_URL" && \

ADD release/services/fns /mesatee/
ADD release/services/fns.enclave.signed.so /mesatee/
ADD release/services/enclave_info.txt /mesatee/
ADD release/services/enclave_info.toml /mesatee/
ADD release/services/auditors /mesatee/auditors

ENTRYPOINT ["/mesatee/fns"]
2 changes: 1 addition & 1 deletion docker/kms-rt.ubuntu-1604.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -O $LIBSGX_ENCLAVE_COMMON "$LIBSGX_ENCLAVE_COMMON_URL" && \

ADD release/services/kms /mesatee/
ADD release/services/kms.enclave.signed.so /mesatee/
ADD release/services/enclave_info.txt /mesatee/
ADD release/services/enclave_info.toml /mesatee/
ADD release/services/auditors /mesatee/auditors

ENTRYPOINT ["/mesatee/kms"]
2 changes: 1 addition & 1 deletion docker/kms-rt.ubuntu-1804.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -O $LIBSGX_ENCLAVE_COMMON "$LIBSGX_ENCLAVE_COMMON_URL" && \

ADD release/services/kms /mesatee/
ADD release/services/kms.enclave.signed.so /mesatee/
ADD release/services/enclave_info.txt /mesatee/
ADD release/services/enclave_info.toml /mesatee/
ADD release/services/auditors /mesatee/auditors

ENTRYPOINT ["/mesatee/kms"]
2 changes: 1 addition & 1 deletion docker/runtime.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ kms = { listen_address = "0.0.0.0:6016", advertised_address = "172.18.18.102:60
acs = { listen_address = "0.0.0.0:5077", advertised_address = "172.18.18.103:5077" }

[audit]
enclave_info = { path = "enclave_info.txt" }
enclave_info = { path = "enclave_info.toml" }
auditor_signatures = [
{ path = "auditors/godzilla/godzilla.sign.sha256" },
{ path = "auditors/optimus_prime/optimus_prime.sign.sha256" },
Expand Down
2 changes: 1 addition & 1 deletion docker/tdfs-rt.ubuntu-1604.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -O $LIBSGX_ENCLAVE_COMMON "$LIBSGX_ENCLAVE_COMMON_URL" && \

ADD release/services/tdfs /mesatee/
ADD release/services/tdfs.enclave.signed.so /mesatee/
ADD release/services/enclave_info.txt /mesatee/
ADD release/services/enclave_info.toml /mesatee/
ADD release/services/auditors /mesatee/auditors

ENTRYPOINT ["/mesatee/tdfs"]
2 changes: 1 addition & 1 deletion docker/tdfs-rt.ubuntu-1804.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -O $LIBSGX_ENCLAVE_COMMON "$LIBSGX_ENCLAVE_COMMON_URL" && \

ADD release/services/tdfs /mesatee/
ADD release/services/tdfs.enclave.signed.so /mesatee/
ADD release/services/enclave_info.txt /mesatee/
ADD release/services/enclave_info.toml /mesatee/
ADD release/services/auditors /mesatee/auditors

ENTRYPOINT ["/mesatee/tdfs"]
2 changes: 1 addition & 1 deletion docker/tms-rt.ubuntu-1604.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -O $LIBSGX_ENCLAVE_COMMON "$LIBSGX_ENCLAVE_COMMON_URL" && \

ADD release/services/tms /mesatee/
ADD release/services/tms.enclave.signed.so /mesatee/
ADD release/services/enclave_info.txt /mesatee/
ADD release/services/enclave_info.toml /mesatee/
ADD release/services/auditors /mesatee/auditors

ENTRYPOINT ["/mesatee/tms"]
2 changes: 1 addition & 1 deletion docker/tms-rt.ubuntu-1804.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -O $LIBSGX_ENCLAVE_COMMON "$LIBSGX_ENCLAVE_COMMON_URL" && \

ADD release/services/tms /mesatee/
ADD release/services/tms.enclave.signed.so /mesatee/
ADD release/services/enclave_info.txt /mesatee/
ADD release/services/enclave_info.toml /mesatee/
ADD release/services/auditors /mesatee/auditors

ENTRYPOINT ["/mesatee/tms"]
2 changes: 1 addition & 1 deletion examples/dbscan/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn main() {
};

let input_string = serde_json::to_string(&input_payload).unwrap();
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let mesatee = Mesatee::new(
&mesatee_enclave_info,
Expand Down
2 changes: 1 addition & 1 deletion examples/gaussian_mixture_model/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn main() {
};

let input_string = serde_json::to_string(&input_payload).unwrap();
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let mesatee = Mesatee::new(
&mesatee_enclave_info,
Expand Down
2 changes: 1 addition & 1 deletion examples/gaussian_processes/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn main() {
};

let input_string = serde_json::to_string(&input_payload).unwrap();
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let mesatee = Mesatee::new(
&mesatee_enclave_info,
Expand Down
2 changes: 1 addition & 1 deletion examples/gbdt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn main() {
),
];

let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";

let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let args: Vec<String> = env::args().collect();
Expand Down
2 changes: 1 addition & 1 deletion examples/gen_linear_model/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn main() {
};

let input_string = serde_json::to_string(&input_payload).unwrap();
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let mesatee = Mesatee::new(
&mesatee_enclave_info,
Expand Down
2 changes: 1 addition & 1 deletion examples/image_resizing/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn main() {
"../services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
),
];
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";

let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples/kmeans/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() {
};
let input_string = serde_json::to_string(&input_payload).unwrap();

let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

let mesatee = Mesatee::new(
Expand Down
2 changes: 1 addition & 1 deletion examples/lin_reg/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn main() {
};

let input_string = serde_json::to_string(&input_payload).unwrap();
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let mesatee = Mesatee::new(
&mesatee_enclave_info,
Expand Down
2 changes: 1 addition & 1 deletion examples/logistic_reg/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn main() {
),
];

let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";

let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let args_string: Vec<String> = env::args().collect();
Expand Down
2 changes: 1 addition & 1 deletion examples/naive_bayes/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn main() {
};

let input_string = serde_json::to_string(&input_payload).unwrap();
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let mesatee = Mesatee::new(
&mesatee_enclave_info,
Expand Down
2 changes: 1 addition & 1 deletion examples/neural_net/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn main() {
};

let input_string = serde_json::to_string(&input_payload).unwrap();
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let mesatee = Mesatee::new(
&mesatee_enclave_info,
Expand Down
2 changes: 1 addition & 1 deletion examples/online_decrypt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn main() {
"../services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
),
];
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";

let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples/private_join_and_compute/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fn main() {
"../services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
),
];
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";

let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples/py_file/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main() {
"../services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
),
];
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

let args_string: Vec<String> = env::args().collect();
Expand Down
2 changes: 1 addition & 1 deletion examples/py_logistic_reg/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main() {
"../services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
),
];
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

let args_string: Vec<String> = env::args().collect();
Expand Down
2 changes: 1 addition & 1 deletion examples/py_matrix_multiply/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main() {
"../services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
),
];
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

let args_string: Vec<String> = env::args().collect();
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn main() {
"../services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
),
];
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";

let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart_c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int main() {
assert(auditors != NULL);

mesatee_enclave_info_t *enclave_info =
mesatee_enclave_info_load(auditors, "../services/enclave_info.txt");
mesatee_enclave_info_load(auditors, "../services/enclave_info.toml");

assert(enclave_info != NULL);

Expand Down
2 changes: 1 addition & 1 deletion examples/rsa_sign/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn main() {
"../services/auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
),
];
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";

let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples/svm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn main() {
};

let input_string = serde_json::to_string(&input_payload).unwrap();
let enclave_info_file_path = "../services/enclave_info.txt";
let enclave_info_file_path = "../services/enclave_info.toml";
let mesatee_enclave_info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
let mesatee = Mesatee::new(
&mesatee_enclave_info,
Expand Down
4 changes: 2 additions & 2 deletions keys/auditors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Each auditor has his/her own asymmetric key pair and will sign MesaTEE enclaves
only if the enclaves can pass the audting process:

```
openssl dgst -sha256 -sign private.pem -out sign.sha256 enclave_info.txt
openssl dgst -sha256 -sign private.pem -out sign.sha256 enclave_info.toml
```

The enclave_info.txt above contains the MRSIGNER (enclave signer's identity)
The enclave_info.toml above contains the MRSIGNER (enclave signer's identity)
and MRENCLAVE (enclave's measurement) value pairs of all MesaTEE enclaves. A
sample entry looks like:

Expand Down
1 change: 1 addition & 0 deletions mesatee_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ clap_flags = "0.2.0"
tms_external_proto = { path = "../mesatee_services/tms/external/proto" }
tdfs_external_proto = { path = "../mesatee_services/tdfs/external/proto" }
fns_proto = { path = "../mesatee_services/fns/proto" }
teaclave_utils = { path = "../mesatee_utils/teaclave_utils" }
2 changes: 1 addition & 1 deletion mesatee_cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Here we give an example of using `mesatee_cli`:
```shell
$ cd mesatee
$ ./service.sh start
$ ./bin/mesatee_cli 127.0.0.1:5554 -k auditors/albus_dumbledore/albus_dumbledore.public.der -k auditors/godzilla/godzilla.public.der -k auditors/optimus_prime/optimus_prime.public.der -s auditors/albus_dumbledore/albus_dumbledore.sign.sha256 -s auditors/godzilla/godzilla.sign.sha256 -s auditors/optimus_prime/optimus_prime.sign.sha256 -c out/enclave_info.txt --endpoint tms -i ~/tms_payload
$ ./bin/mesatee_cli 127.0.0.1:5554 -k auditors/albus_dumbledore/albus_dumbledore.public.der -k auditors/godzilla/godzilla.public.der -k auditors/optimus_prime/optimus_prime.public.der -s auditors/albus_dumbledore/albus_dumbledore.sign.sha256 -s auditors/godzilla/godzilla.sign.sha256 -s auditors/optimus_prime/optimus_prime.sign.sha256 -c out/enclave_info.toml --endpoint tms -i ~/tms_payload
{"type":"Create","task_id":"7216dd3e-ab3a-4974-b03e-3833891bbb26","task_token":"08e0d4c807700ff24d31ca01d8695b61","ip":"127.0.0.1","port":3444}
```
7 changes: 5 additions & 2 deletions mesatee_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use fns_proto::{InvokeTaskRequest, InvokeTaskResponse};
use mesatee_core::config::{OutboundDesc, TargetDesc};
use mesatee_core::rpc::{channel, sgx};
use tdfs_external_proto::{DFSRequest, DFSResponse};
use teaclave_utils;
use tms_external_proto::{TaskRequest, TaskResponse};

type EnclaveInfo = std::collections::HashMap<String, (sgx::SgxMeasure, sgx::SgxMeasure)>;
Expand Down Expand Up @@ -141,8 +142,10 @@ fn main() -> CliResult {
let (key, sig_path) = auditor;
enclave_signers.push((key.as_slice(), sig_path.as_path()));
}
let enclave_info =
sgx::load_and_verify_enclave_info(&args.enclave_info, enclave_signers.as_slice());
let enclave_info = teaclave_utils::load_and_verify_enclave_info(
&args.enclave_info,
enclave_signers.as_slice(),
);

let reader: Box<dyn Read> = match args.input {
Some(i) => Box::new(io::BufReader::new(fs::File::open(i)?)),
Expand Down
Loading

0 comments on commit 8681ebd

Please sign in to comment.