[−][src]Struct sgx_tdh::SgxDhInitiator
DH secure session Initiator
Methods
impl SgxDhInitiator
[src]
pub fn init_session() -> Self
[src]
Initialize DH secure session Initiator.
Indicates role of initiator the caller plays in the secure session establishment.
The value of role of the initiator of the session establishment must be SGX_DH_SESSION_INITIATOR
.
Requirements
Library: libsgx_tservice.a or libsgx_tservice_sim.a (simulation)
pub fn proc_msg1(&mut self, msg1: &SgxDhMsg1, msg2: &mut SgxDhMsg2) -> SgxError
[src]
The initiator of DH secure session establishment handles msg1 sent by responder and then generates msg2, and records initiator’s ECC key pair in DH session structure.
Requirements
Library: libsgx_tservice.a or libsgx_tservice_sim.a (simulation)
Parameters
msg1
Point to dh message 1 buffer generated by session responder, and the buffer must be in enclave address space.
msg2
Point to dh message 2 buffer, and the buffer must be in enclave address space.
Errors
SGX_ERROR_INVALID_PARAMETER
Any of the input parameters is incorrect.
SGX_ERROR_INVALID_STATE
The API is invoked in incorrect order or state.
SGX_ERROR_OUT_OF_MEMORY
The enclave is out of memory.
SGX_ERROR_UNEXPECTED
An unexpected error occurred.
pub fn proc_msg3(
&mut self,
msg3: &SgxDhMsg3,
aek: &mut sgx_key_128bit_t,
responder_identity: &mut sgx_dh_session_enclave_identity_t
) -> SgxError
[src]
&mut self,
msg3: &SgxDhMsg3,
aek: &mut sgx_key_128bit_t,
responder_identity: &mut sgx_dh_session_enclave_identity_t
) -> SgxError
The initiator handles msg3 sent by responder and then derives AEK, updates session information and gets responder’s identity information.
Requirements
Library: libsgx_tservice.a or libsgx_tservice_sim.a (simulation)
Parameters
msg3
Point to dh message 3 buffer generated by session responder, and the buffer must be in enclave address space.
aek
A pointer that points to instance of sgx_key_128bit_t. The aek is derived as follows:
KDK:= CMAC(key0, LittleEndian(gab x-coordinate)) AEK = AES-CMAC(KDK, 0x01||"AEK"||0x00||0x80||0x00)
The key0 used in the key extraction operation is 16 bytes of 0x00. The plain text used in the AES-CMAC calculation of the KDK is the Diffie-Hellman shared secret elliptic curve field element in Little Endian format. The plain text used in the AEK calculation includes:
-
a counter (0x01)
-
a label: the ASCII representation of the string 'AEK' in Little Endian format
-
a bit length (0x80)
responder_identity
Identity information of responder including isv svn, isv product id, the enclave attributes, MRSIGNER, and MRENCLAVE. The buffer must be in enclave address space. The caller should check the identity of the peer and decide whether to trust the peer and use the aek or the msg3_body.additional_prop field of msg3.
Errors
SGX_ERROR_INVALID_PARAMETER
Any of the input parameters is incorrect.
SGX_ERROR_INVALID_STATE
The API is invoked in incorrect order or state.
SGX_ERROR_OUT_OF_MEMORY
The enclave is out of memory.
SGX_ERROR_UNEXPECTED
An unexpected error occurred.
Trait Implementations
impl Copy for SgxDhInitiator
[src]
impl Clone for SgxDhInitiator
[src]
fn clone(&self) -> SgxDhInitiator
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for SgxDhInitiator
[src]
impl ContiguousMemory for SgxDhInitiator
[src]
Auto Trait Implementations
impl Send for SgxDhInitiator
impl Sync for SgxDhInitiator
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.