openHiTLS API openHiTLS 0.1.0-Alpha1

◆ HITLS_SetUserData()

int32_t HITLS_SetUserData ( HITLS_Ctx ctx,
void *  userData 
)

Save the user data in the HiTLS context, which can be obtained from the callback registered with the HiTLS.

Attention
must be called before HITLS_Connect and HITLS_Accept. The life cycle of the user data pointer must be greater than the life cycle of the TLS object.
If the user data needs to be cleared, the HITLS_SetUserData(ctx, NULL) interface can be called directly. The Clean interface is not provided separately.
Parameters
ctx[OUT] TLS connection handle.
userData[IN] Pointer to the user data.
Return values
HITLS_SUCCESS,ifsuccessful.
HITLS_NULL_INPUT,theTLS object pointer of the input parameter is null.