I am a novice in c++ world and I am running into a problem which I have been trying to solve for some days on my own and through google and I could not find a solution. I want to use the method below:
sgx_status_t sgx_get_key(const sgx_key_request_t*
key_request,sgx_key_128bit_t *key);
Data structure of sgx_key_request according to documentation is as below
typedef struct _key_request_t {
uint16_t key_name;
uint16_t key_policy;
sgx_isv_svn_t isv_svn;
uint16_t reserved1;
sgx_cpu_svn_t cpu_svn;
sgx_attributes_t attribute_mask;
sgx_key_id_t key_id;
sgx_misc_select_t misc_mask;
sgx_config_svn_t config_svn
uint8_t reserved2[434]
} sgx_key_request_t;
I tried to use the method above as according to the documentation as below
typedef struct _key_request_t {
uint16_t key_name;
uint16_t key_policy;
sgx_isv_svn_t isv_svn;
uint16_t reserved1;
sgx_cpu_svn_t cpu_svn;
sgx_attributes_t attribute_mask;
sgx_key_id_t key_id ;
sgx_misc_select_t misc_mask;
sgx_config_svn_t config_svn;
uint8_t reserved2[434];
} sgx_key_request_t;
const sgx_key_request_t keyRequest{
SGX_KEYSELECT_EINITTOKEN,
SGX_KEYPOLICY_MRENCLAVE,
0,
0,
0,
0,
0,
0xFFFFFFFF,
0,
{0}
};
sgx_key_128bit_t *key;
sgx_status_t ret = sgx_get_key(keyRequest, key);
I have some compile error here as below:
'_key_request_t': 'struct' type redefinition 'keyRequest' uses undefined struct '_key_request_t' 'sgx_status_t sgx_get_key(const sgx_key_request_t *,sgx_key_128bit_t (*))': cannot convert argument 1 from 'int' to 'const sgx_key_request_t *'
I have tried to figure it out but I am coming from a JAVA world and there are new keyword in c++ which I am still not familiar with. I know I would have put some time on learning c++ but my deadlines did not give me that luxury. I would appreciate any positive and negative comments
User contributions licensed under CC BY-SA 3.0