|
@@ -7,8 +7,6 @@
|
|
|
#include "boost/property_tree/ptree.hpp"
|
|
|
#include "boost/property_tree/json_parser.hpp"
|
|
|
|
|
|
-EnclaveAPIParams apiparams;
|
|
|
-
|
|
|
// Split a hostport string like "127.0.0.1:12000" at the rightmost colon
|
|
|
// into a host part "127.0.0.1" and a port part "12000".
|
|
|
static bool split_host_port(std::string &host, std::string &port,
|
|
@@ -86,8 +84,10 @@ bool config_parse(Config &config, const std::string configstr,
|
|
|
config.m_pub_out = pentry.second.get_value<uint8_t>();
|
|
|
} else if (!pentry.first.compare("pub_in")) {
|
|
|
config.m_pub_in = pentry.second.get_value<uint8_t>();
|
|
|
- // Currently hardcoding an AES key for client -> server communication
|
|
|
} else if (!pentry.first.compare("master_secret")) {
|
|
|
+ // Currently hardcoding an AES key for client <->
|
|
|
+ // server communication, but in reality, a key
|
|
|
+ // exchange would be done
|
|
|
std::string hex_key = pentry.second.data();
|
|
|
memcpy(config.master_secret, hex_key.c_str(), SGX_AESGCM_KEY_SIZE);
|
|
|
} else if (!pentry.first.compare("private_routing")) {
|
|
@@ -158,6 +158,7 @@ bool config_parse(Config &config, const std::string configstr,
|
|
|
if (!ret) return ret;
|
|
|
|
|
|
// Now load the config into the enclave
|
|
|
+ EnclaveAPIParams apiparams;
|
|
|
apiparams.user_count = config.user_count;
|
|
|
apiparams.msg_size = config.msg_size;
|
|
|
apiparams.m_priv_out = config.m_priv_out;
|
|
@@ -175,7 +176,8 @@ bool config_parse(Config &config, const std::string configstr,
|
|
|
apinodeconfigs[i].weight = config.nodes[i].weight;
|
|
|
apinodeconfigs[i].roles = config.nodes[i].roles;
|
|
|
}
|
|
|
- ret &= ecall_config_load(nthreads, &apiparams, apinodeconfigs.data(), num_nodes, config.my_node_num);
|
|
|
+ ret &= ecall_config_load(nthreads, &apiparams, apinodeconfigs.data(),
|
|
|
+ num_nodes, config.my_node_num);
|
|
|
if (!ret) {
|
|
|
std::cerr << "Loading config into enclave failed\n";
|
|
|
}
|