You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by di...@apache.org on 2020/01/02 05:38:53 UTC

[incubator-teaclave-sgx-sdk] branch master updated: Temporary workaround for the sgx_ql_qv_result_t enum issue

This is an automated email from the ASF dual-hosted git repository.

dingyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git


The following commit(s) were added to refs/heads/master by this push:
     new 6df81f6  Temporary workaround for the sgx_ql_qv_result_t enum issue
     new d6b0fd0  Merge pull request #190 from mssun/fix-enum
6df81f6 is described below

commit 6df81f620c294c0f07061dc6928e3a772fd38991
Author: Mingshen Sun <bo...@mssun.me>
AuthorDate: Wed Jan 1 21:30:03 2020 -0800

    Temporary workaround for the sgx_ql_qv_result_t enum issue
    
    The SGX_QL_MK_ERROR in qve_header.h has the same name as it in
    sgx_ql_lib_common.h, so it will never be defined as (0x0000A000|(x)).
    As a workaround, to make the enum consistent with the current released
    DCAP, we define the result in (0x0000E000|(x)).
---
 sgx_types/src/types.rs | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/sgx_types/src/types.rs b/sgx_types/src/types.rs
index 690a66f..ebaeede 100644
--- a/sgx_types/src/types.rs
+++ b/sgx_types/src/types.rs
@@ -1419,18 +1419,26 @@ impl_struct_ContiguousMemory! {
 }
 
 impl_enum! {
+    // The SGX_QL_MK_ERROR in qve_header.h has the same name as it in
+    // sgx_ql_lib_common.h, so it will never be defined as (0x0000A000|(x)).
+    // As a workaround, to make the enum consistent with the current released
+    // DCAP, we define the result in (0x0000E000|(x)).
+    //
+    // https://github.com/intel/SGXDataCenterAttestationPrimitives/pull/61
     #[repr(u32)]
     #[derive(Copy, Clone, PartialEq, Eq, Ord, PartialOrd, Debug)]
     pub enum sgx_ql_qv_result_t {
         SGX_QL_QV_RESULT_OK                         = 0x0000_0000,
-//      SGX_QL_QV_RESULT_MIN                        = 0x0000_A001,
-        SGX_QL_QV_RESULT_CONFIG_NEEDED              = 0x0000_A001,
-        SGX_QL_QV_RESULT_OUT_OF_DATE                = 0x0000_A002,
-        SGX_QL_QV_RESULT_OUT_OF_DATE_CONFIG_NEEDED  = 0x0000_A003,
-        SGX_QL_QV_RESULT_INVALID_SIGNATURE          = 0x0000_A004,
-        SGX_QL_QV_RESULT_REVOKED                    = 0x0000_A005,
-        SGX_QL_QV_RESULT_UNSPECIFIED                = 0x0000_A006,
-        SGX_QL_QV_RESULT_MAX                        = 0x0000_A0FF,
+        // Same value of the enum definition in qve_header.h
+        // https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/c2bab2b3ccd80e45dbd5b7bf61d28f92a96d776e/QuoteVerification/QvE/Include/qve_header.h#L91
+        // SGX_QL_QV_RESULT_MIN                        = 0x0000_E001,
+        SGX_QL_QV_RESULT_CONFIG_NEEDED              = 0x0000_E001,
+        SGX_QL_QV_RESULT_OUT_OF_DATE                = 0x0000_E002,
+        SGX_QL_QV_RESULT_OUT_OF_DATE_CONFIG_NEEDED  = 0x0000_E003,
+        SGX_QL_QV_RESULT_INVALID_SIGNATURE          = 0x0000_E004,
+        SGX_QL_QV_RESULT_REVOKED                    = 0x0000_E005,
+        SGX_QL_QV_RESULT_UNSPECIFIED                = 0x0000_E006,
+        SGX_QL_QV_RESULT_MAX                        = 0x0000_E0FF,
     }
 }
 
@@ -1496,4 +1504,4 @@ unsafe impl ContiguousMemory for sgx_align_mac_128bit_t {}
 unsafe impl ContiguousMemory for sgx_align_key_256bit_t {}
 unsafe impl ContiguousMemory for sgx_align_mac_256bit_t {}
 unsafe impl ContiguousMemory for sgx_align_ec256_dh_shared_t {}
-unsafe impl ContiguousMemory for sgx_align_ec256_private_t {}
\ No newline at end of file
+unsafe impl ContiguousMemory for sgx_align_ec256_private_t {}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org