Skip to content

Update annotations of sgx_sealed_data_t and sgx_aes_gcm_data_t (#639) - #640

Open
yang8621 wants to merge 1 commit into
intel:mainfrom
yang8621:xxx
Open

Update annotations of sgx_sealed_data_t and sgx_aes_gcm_data_t (#639)#640
yang8621 wants to merge 1 commit into
intel:mainfrom
yang8621:xxx

Conversation

@yang8621

@yang8621 yang8621 commented Dec 8, 2020

Copy link
Copy Markdown

Signed-off-by: Huang Yang yang.huang@intel.com

Signed-off-by: Huang Yang <yang.huang@intel.com>
Comment thread common/inc/sgx_tseal.h
uint32_t payload_size; /* 0: Size of the payload which includes both the encrypted data and the optional additional MAC text */
uint8_t reserved[12]; /* 4: Reserved bits */
uint32_t payload_size; /* 0: Size of the payload which includes the encrypted data: payload[] */
uint8_t reserved[SGX_SEAL_IV_SIZE]; /* 4: Reserved bits used as iv */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the value of the used IV in tseal library is the same as this reserved bits array, but they are indeed different buffers. This reserved array is actually to make the structure 16byte aligned.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Thanks for the explanation. This usage may not be aligned with the initial design of the structure. But the functionality is correct.

Comment thread common/inc/sgx_tseal.h
{
uint32_t payload_size; /* 0: Size of the payload which includes both the encrypted data and the optional additional MAC text */
uint8_t reserved[12]; /* 4: Reserved bits */
uint32_t payload_size; /* 0: Size of the payload which includes the encrypted data: payload[] */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The payload[] includes encrypted data and the optional additional authenticated data if users seal data with a plaintext (for example, sgx_seal_data() is called with p_additional_MACtext not NULL). So I suppose the previous annotation is correct.

@bot-cc1s-branch-sync

Copy link
Copy Markdown
Contributor

Important

🔀 The Intel® SGX SDK codebase has moved

Thank you for your contribution!
The code this pull request modifies now resides in a new repository,1 so, unfortunately, it can no longer be merged here as-is. If your change is still relevant, please re-open it against the SDK repository, where this code is now maintained.

If you have any questions or need assistance migrating, please ask here. As we complete the migration, older pull requests may eventually be closed. No work is lost, though, and you are welcome to re-open your change in the new repository at any time.

Footnotes

  1. The affected sources were migrated from confidential-computing.sgx to the dedicated confidential-computing.sgx.sdk repo. The migration covered the SDK sources (sdk/), shared headers (common/), samples (SampleCode/), and the runtime libraries (psw/urts, psw/enclave_common).

@bot-cc1s-branch-sync bot-cc1s-branch-sync added the repo-migration PR whose files moved to the SGX SDK repo (needs re-targeting) label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

repo-migration PR whose files moved to the SGX SDK repo (needs re-targeting)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants