Create module hash for each module in SGX lib-rats (#1745)

Current SGX lib-rats wasm module hash is stored in a global buffer,
which may be overwritten if there are multiple wasm module loadings.
We move the module hash into the enclave module to resolve the issue.

And rename the SGX_IPFS macro/variable in Makefile and Enclave.edl to
make the code more consistent.

And refine the sgx-ra sample document.
This commit is contained in:
Wenyong Huang
2022-11-24 21:48:50 +08:00
committed by GitHub
parent 1032aac60b
commit 29b76dd275
12 changed files with 131 additions and 26 deletions

View File

@ -103,7 +103,7 @@ enclave_init(sgx_enclave_id_t *p_eid)
<= MAX_PATH - 1 - sizeof(TOKEN_FILENAME) - strlen("/")) {
/* compose the token path */
strncpy(token_path, home_dir, MAX_PATH);
strncat(token_path, "/", strlen("/"));
strncat(token_path, "/", strlen("/") + 1);
strncat(token_path, TOKEN_FILENAME, sizeof(TOKEN_FILENAME) + 1);
}
else {