FIX: Some minor TLS bugs found along the way#3792
Merged
Conversation
For instance, if the provided certificate chain file does not contain any certificates. In this case the server was started regardless but segfaulted once the first client connected.
Previously, TLS::Callbacks::tls_modify_extensions() was called for an empty TLS::Extensions() object for each Certificate message entry. The passed-in empty Extensions object was then discarded.
My best guess: when calling 'push_back(std::nullopt)' the compiler somehow assumes that the wrapped (and uninitialized) OCSP::Response might be accessible -- resulting in an uninitialized read. Using 'emplace_back()' seems to not trigger this.
00482b4 to
999fc82
Compare
randombit
approved these changes
Nov 1, 2023
This file contains hidden or 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
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.
This fixes a few minor things I found while implementing RFC 7250 (#3771). Namely:
./botan tls_serveraborts when the provided certificate file doesn't contain any parsable certificatesTLS::Callbacks::tls_modify_extension()is called for each certificate_entry in TLS 1.3 (when creating a Certificate message), but the adaptions a use made were simply discardedmsg_certificate_13.cppthat bugged for quite some time now