We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sgx_status_t enclave_get_user_key(unsigned char *enc_user_key, size_t enc_user_key_len, unsigned char *iv, size_t iv_len, sgx_aes_gcm_128bit_tag_t *tag) { sgx_status_t ctx; sgx_ra_key_128_t k; sgx_status_t get_keys_ret = sgx_ra_get_keys(ctx, SGX_RA_KEY_SK, &k); if ( get_keys_ret != SGX_SUCCESS ) return get_keys_ret; // doesn't check user_key is not NULL unsigned char *user_key = (unsigned char*)malloc(16); sgx_status_t ret; //decrypt user's key that was used for encrypting source & data. ret = sgx_rijndael128GCM_decrypt(&k, enc_user_key, enc_user_key_len, user_key, iv, 12, NULL, 0, tag); print_hexstring(enc_user_key,16); print_hexstring(iv,12); print_hexstring((unsigned char*)tag,16); print_hexstring(user_key,16); //for security reason memset(user_key, 0x00, 16); free(user_key); return ret; }
The text was updated successfully, but these errors were encountered:
Besides, sgx_ra_get_keys expects ctx is "Context returned by sgx_ra_init."
sgx_ra_get_keys
ctx
But it gives uninitialized sgx_status_t
sgx_status_t
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: