Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

TLS refactor #227

wants to merge 3 commits into from

Conversation

Zadamsa
Copy link
Contributor

@Zadamsa Zadamsa commented Nov 4, 2024

No description provided.

}
bool TLSParser::parse_tls_header() const noexcept
{
const auto* tls_header = (const TLSHeader*) m_packet_data;
Copy link
Contributor

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

Comment on lines +105 to +111
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;
}
Copy link
Contributor

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()) {
...
}

Comment on lines +118 to +119
const auto session_id_section_offset
= sizeof(TLSHeader) + sizeof(TLSHandshake) + TLS_RANDOM_BYTES_LENGTH;
Copy link
Contributor

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;
Copy link
Contributor

@SiskaPavel SiskaPavel Nov 8, 2024

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>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants