-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLS refactor #227
base: master
Are you sure you want to change the base?
TLS refactor #227
Conversation
} | ||
bool TLSParser::parse_tls_header() const noexcept | ||
{ | ||
const auto* tls_header = (const TLSHeader*) m_packet_data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nepouzivej to C-style pretypovani
if ( sizeof(TLSHeader) + sizeof(TLSHandshake) > m_packet_length || | ||
!(handshake->type == TLS_HANDSHAKE_CLIENT_HELLO || handshake->type == TLS_HANDSHAKE_SERVER_HELLO) || | ||
handshake->version.major != 3 || | ||
handshake->version.minor < 1 || | ||
handshake->version.minor > 3) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tady ty podminky mi prijdou celkem extrem.
Co to treba rozdelit do neceho takove:
if (hasHandshakeType(...) {
...
}
if (hasRequiredVersion()) {
...
}
const auto session_id_section_offset | ||
= sizeof(TLSHeader) + sizeof(TLSHandshake) + TLS_RANDOM_BYTES_LENGTH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
takoveto vypocty mohou byt constexpr
std::vector<uint16_t> m_elliptic_curve_point_formats; | ||
std::vector<std::pair<const char*, uint16_t>> m_alpns; | ||
std::vector<uint16_t> m_supported_versions; | ||
std::vector<std::pair<const char*, uint16_t>> m_serverNames; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tady muzes pouzit std::vector<std::string_view>
misto std::vector<std::pair<const char*, uint16_t>>
No description provided.