API参考
载入中...
搜索中...
未找到
Hitls_psk

Basic functions for link establishment based on PSK 更多...

Hitls_psk 的协作图:

宏定义

#define HS_PSK_IDENTITY_MAX_LEN   256u
 PSK Maximum size of the identity message

类型定义

typedef uint32_t(* HITLS_PskClientCb) (HITLS_Ctx *ctx, const uint8_t *hint, uint8_t *identity, uint32_t maxIdentityLen, uint8_t *psk, uint32_t maxPskLen)
 Obtain the PSK prototype on the client.
typedef uint32_t(* HITLS_PskServerCb) (HITLS_Ctx *ctx, const uint8_t *identity, uint8_t *psk, uint32_t maxPskLen)
 Obtain the PSK prototype on the server.
typedef int32_t(* HITLS_PskFindSessionCb) (HITLS_Ctx *ctx, const uint8_t *identity, uint32_t identityLen, HITLS_Session **session)
 TLS1.3 server PSK negotiation callback
typedef int32_t(* HITLS_PskUseSessionCb) (HITLS_Ctx *ctx, uint32_t hashAlgo, const uint8_t **id, uint32_t *idLen, HITLS_Session **session)
 TLS1.3 client PSK negotiation callback

函数

int32_t HITLS_CFG_SetPskIdentityHint (HITLS_Config *config, const uint8_t *hint, uint32_t hintSize)
 Set the PSK prompt information for PSK negotiation.
int32_t HITLS_CFG_SetPskClientCallback (HITLS_Config *config, HITLS_PskClientCb callback)
 Set the PSK callback function on the client, which is used to obtain the identity and PSK during PSK negotiation.
int32_t HITLS_CFG_SetPskServerCallback (HITLS_Config *config, HITLS_PskServerCb callback)
 Set the PSK callback on the server, which is used to obtain the PSK during PSK negotiation.
int32_t HITLS_SetPskClientCallback (HITLS_Ctx *ctx, HITLS_PskClientCb cb)
 Set the PSK callback function on the client, which is used to obtain the identity and PSK during PSK negotiation.
int32_t HITLS_SetPskServerCallback (HITLS_Ctx *ctx, HITLS_PskServerCb cb)
 Set the PSK callback on the server, which is used to obtain the PSK during PSK negotiation.
int32_t HITLS_SetPskIdentityHint (HITLS_Ctx *ctx, const uint8_t *identityHint, uint32_t identityHintLen)
 Set the PSK identity hint on the server, which is used to provide identity hints for the client during PSK negotiation.
int32_t HITLS_CFG_SetPskFindSessionCallback (HITLS_Config *config, HITLS_PskFindSessionCb callback)
 Set the server callback, which is used to restore the PSK session of TLS1.3, cb can be NULL.
int32_t HITLS_CFG_SetPskUseSessionCallback (HITLS_Config *config, HITLS_PskUseSessionCb callback)
 Set the server callback, which is used to restore the PSK session of TLS1.3, cb can be NULL.
int32_t HITLS_SetPskFindSessionCallback (HITLS_Ctx *ctx, HITLS_PskFindSessionCb cb)
 Set the server callback, which is used to restore the PSK session of TLS1.3, cb can be NULL.
int32_t HITLS_SetPskUseSessionCallback (HITLS_Ctx *ctx, HITLS_PskUseSessionCb cb)
 Set the client callback, which is used to restore the PSK session of TLS1.3, cb can be NULL.

详细描述

Basic functions for link establishment based on PSK

类型定义说明

◆ HITLS_PskClientCb

typedef uint32_t(* HITLS_PskClientCb) (HITLS_Ctx *ctx, const uint8_t *hint, uint8_t *identity, uint32_t maxIdentityLen, uint8_t *psk, uint32_t maxPskLen)

Obtain the PSK prototype on the client.

参数
ctx[IN] Context.
hint[IN] Message.
identity[OUT] Identity information written back by the user.
maxIdentityLen[IN] Maximum length of the identity buffer.
psk[OUT] PSK information written back by the user.
maxPskLen[IN] Maximum length of the psk buffer.
返回
Return the PSK length.

◆ HITLS_PskFindSessionCb

typedef int32_t(* HITLS_PskFindSessionCb) (HITLS_Ctx *ctx, const uint8_t *identity, uint32_t identityLen, HITLS_Session **session)

TLS1.3 server PSK negotiation callback

参数
ctx[IN] ctx context
identity[OUT] Identity information
identityLen[OUT] Identity information length
session[OUT] session
返回
HITLS_PSK_FIND_SESSION_CB_SUCCESS, if successful. HITLS_PSK_FIND_SESSION_CB_FAIL, if failed

◆ HITLS_PskServerCb

typedef uint32_t(* HITLS_PskServerCb) (HITLS_Ctx *ctx, const uint8_t *identity, uint8_t *psk, uint32_t maxPskLen)

Obtain the PSK prototype on the server.

参数
ctx[IN] Context.
identity[IN] Identity information.
psk[OUT] PSK information written back by the user.
maxPskLen[IN] Maximum length of the psk buffer.
返回
Return the PSK length.

◆ HITLS_PskUseSessionCb

typedef int32_t(* HITLS_PskUseSessionCb) (HITLS_Ctx *ctx, uint32_t hashAlgo, const uint8_t **id, uint32_t *idLen, HITLS_Session **session)

TLS1.3 client PSK negotiation callback

参数
ctx[IN] ctx context
hashAlgo[IN] Hash algorithm
id[IN] Identity information
idLen[IN] Identity information length
session[OUT] session
返回
HITLS_PSK_USE_SESSION_CB_SUCCESS, if successful. HITLS_PSK_USE_SESSION_CB_FAIL, if failed

函数说明

◆ HITLS_CFG_SetPskClientCallback()

int32_t HITLS_CFG_SetPskClientCallback ( HITLS_Config * config,
HITLS_PskClientCb callback )

Set the PSK callback function on the client, which is used to obtain the identity and PSK during PSK negotiation.

参数
config[OUT] config Context
callback[IN] Client callback
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_SetPskFindSessionCallback()

int32_t HITLS_CFG_SetPskFindSessionCallback ( HITLS_Config * config,
HITLS_PskFindSessionCb callback )

Set the server callback, which is used to restore the PSK session of TLS1.3, cb can be NULL.

参数
ctx[OUT] TLS connection handle
callback[IN] Callback function
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_SetPskIdentityHint()

int32_t HITLS_CFG_SetPskIdentityHint ( HITLS_Config * config,
const uint8_t * hint,
uint32_t hintSize )

Set the PSK prompt information for PSK negotiation.

参数
config[OUT] config Context
hint[IN] Hint
hintSize[IN] Hint length
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_SetPskServerCallback()

int32_t HITLS_CFG_SetPskServerCallback ( HITLS_Config * config,
HITLS_PskServerCb callback )

Set the PSK callback on the server, which is used to obtain the PSK during PSK negotiation.

参数
config[OUT] config Context
callback[IN] Client callback
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_SetPskUseSessionCallback()

int32_t HITLS_CFG_SetPskUseSessionCallback ( HITLS_Config * config,
HITLS_PskUseSessionCb callback )

Set the server callback, which is used to restore the PSK session of TLS1.3, cb can be NULL.

参数
ctx[OUT] TLS connection handle
callback[IN] Callback function
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_SetPskClientCallback()

int32_t HITLS_SetPskClientCallback ( HITLS_Ctx * ctx,
HITLS_PskClientCb cb )

Set the PSK callback function on the client, which is used to obtain the identity and PSK during PSK negotiation.

参数
ctx[OUT] TLS connection handle
cb[IN] Client callback
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_SetPskFindSessionCallback()

int32_t HITLS_SetPskFindSessionCallback ( HITLS_Ctx * ctx,
HITLS_PskFindSessionCb cb )

Set the server callback, which is used to restore the PSK session of TLS1.3, cb can be NULL.

参数
ctx[OUT] TLS connection handle
cb[IN] Callback function
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_SetPskIdentityHint()

int32_t HITLS_SetPskIdentityHint ( HITLS_Ctx * ctx,
const uint8_t * identityHint,
uint32_t identityHintLen )

Set the PSK identity hint on the server, which is used to provide identity hints for the client during PSK negotiation.

参数
ctx[OUT] TLS connection handle
identityHint[IN] psk identity prompt
identityHineLen[IN] psk Length of the identity message
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_SetPskServerCallback()

int32_t HITLS_SetPskServerCallback ( HITLS_Ctx * ctx,
HITLS_PskServerCb cb )

Set the PSK callback on the server, which is used to obtain the PSK during PSK negotiation.

参数
ctx[OUT] TLS connection handle
cb[IN] Server callback
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_SetPskUseSessionCallback()

int32_t HITLS_SetPskUseSessionCallback ( HITLS_Ctx * ctx,
HITLS_PskUseSessionCb cb )

Set the client callback, which is used to restore the PSK session of TLS1.3, cb can be NULL.

参数
ctx[OUT] TLS connection handle
cb[IN] Callback function
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.