mirror of
https://github.com/corda/corda.git
synced 2025-06-16 06:08:13 +00:00
ENT-1263 - Use MRENCLAVE instead of enclave ID in create_thread (#487)
* ENT-1263 - Use MRENCLAVE instead of enclave_id for create_thread * ENT-1263 - Dedup dependencies in JAR * ENT-1263 - Ensure C++ 11 is used for enclave inspection tool * ENT-1263 - Throw exception if enclave ID mapping does not exist
This commit is contained in:
@ -4,13 +4,25 @@
|
||||
#include <fstream>
|
||||
#include "sgx_utilities.h"
|
||||
#include "java_u.h"
|
||||
#include "enclave_map.h"
|
||||
#include "enclave_metadata.h"
|
||||
|
||||
static sgx_measurement_t mr_enclave;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
sgx_launch_token_t token = {0};
|
||||
sgx_enclave_id_t enclave_id = {0};
|
||||
int updated = 0;
|
||||
|
||||
CHECK_SGX(sgx_create_enclave("../../enclave/build/cordaenclave.signed.so", SGX_DEBUG_FLAG, &token, &updated, &enclave_id, NULL));
|
||||
const char *enclave_path = "../../enclave/build/cordaenclave.signed.so";
|
||||
enclave_hash_result_t hash_result = retrieve_enclave_hash(enclave_path, mr_enclave.m);
|
||||
if (EHR_SUCCESS != hash_result) {
|
||||
printf("Unable to retrieve MRENCLAVE from enclave\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
CHECK_SGX(sgx_create_enclave(enclave_path, SGX_DEBUG_FLAG, &token, &updated, &enclave_id, NULL));
|
||||
add_enclave_mapping(&mr_enclave, enclave_id);
|
||||
|
||||
if (argc < 2) {
|
||||
printf("Usage: <executable> /path/to/req/file\n");
|
||||
@ -36,4 +48,4 @@ int main(int argc, char **argv) {
|
||||
sgx_destroy_enclave(enclave_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user