-
Notifications
You must be signed in to change notification settings - Fork 26
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
(D)TLS fixes, especially certificate verification #128
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The SSL verification is used by TLS and DTLS, refactor to a separate translation unit.
Used version from systemd/systemd@90d5967 since the current upstream implementation via TAKE_GENERIC is not available here.
SSL_set_fd(3) does not consume the file descriptor.
The SSL context is currently unconditionally created during connect, while it is only destroyed in free. Move the initialization to init, since the context is independent from the individual connection.
SSL_write(3) does not set errno, but sets an internal error code. Also check for EAGAIN cases.
Avoid accidental TLS verification passed in ssl_verify_certificate_validity() due to a sockaddr_pretty() failure. Store the prettified string instead of the raw address struct.
Drop the mode NONE, since NO, DENY, WARN and ALLOW should cover all cases. Use DENY as default as its the most secure one, and users might expect applications to be secure by default. Failures are reported in the logs and can then be exempted by choosing a different option.
Currently SSL verification is broken as SSL_get_verify_result(3) is not supposed to be called in the verify callback, but afterwards. Thus currently the wrong error code is checked. Re-implement the callback similar to the example from SSL_set_verify(3).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See individual commits for more details.