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

DTLS cookie generation and verification callbacks. 更多...

Hitls_cookie 的协作图:

类型定义

typedef int32_t(* HITLS_AppGenCookieCb) (HITLS_Ctx *ctx, uint8_t *cookie, uint32_t *cookieLen)
 Cookie callback prototype generated by the server.
typedef int32_t(* HITLS_AppVerifyCookieCb) (HITLS_Ctx *ctx, const uint8_t *cookie, uint32_t cookieLen)
 The server verifies the cookie callback prototype.

函数

int32_t HITLS_CFG_SetCookieGenCb (HITLS_Config *config, HITLS_AppGenCookieCb callback)
 Sets the callback for generating cookies on the server.
int32_t HITLS_CFG_SetCookieVerifyCb (HITLS_Config *config, HITLS_AppVerifyCookieCb callback)
 Set the cookie verification callback on the server.

详细描述

DTLS cookie generation and verification callbacks.

类型定义说明

◆ HITLS_AppGenCookieCb

typedef int32_t(* HITLS_AppGenCookieCb) (HITLS_Ctx *ctx, uint8_t *cookie, uint32_t *cookieLen)

Cookie callback prototype generated by the server.

参数
ctx[IN] Ctx context.
cookie[OUT] Cookie written back by the user.
cookieLen[OUT] Cookie length written back by the user.
返回
HITLS_COOKIE_GENERATE_SUCCESS, indicates that the generation is successful. HITLS_COOKIE_GENERATE_ERROR, indicates that the generation is failed.

◆ HITLS_AppVerifyCookieCb

typedef int32_t(* HITLS_AppVerifyCookieCb) (HITLS_Ctx *ctx, const uint8_t *cookie, uint32_t cookieLen)

The server verifies the cookie callback prototype.

参数
ctx[IN] Ctx context.
cookie[IN] Cookie received by the server.
cookieLen[IN] Cookie length received by the server.
返回
HITLS_COOKIE_VERIFY_SUCCESS, indicates that the verification is successful. HITLS_COOKIE_VERIFY_ERROR, indicates that the authentication fails.

函数说明

◆ HITLS_CFG_SetCookieGenCb()

int32_t HITLS_CFG_SetCookieGenCb ( HITLS_Config * config,
HITLS_AppGenCookieCb callback )

Sets the callback for generating cookies on the server.

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

◆ HITLS_CFG_SetCookieVerifyCb()

int32_t HITLS_CFG_SetCookieVerifyCb ( HITLS_Config * config,
HITLS_AppVerifyCookieCb callback )

Set the cookie verification callback on the server.

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