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.
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
Fix and align ticket age check in ssl_ticket.c for TLS 1.2 and TLS 1.3 #8574
Fix and align ticket age check in ssl_ticket.c for TLS 1.2 and TLS 1.3 #8574
Changes from 12 commits
d1100b0
ce72763
3c3e2e6
e34f124
ba5165e
17ef8df
7b1921a
feb577a
d1c106c
c57f86e
3c0072b
40a4ab0
7fdee8b
c7fa82e
7b0ac0b
a93e25e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Info: why do it this way, rather than letting the ticket writing function query the current time if it wants? That would seem more natural to me.
If this was a session creation time used for multiple purposes, this approach would be necessary, since there would have to be a single point where the official session creation time is decided. But for the ticket creation time, the (single) ticket writing function is the natural place.
(I realize that this is not new from this pull request: it's from #6788, which isn't released yet, and which AFAICT wasn't part of the public API until this PR which exposes it via
mbedtls_ssl_session_get_ticket_creation_time
.)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.
First, thanks for the review.
One important point is that when using the ticket the TLS 1.3 server needs the
ticket_creation_time
, it cannot be only a ticket module data. Thus it means that theticket_creation_time
needs to be in the ticket data.In our implementation of
mbedtls_ssl_ticket_write_t
(and it is expected to be so in third party ones) the creation of the ticket data is based onmbedtls_ssl_session_save()
thus whenmbedtls_ssl_session_save()
is called theticket_creation_time
of thembedtls_ssl_session
structure must be set.We could do it in mbedtls_ssl_ticket_write() but it is not straightforward as the
session
input parameter is a const:const mbedtls_ssl_session *session
(we would need to copy the session ...). And if we do it that way with another implementation ofmbedtls_ssl_ticket_write_t
based onmbedtls_ssl_session_save()
we would not add theticket_creation_time
in the ticket data.