API参考
载入中...
搜索中...
未找到
parse_extensions.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
16#ifndef PARSE_EXTENSIONS_H
17#define PARSE_EXTENSIONS_H
18
19#include <stdint.h>
20#include "tls.h"
21#include "hs_msg.h"
22#include "parse_common.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
44int32_t ParseClientExtension(TLS_Ctx *ctx, const uint8_t *buf, uint32_t bufLen, ClientHelloMsg *msg);
45
51void CleanClientHelloExtension(ClientHelloMsg *msg);
52
70int32_t ParseServerExtension(TLS_Ctx *ctx, const uint8_t *buf, uint32_t bufLen, ServerHelloMsg *msg);
85int32_t ParseExHeader(TLS_Ctx *ctx, const uint8_t *buf, uint32_t bufLen, uint16_t *extMsgType, uint32_t *extMsgLen);
91void CleanServerHelloExtension(ServerHelloMsg *msg);
104int32_t ParseEmptyExtension(TLS_Ctx *ctx, uint16_t extMsgType, uint32_t extMsgLen, bool *haveExtension);
105
106int32_t ParseExCookie(const uint8_t *buf, uint32_t bufLen, uint8_t **cookie, uint16_t *cookieLen);
107
108int32_t ParseSecRenegoInfo(TLS_Ctx *ctx, const uint8_t *buf, uint32_t bufLen, uint8_t **secRenegoInfo,
109 uint8_t *secRenegoInfoSize);
110
111int32_t ParseRecordSizeLimit(TLS_Ctx *ctx, const uint8_t *buf, uint32_t bufLen,
112 bool *haveRecordSizeLimit, uint16_t *recordSizeLimit);
113
114int32_t ParseServerSelectedAlpnProtocol(
115 ParsePacket *pkt, bool *haveSelectedAlpn, uint8_t **alpnSelected, uint16_t *alpnSelectedSize);
116
126int32_t ParseDupExtProcess(TLS_Ctx *ctx, uint32_t logId, const void *format);
127
137int32_t ParseErrorExtLengthProcess(TLS_Ctx *ctx, uint32_t logId, const void *format);
138
139bool GetExtensionFlagValue(TLS_Ctx *ctx, uint32_t hsExTypeId);
140
141int32_t CheckForDuplicateExtension(ParsePacket *pkt, uint16_t *extMsgType, uint32_t *extMsgLen,
142 uint32_t *extensionId, uint64_t extensionTypeMask);
143#ifdef __cplusplus
144}
145#endif /* end __cplusplus */
146
147#endif /* end PARSE_EXTENSIONS_H */
定义 hs_msg.h:166
定义 parse_common.h:29
定义 hs_msg.h:191