-
Notifications
You must be signed in to change notification settings - Fork 732
Create module hash for each module in SGX lib-rats #1745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 RATS macro/variable in Makefile and Enclave.edl to make the code more consistent. And refine the sgx-ra sample document.
|
@zeuson0 @JamesMenetrey Could you help review the PR? Thanks in advance. |
JamesMenetrey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a great addition, thanks! Here is my feedback.
| #endif | ||
|
|
||
| /* Destroy enclave module resources */ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we remove this blank line to match the other comments' style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| char * | ||
| wasm_runtime_get_module_hash(wasm_module_t module); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we move this declaration to lib_rats_common.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I move to wasm_export.h instead
| extern "C" { | ||
| char * | ||
| wasm_runtime_get_module_hash(wasm_module_t module); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we move this declaration to lib_rats_common.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to wasm_export.h, since the function is implemented in this cpp file, if it isn't declared in .h file with extern "C" { .. }, it will be compiled as a c++ API, and eventually link error occurs.
Thanks for the comments! I addressed them with a patch set, could you review again? |
|
This is great, thanks! |
…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.
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.
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.
…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.
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.