Skip to content

Commit

Permalink
Merge pull request #313 from dingelish/master
Browse files Browse the repository at this point in the history
Fix buffer check error of p_additional_MACtext_length

Signed-off-by: Zhang Lili Z <lili.z.zhang@intel.com>
  • Loading branch information
lzha101 authored Sep 19, 2018
2 parents 5a0de59 + b38e0d8 commit c08051e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sdk/tseal/tSeal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ extern "C" sgx_status_t sgx_unseal_data(const sgx_sealed_data_t *p_sealed_data,
{
return SGX_ERROR_INVALID_PARAMETER;
}
if (!sgx_is_within_enclave(p_decrypted_text_length, sizeof(p_decrypted_text_length)))
if (!sgx_is_within_enclave(p_decrypted_text_length, sizeof(*p_decrypted_text_length)))
{
return SGX_ERROR_INVALID_PARAMETER;
}
Expand All @@ -217,8 +217,8 @@ extern "C" sgx_status_t sgx_unseal_data(const sgx_sealed_data_t *p_sealed_data,
}

if((p_additional_MACtext_length != NULL) &&
(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)))))
(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)))))
{
return SGX_ERROR_INVALID_PARAMETER;
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/tseal/tSeal_aad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ extern "C" sgx_status_t sgx_unmac_aadata(const sgx_sealed_data_t *p_sealed_data,
{
return SGX_ERROR_INVALID_PARAMETER;
}
if(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length))))
if(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length))))
{
return SGX_ERROR_INVALID_PARAMETER;
}
Expand Down

0 comments on commit c08051e

Please sign in to comment.