|
@ -25,9 +25,6 @@ |
|
|
|
|
|
|
|
|
#include "obfs.h" |
|
|
#include "obfs.h" |
|
|
|
|
|
|
|
|
#pragma pack(push) |
|
|
|
|
|
#pragma pack(1) |
|
|
|
|
|
|
|
|
|
|
|
struct tls_client_hello { |
|
|
struct tls_client_hello { |
|
|
char content_type; |
|
|
char content_type; |
|
|
short version; |
|
|
short version; |
|
@ -47,7 +44,7 @@ struct tls_client_hello { |
|
|
char comp_methods_len; |
|
|
char comp_methods_len; |
|
|
char comp_methods[1]; |
|
|
char comp_methods[1]; |
|
|
short ext_len; |
|
|
short ext_len; |
|
|
}; |
|
|
|
|
|
|
|
|
} __attribute__((packed)); |
|
|
|
|
|
|
|
|
struct tls_ext_server_name { |
|
|
struct tls_ext_server_name { |
|
|
short ext_type; |
|
|
short ext_type; |
|
@ -56,13 +53,13 @@ struct tls_ext_server_name { |
|
|
char server_name_type; |
|
|
char server_name_type; |
|
|
short server_name_len; |
|
|
short server_name_len; |
|
|
// char server_name[server_name_len]; |
|
|
// char server_name[server_name_len]; |
|
|
}; |
|
|
|
|
|
|
|
|
} __attribute__((packed)); |
|
|
|
|
|
|
|
|
struct tls_ext_session_ticket { |
|
|
struct tls_ext_session_ticket { |
|
|
short session_ticket_type; |
|
|
short session_ticket_type; |
|
|
short session_ticket_ext_len; |
|
|
short session_ticket_ext_len; |
|
|
// char session_ticket[session_ticket_ext_len]; |
|
|
// char session_ticket[session_ticket_ext_len]; |
|
|
}; |
|
|
|
|
|
|
|
|
} __attribute__((packed)); |
|
|
|
|
|
|
|
|
struct tls_ext_others { |
|
|
struct tls_ext_others { |
|
|
short ec_point_formats_ext_type; |
|
|
short ec_point_formats_ext_type; |
|
@ -85,7 +82,7 @@ struct tls_ext_others { |
|
|
|
|
|
|
|
|
short extended_master_secret_type; |
|
|
short extended_master_secret_type; |
|
|
short extended_master_secret_ext_len; |
|
|
short extended_master_secret_ext_len; |
|
|
}; |
|
|
|
|
|
|
|
|
} __attribute__((packed)); |
|
|
|
|
|
|
|
|
struct tls_server_hello { |
|
|
struct tls_server_hello { |
|
|
char content_type; |
|
|
char content_type; |
|
@ -116,21 +113,21 @@ struct tls_server_hello { |
|
|
short ec_point_formats_ext_len; |
|
|
short ec_point_formats_ext_len; |
|
|
char ec_point_formats_len; |
|
|
char ec_point_formats_len; |
|
|
char ec_point_formats[1]; |
|
|
char ec_point_formats[1]; |
|
|
}; |
|
|
|
|
|
|
|
|
} __attribute__((packed)); |
|
|
|
|
|
|
|
|
struct tls_change_cipher_spec { |
|
|
struct tls_change_cipher_spec { |
|
|
char content_type; |
|
|
char content_type; |
|
|
short version; |
|
|
short version; |
|
|
short len; |
|
|
short len; |
|
|
char msg; |
|
|
char msg; |
|
|
}; |
|
|
|
|
|
|
|
|
} __attribute__((packed)); |
|
|
|
|
|
|
|
|
struct tls_encrypted_handshake { |
|
|
struct tls_encrypted_handshake { |
|
|
char content_type; |
|
|
char content_type; |
|
|
short version; |
|
|
short version; |
|
|
short len; |
|
|
short len; |
|
|
// char msg[len]; |
|
|
// char msg[len]; |
|
|
}; |
|
|
|
|
|
|
|
|
} __attribute__((packed)); |
|
|
|
|
|
|
|
|
typedef struct frame { |
|
|
typedef struct frame { |
|
|
short idx; |
|
|
short idx; |
|
@ -138,8 +135,6 @@ typedef struct frame { |
|
|
char buf[2]; |
|
|
char buf[2]; |
|
|
} frame_t; |
|
|
} frame_t; |
|
|
|
|
|
|
|
|
#pragma pack(pop) |
|
|
|
|
|
|
|
|
|
|
|
extern obfs_para_t *obfs_tls; |
|
|
extern obfs_para_t *obfs_tls; |
|
|
|
|
|
|
|
|
#endif |
|
|
#endif |