-
Notifications
You must be signed in to change notification settings - Fork 456
CDRIVER-6045 Support TLS v1.3 in Secure Channel #2141
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
base: master
Are you sure you want to change the base?
CDRIVER-6045 Support TLS v1.3 in Secure Channel #2141
Conversation
6c60125
to
d3bb538
Compare
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.
Well done. LGTM with a memory leak fix and possible comment tweak.
|
||
secure_channel->recv_renegotiate = true; | ||
|
||
/* the tls handshake will pass the contents of SECBUFFER_EXTRA to the server */ |
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.
Suggest avoiding "to the server". I expect the call to InitializeSecurityContext
processes the received SECBUFFER_EXTRA
on the client.
/* the tls handshake will pass the contents of SECBUFFER_EXTRA to the server */ | |
/* mongoc_secure_channel_handshake_step_2 passes the received SECBUFFER_EXTRA to InitializeSecurityContext */ |
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.