28#define MAX_CERT_TYPE_LISTS_SIZE 256
29#define HS_DOWNGRADE_RANDOM_SIZE 8u
31#define HITLS_CLIENT_HELLO_MAX_SIZE 131396
32#define HITLS_SERVER_HELLO_MAX_SIZE 65607
33#define HITLS_HELLO_VERIFY_REQUEST_MAX_SIZE 258
34#define HITLS_END_OF_EARLY_DATA_MAX_SIZE 0
35#define HITLS_HELLO_RETRY_REQUEST_MAX_SIZE 20000
36#define HITLS_ENCRYPTED_EXTENSIONS_MAX_SIZE 20000
37#define HITLS_SESSION_TICKET_MAX_SIZE_TLS13 131338
38#define HITLS_SESSION_TICKET_MAX_SIZE_TLS12 65541
39#define HITLS_SERVER_KEY_EXCH_MAX_SIZE 102400
40#define HITLS_SERVER_HELLO_DONE_MAX_SIZE 0
41#define HITLS_KEY_UPDATE_MAX_SIZE 1
42#define HITLS_CLIENT_KEY_EXCH_MAX_SIZE 2048
43#define HITLS_NEXT_PROTO_MAX_SIZE 514
44#define HITLS_FINISHED_MAX_SIZE 64
45#define HITLS_HELLO_REQUEST_MAX_SIZE 0
47enum HITLS_CryptInfoCmd {
48 HITLS_CRYPT_INFO_CMD_GET_PUBLIC_KEY_LEN = 0,
49 HITLS_CRYPT_INFO_CMD_GET_SHARED_KEY_LEN,
50 HITLS_CRYPT_INFO_CMD_GET_CIPHERTEXT_LEN,
51 HITLS_CRYPT_INFO_CMD_GET_HASH_LEN,
61const uint8_t *HS_GetHrrRandom(uint32_t *len);
63const uint8_t *HS_GetTls12DowngradeRandom(uint32_t *len);
72const char *HS_GetMsgTypeStr(HS_MsgType type);
81int32_t HS_ChangeState(TLS_Ctx *ctx, uint32_t nextState);
96int32_t HS_CombineRandom(
const uint8_t *random1,
const uint8_t *random2, uint32_t randomSize,
97 uint8_t *dest, uint32_t destSize);
109uint8_t *HS_PrepareSignData(
const TLS_Ctx *ctx,
const uint8_t *partSignData,
110 uint32_t partSignDataLen, uint32_t *signDataLen);
121uint8_t *HS_PrepareSignDataTlcp(
122 const TLS_Ctx *ctx,
const uint8_t *partSignData, uint32_t partSignDataLen, uint32_t *signDataLen);
124#if defined(HITLS_TLS_PROTO_DTLS12) && defined(HITLS_BSL_UIO_SCTP)
136int32_t HS_SetSctpAuthKey(TLS_Ctx *ctx);
146int32_t HS_ActiveSctpAuthKey(TLS_Ctx *ctx);
157int32_t HS_DeletePreviousSctpAuthKey(TLS_Ctx *ctx);
160bool IsNeedServerKeyExchange(
const TLS_Ctx *ctx);
162bool IsPskNegotiation(
const TLS_Ctx *ctx);
164bool IsNeedCertPrepare(
const CipherSuiteInfo *cipherSuiteInfo);
166bool IsTicketSupport(
const TLS_Ctx *ctx);
168int32_t CheckClientPsk(TLS_Ctx *ctx);
179int32_t HS_ReSizeMsgBuf(TLS_Ctx *ctx, uint32_t msgSize);
192int32_t HS_GrowMsgBuf(TLS_Ctx *ctx, uint32_t msgSize,
bool keepOldData);
202uint32_t HS_MaxMessageSize(TLS_Ctx *ctx, HS_MsgType type);
212uint32_t HS_GetBinderLen(HITLS_Session *session, HITLS_HashAlgo* hashAlg);
222bool GroupConformToVersion(
const TLS_Ctx *ctx, uint16_t version, uint16_t group);
233bool IsCipherSuiteAllowed(
const HITLS_Ctx *ctx, uint16_t cipherSuite,
bool checkNegoVersion);
235uint16_t *CheckSupportSignAlgorithms(
const TLS_Ctx *ctx,
const uint16_t *signAlgorithms,
236 uint32_t signAlgorithmsSize, uint32_t *newSignAlgorithmsSize);
238uint32_t HS_GetExtensionTypeId(uint32_t hsExtensionsType);
240int32_t HS_CheckReceivedExtension(
HITLS_Ctx *ctx, HS_MsgType hsType, uint64_t hsMsgExtensionsMask,
241 uint64_t hsMsgAllowedExtensionsMask);
253uint32_t HS_GetCryptLength(
const TLS_Ctx *ctx, int32_t cmd, int32_t param);
HITLS_SignHashAlgo
Certificate Signature Algorithm Enumeration
定义 hitls_cert_type.h:177
HITLS_CERT_KeyType
Certificate Public Key Type
定义 hitls_cert_type.h:162
struct TlsCtx HITLS_Ctx
HITLS context
定义 hitls_type.h:35