22#ifndef HITLS_CUSTOM_EXTENSIONS_H
23#define HITLS_CUSTOM_EXTENSIONS_H
26#include "hitls_type.h"
27#include "hitls_cert_type.h"
39#define HITLS_EX_TYPE_CLIENT_HELLO 0x00001
45#define HITLS_EX_TYPE_TLS1_2_SERVER_HELLO 0x00002
51#define HITLS_EX_TYPE_TLS1_3_SERVER_HELLO 0x00004
57#define HITLS_EX_TYPE_HELLO_RETRY_REQUEST 0x00008
63#define HITLS_EX_TYPE_ENCRYPTED_EXTENSIONS 0x00010
69#define HITLS_EX_TYPE_TLS1_3_CERTIFICATE 0x00020
75#define HITLS_EX_TYPE_TLS1_3_CERTIFICATE_REQUEST 0x00040
81#define HITLS_EX_TYPE_TLS1_3_NEW_SESSION_TICKET 0x00080
84#define HITLS_ADD_CUSTOM_EXTENSION_RET_PACK 1
85#define HITLS_ADD_CUSTOM_EXTENSION_RET_PASS HITLS_SUCCESS
109 uint32_t *outLen,
HITLS_CERT_X509 *cert, uint32_t certIndex, uint32_t *alert,
void *addArg);
124 uint8_t *out,
void *addArg);
145 const uint8_t **in, uint32_t *inLen,
HITLS_CERT_X509 *cert, uint32_t certIndex, uint32_t *alert,
void *parseArg);
void HITLS_CERT_X509
Describes the x509 certificate
定义 hitls_cert_type.h:37
uint32_t HITLS_AddCustomExtension(HITLS_Ctx *ctx, const HITLS_CustomExtParams *params)
Add a custom extension to the TLS context using a parameter structure.
void(* HITLS_FreeCustomExtCallback)(const HITLS_Ctx *ctx, uint16_t extType, uint32_t context, uint8_t *out, void *addArg)
Callback function to free a custom extension.
定义 hitls_custom_extensions.h:123
uint32_t HITLS_CFG_AddCustomExtension(HITLS_Config *config, const HITLS_CustomExtParams *params)
Add a custom extension to the HITLS configuration using a parameter structure.
int(* HITLS_ParseCustomExtCallback)(const HITLS_Ctx *ctx, uint16_t extType, uint32_t context, const uint8_t **in, uint32_t *inLen, HITLS_CERT_X509 *cert, uint32_t certIndex, uint32_t *alert, void *parseArg)
Callback function to parse a custom extension.
定义 hitls_custom_extensions.h:144
int(* HITLS_AddCustomExtCallback)(const HITLS_Ctx *ctx, uint16_t extType, uint32_t context, uint8_t **out, uint32_t *outLen, HITLS_CERT_X509 *cert, uint32_t certIndex, uint32_t *alert, void *addArg)
Callback function to add a custom extension.
定义 hitls_custom_extensions.h:108
struct TlsCtx HITLS_Ctx
HITLS context
定义 hitls_type.h:35
struct TlsConfig HITLS_Config
config context
定义 hitls_type.h:41
Structure to hold parameters for adding a custom extension.
定义 hitls_custom_extensions.h:152
HITLS_ParseCustomExtCallback parseCb
定义 hitls_custom_extensions.h:158
void * parseArg
定义 hitls_custom_extensions.h:159
uint32_t context
定义 hitls_custom_extensions.h:154
HITLS_FreeCustomExtCallback freeCb
定义 hitls_custom_extensions.h:156
void * addArg
定义 hitls_custom_extensions.h:157
uint16_t extType
定义 hitls_custom_extensions.h:153
HITLS_AddCustomExtCallback addCb
定义 hitls_custom_extensions.h:155