CDRIVER-6045 Support TLS v1.3 in Secure Channel #2141
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.
Summary
Follow up to #2118. Handles the
SEC_I_RENEGOTIATE
status received when TLS 1.3 is enabled with Windows Secure Channel.Background
Secure Channel with TLS 1.3 may use the renegotiate status for internal use; instructions on how to handle this are given in Windows documentation:
Note the C driver does not handle SEC_I_RENEGOTIATE for TLS 1.1 and 1.2.
Used libcurl as an implementation reference.
Changes
Upon receipt of SEC_I_RENEGOTIATE, the driver will pass the contents of
SECBUFFER_EXTRA
toInitializeSecurityContext
by callingmongoc_secure_channel_handshake_step_2
.In some cases, the data processed by a read may be completely consumed by the renegotiate handling. If this occurs and the read is non-blocking,
_mongoc_stream_tls_secure_channel_readv
will call read again to receive and decrypt the next message.Added some extra fields to
mongoc_stream_tls_secure_channel
to keep the necessary information in scope.