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

rduan pushed a commit to branch v1.1.4-testing
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git


The following commit(s) were added to refs/heads/v1.1.4-testing by this push:
     new 15b7d71  Update sgx_trts and sgx_types (intel sgx sdk 2.14, DCAP 1.11)
15b7d71 is described below

commit 15b7d71d54f40d46b085254f2efefd929f385bef
Author: volcano <[email protected]>
AuthorDate: Mon Jul 19 17:28:01 2021 +0800

    Update sgx_trts and sgx_types (intel sgx sdk 2.14, DCAP 1.11)
---
 sgx_trts/src/enclave.rs   |  3 +++
 sgx_types/src/error.rs    | 21 ++++++++++++---------
 sgx_types/src/function.rs |  2 ++
 sgx_types/src/metadata.rs | 30 ++++++++++++++++++------------
 sgx_types/src/types.rs    | 12 ++++++++++++
 5 files changed, 47 insertions(+), 21 deletions(-)

diff --git a/sgx_trts/src/enclave.rs b/sgx_trts/src/enclave.rs
index 582d255..7447e2d 100644
--- a/sgx_trts/src/enclave.rs
+++ b/sgx_trts/src/enclave.rs
@@ -57,6 +57,9 @@ pub struct global_data_t {
     pub layout_entry_num: u32,
     pub reserved: u32,
     pub layout_table: [layout_t; LAYOUT_ENTRY_NUM],
+    pub enclave_image_address: u64,
+    pub elrange_start_address: u64,
+    pub elrange_size: u64,
 }
 
 #[repr(C)]
diff --git a/sgx_types/src/error.rs b/sgx_types/src/error.rs
index 51e985d..ea9a488 100755
--- a/sgx_types/src/error.rs
+++ b/sgx_types/src/error.rs
@@ -35,6 +35,7 @@ impl_enum! {
         SGX_ERROR_INVALID_STATE             = 0x0000_0005,      /* SGX API is 
invoked in incorrect order or state */
         SGX_ERROR_FEATURE_NOT_SUPPORTED     = 0x0000_0008,      /* Feature is 
not supported on this platform */
         SGX_PTHREAD_EXIT                    = 0x0000_0009,      /* Enclave is 
exited with pthread_exit() */
+        SGX_ERROR_MEMORY_MAP_FAILURE        = 0x0000_000A,      /* Failed to 
reserve memory for the enclave */
 
         SGX_ERROR_INVALID_FUNCTION          = 0x0000_1001,      /* The 
ecall/ocall index is invalid */
         SGX_ERROR_OUT_OF_TCS                = 0x0000_1003,      /* The enclave 
is out of TCS */
@@ -52,10 +53,10 @@ impl_enum! {
         SGX_ERROR_NO_DEVICE                 = 0x0000_2006,      /* Can't open 
SGX device */
         SGX_ERROR_MEMORY_MAP_CONFLICT       = 0x0000_2007,      /* Page 
mapping failed in driver */
         SGX_ERROR_INVALID_METADATA          = 0x0000_2009,      /* The 
metadata is incorrect. */
-        SGX_ERROR_DEVICE_BUSY               = 0x0000_200c,      /* Device is 
busy, mostly EINIT failed. */
-        SGX_ERROR_INVALID_VERSION           = 0x0000_200d,      /* Metadata 
version is inconsistent between uRTS and sgx_sign or uRTS is incompatible with 
current platform. */
-        SGX_ERROR_MODE_INCOMPATIBLE         = 0x0000_200e,      /* The target 
enclave 32/64 bit mode or sim/hw mode is incompatible with the mode of current 
uRTS. */
-        SGX_ERROR_ENCLAVE_FILE_ACCESS       = 0x0000_200f,      /* Can't open 
enclave file. */
+        SGX_ERROR_DEVICE_BUSY               = 0x0000_200C,      /* Device is 
busy, mostly EINIT failed. */
+        SGX_ERROR_INVALID_VERSION           = 0x0000_200D,      /* Metadata 
version is inconsistent between uRTS and sgx_sign or uRTS is incompatible with 
current platform. */
+        SGX_ERROR_MODE_INCOMPATIBLE         = 0x0000_200E,      /* The target 
enclave 32/64 bit mode or sim/hw mode is incompatible with the mode of current 
uRTS. */
+        SGX_ERROR_ENCLAVE_FILE_ACCESS       = 0x0000_200F,      /* Can't open 
enclave file. */
         SGX_ERROR_INVALID_MISC              = 0x0000_2010,      /* The 
MiscSelct/MiscMask settings are not correct.*/
         SGX_ERROR_INVALID_LAUNCH_TOKEN      = 0x0000_2011,      /* The launch 
token is not correct.*/
 
@@ -73,11 +74,11 @@ impl_enum! {
         SGX_ERROR_UPDATE_NEEDED             = 0x0000_4006,   /* SGX needs to 
be updated */
         SGX_ERROR_NETWORK_FAILURE           = 0x0000_4007,   /* Network 
connecting or proxy setting issue is encountered */
         SGX_ERROR_AE_SESSION_INVALID        = 0x0000_4008,   /* Session is 
invalid or ended by server */
-        SGX_ERROR_BUSY                      = 0x0000_400a,   /* The requested 
service is temporarily not availabe */
-        SGX_ERROR_MC_NOT_FOUND              = 0x0000_400c,   /* The Monotonic 
Counter doesn't exist or has been invalided */
-        SGX_ERROR_MC_NO_ACCESS_RIGHT        = 0x0000_400d,   /* Caller doesn't 
have the access right to specified VMC */
-        SGX_ERROR_MC_USED_UP                = 0x0000_400e,   /* Monotonic 
counters are used out */
-        SGX_ERROR_MC_OVER_QUOTA             = 0x0000_400f,   /* Monotonic 
counters exceeds quota limitation */
+        SGX_ERROR_BUSY                      = 0x0000_400A,   /* The requested 
service is temporarily not availabe */
+        SGX_ERROR_MC_NOT_FOUND              = 0x0000_400C,   /* The Monotonic 
Counter doesn't exist or has been invalided */
+        SGX_ERROR_MC_NO_ACCESS_RIGHT        = 0x0000_400D,   /* Caller doesn't 
have the access right to specified VMC */
+        SGX_ERROR_MC_USED_UP                = 0x0000_400E,   /* Monotonic 
counters are used out */
+        SGX_ERROR_MC_OVER_QUOTA             = 0x0000_400F,   /* Monotonic 
counters exceeds quota limitation */
         SGX_ERROR_KDF_MISMATCH              = 0x0000_4011,   /* Key derivation 
function doesn't match during key exchange */
         SGX_ERROR_UNRECOGNIZED_PLATFORM     = 0x0000_4012,   /* EPID 
Provisioning failed due to platform not recognized by backend server*/
         SGX_ERROR_UNSUPPORTED_CONFIG        = 0x0000_4013,   /* The config for 
trigging EPID Provisiong or PSE Provisiong&LTP is invalid*/
@@ -131,6 +132,7 @@ impl sgx_status_t {
             sgx_status_t::SGX_ERROR_INVALID_STATE => "SGX API is invoked in 
incorrect order or state.",
             sgx_status_t::SGX_ERROR_FEATURE_NOT_SUPPORTED => "Feature is not 
supported on this platform.",
             sgx_status_t::SGX_PTHREAD_EXIT => "Enclave is exited with 
pthread_exit.",
+            sgx_status_t::SGX_ERROR_MEMORY_MAP_FAILURE => "Failed to reserve 
memory for the enclave.",
 
             sgx_status_t::SGX_ERROR_INVALID_FUNCTION => "The ecall/ocall index 
is invalid.",
             sgx_status_t::SGX_ERROR_OUT_OF_TCS => "The enclave is out of TCS.",
@@ -223,6 +225,7 @@ impl sgx_status_t {
             sgx_status_t::SGX_ERROR_INVALID_STATE => "SGX_ERROR_INVALID_STATE",
             sgx_status_t::SGX_ERROR_FEATURE_NOT_SUPPORTED => 
"SGX_ERROR_FEATURE_NOT_SUPPORTED",
             sgx_status_t::SGX_PTHREAD_EXIT => "SGX_PTHREAD_EXIT",
+            sgx_status_t::SGX_ERROR_MEMORY_MAP_FAILURE => 
"SGX_ERROR_MEMORY_MAP_FAILURE",
 
             sgx_status_t::SGX_ERROR_INVALID_FUNCTION => 
"SGX_ERROR_INVALID_FUNCTION",
             sgx_status_t::SGX_ERROR_OUT_OF_TCS => "SGX_ERROR_OUT_OF_TCS",
diff --git a/sgx_types/src/function.rs b/sgx_types/src/function.rs
index 7a88787..3e191ba 100755
--- a/sgx_types/src/function.rs
+++ b/sgx_types/src/function.rs
@@ -743,6 +743,8 @@ extern "C" {
     /* intel DCAP 1.4 */
     pub fn sgx_ql_get_root_ca_crl(pp_root_ca_crl: *mut *mut uint8_t, 
p_root_ca_cal_size: *mut uint16_t) -> sgx_quote3_error_t;
     pub fn sgx_ql_free_root_ca_crl(p_root_ca_crl: *const uint8_t) -> 
sgx_quote3_error_t;
+    /* intel DCAP 2.14 */
+    pub fn sgx_ql_set_logging_callback(logger: sgx_ql_logging_callback_t) -> 
sgx_quote3_error_t;
 }
 
 //#[link(name = "sgx_default_qcnl_wrapper")]
diff --git a/sgx_types/src/metadata.rs b/sgx_types/src/metadata.rs
index b953078..7358359 100644
--- a/sgx_types/src/metadata.rs
+++ b/sgx_types/src/metadata.rs
@@ -157,21 +157,27 @@ type si_flags_t = u64;
 
 impl_packed_struct! {
     pub struct layout_entry_t {
-        pub id :u16,
-        pub attributes :u16,
-        pub page_count :u32,
-        pub rva :u64,
-        pub content_size :u32,
-        pub content_offset :u32,
-        pub si_flags :si_flags_t,
+        pub id: u16,
+        pub attributes: u16,
+        pub page_count: u32,
+        pub rva: u64,
+        pub content_size: u32,
+        pub content_offset: u32,
+        pub si_flags: si_flags_t,
     }
 
     pub struct layout_group_t {
-        pub id :u16,
-        pub entry_count :u16,
-        pub load_times :u32,
-        pub load_step :u64,
-        pub reserved :[u32; 4],
+        pub id: u16,
+        pub entry_count: u16,
+        pub load_times: u32,
+        pub load_step: u64,
+        pub reserved: [u32; 4],
+    }
+
+    pub struct elrange_config_entry_t {
+        pub enclave_image_address: u64,
+        pub elrange_start_address: u64,
+        pub elrange_size: u64,
     }
 }
 
diff --git a/sgx_types/src/types.rs b/sgx_types/src/types.rs
index 1b7d53b..78d218f 100644
--- a/sgx_types/src/types.rs
+++ b/sgx_types/src/types.rs
@@ -1259,6 +1259,18 @@ pub struct sgx_ql_qve_collateral_t {
     pub qe_identity_size: uint32_t,
 }
 
+/* intel DCAP 2.14 */
+impl_enum! {
+    #[repr(u32)]
+    #[derive(Copy, Clone, PartialEq, Eq, Debug)]
+    pub enum sgx_ql_log_level_t {
+        SGX_QL_LOG_ERROR  = 0,
+        SGX_QL_LOG_INFO   = 1,
+    }
+}
+
+pub type sgx_ql_logging_callback_t = extern "C" fn(level: sgx_ql_log_level_t, 
message: *const c_char);
+
 //
 // sgx_quote_3.h
 //

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to