-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d1100b0
Disable ticket module when useless
ronald-cron-arm ce72763
ssl_ticket.c: Remove client code
ronald-cron-arm 3c3e2e6
ssl_ticket.c: Remove TLS server guard
ronald-cron-arm e34f124
ssl_ticket.c: Remove pedantic server endpoint check
ronald-cron-arm ba5165e
ssl_ticket.c: Fix ticket lifetime enforcement
ronald-cron-arm 17ef8df
ssl_session: Define unconditionally the endpoint field
ronald-cron-arm 7b1921a
Add endpoint in TLS 1.2 session serialization data
ronald-cron-arm feb577a
Fix TLS 1.2 session serialization on server side
ronald-cron-arm d1c106c
Define ticket creation time in TLS 1.2 case as well
ronald-cron-arm c57f86e
Add ticket creation time to TLS 1.2 session serialization
ronald-cron-arm 3c0072b
ssl_ticket.c: Base ticket age check on the ticket creation time
ronald-cron-arm 40a4ab0
ssl_tls.c: Factorize save/load of endpoint and ciphersuite
ronald-cron-arm 7fdee8b
ssl_session: Reorder some fields to reduce padding
ronald-cron-arm c7fa82e
tests: ssl: Improve test parameter sanity check
ronald-cron-arm 7b0ac0b
Add change log for mbedtls_ssl_session_get_ticket_creation_time()
ronald-cron-arm a93e25e
tls12: Fix documentation of TLS 1.2 session serialized data
ronald-cron-arm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Features | ||
* Add getter (mbedtls_ssl_session_get_ticket_creation_time()) to access | ||
`mbedtls_ssl_session.ticket_creation_time`. |
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
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
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
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
Oops, something went wrong.
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.
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.