intel / intel/confidential-computing.sgx.sdk
sgx_ra_proc_msg2_trusted issue for user-define remote attestation report_data
- Dominant language
- C++
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Hi guys
I found that the API sgx_ra_proc_msg2_trusted in sgx_tkey_exchange.c cannot set the user-defined report_data, moreover, it hard code the item->g_a as the report_data. There is a gap that, as a user I want to set something like my service public key of my enclave so as to it can build a whole verification chain via Intel Attestation Verification Report. But it cannot do that now.
Is it a defect? or do you have any plan to open such interface for user?
It seems that there are some minor defects
1. Comments said the report data is H and H is the hash of ga, gb and VK_CMAC, but actually, H is only calculated used ga in the sgx_sha256_msg paralist.
2. sha256ed_size is derived from sp_pubkey but the actually hash calculation is about g_a. I know they are the same size since they are both EC point of p256v1. But it looks a little strange.
3. If the hash involved the sp_pubkey instead of g_a, it can work for my case which mean we can setup a verification chain rooted to the AVR.
// H = SHA256(ga || gb || VK_CMAC)
uint32_t sha256ed_size = offsetof(ra_db_item_t, sp_pubkey);
//report_data is 512bits, H is 256bits. The H is in the lower 256 bits of report data while the higher 256 bits are all zeros.
se_ret = sgx_sha256_msg((uint8_t *)&item->g_a, sha256ed_size,
(sgx_sha256_hash_t *)&report_data);
if(SGX_SUCCESS != se_ret)
{
if (SGX_ERROR_OUT_OF_MEMORY != se_ret)
se_ret = SGX_ERROR_UNEXPECTED;
sgx_spin_unlock(&item->item_lock);
break;
}
//REPORTDATA = H
se_ret = sgx_create_report(p_qe_target, &report_data, p_report);
Contributor guide
Research direction
Start in sgx_tkey_exchange.c at sgx_ra_proc_msg2_trusted, then inspect the shown sgx_sha256_msg and sgx_create_report calls. Compare the comments and hash inputs with the requested user-defined report_data and determine the intended interface and verification behavior. Done should include an agreed resolution for caller-supplied report data and the noted hash-input inconsistencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cryptography, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100