This commit is contained in:
崔一鸣
2018-09-13 20:10:21 +08:00
committed by zhengchao
parent 6f525c96dd
commit e89ac9d9da
4 changed files with 331 additions and 154 deletions

View File

@@ -178,4 +178,31 @@ int ssl_tls_clienthello_parse(const unsigned char *, ssize_t, int,
int ssl_dnsname_match(const char *, size_t, const char *, size_t);
char * ssl_wildcardify(const char *);
enum parse_chello_result
{
PARSE_CHELLO_INVALID_FORMAT = 0,
PARSE_CHELLO_NOT_ENOUGH_BUFF,
PARSE_CHELLO_SUCCESS
};
struct ssl_version
{
uint8_t major;
uint8_t minor;
};
struct ssl_chello
{
struct ssl_version record_layer_version;
struct ssl_version chello_version;
char* sni;
char* alpn;
char* cipher_suites;
char* cipher_suites_tls13;
};
struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len, enum parse_chello_result* result);
void ssl_chello_free(struct ssl_chello* chello);
#endif /* !SSL_H */