Struct sgx_tdh::SgxDhInitiator[][src]

pub struct SgxDhInitiator { /* fields omitted */ }

DH secure session Initiator

Methods

impl SgxDhInitiator
[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)

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.

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for SgxDhInitiator
[src]

Returns the "default value" for a type. Read more

impl ContiguousMemory for SgxDhInitiator
[src]

Auto Trait Implementations

impl Send for SgxDhInitiator

impl Sync for SgxDhInitiator