-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Test TLS 1.2 builds with each encryption type #6374
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
11c362a
Add component to build and test default config with stream cipher only
mprse 89ad623
Fix guards for mbedtls_ct_size_mask() and mbedtls_ct_memcpy_if_eq()
mprse a82290b
Fix guards for mbedtls_ssl_ticket_write() and mbedtls_ssl_ticket_pars…
mprse 6f29a6c
test_suite_cipher.function: always include aes.h
mprse 4c49927
Fix unused variables warnings in default + stream cipher only build
mprse d582a01
Make MBEDTLS_SSL_CONTEXT_SERIALIZATION dependent on AEAD
mprse e31ba83
Use basic symbols instead MBEDTLS_CIPHER_MODE_AEAD in check config
mprse 9550c05
Add component to build and test full config with stream cipher only
mprse b0de1c0
Add components to build and test default/full config with legacy-ccm …
mprse 0cc3466
Change testing strategy to default + one cypher only (psa/no psa)
mprse 68db0d2
Optimize one cipher only components and adapt nemes
mprse a891a09
test_suite_cmac.data: fix bug: use cipher type instead cipher id
mprse 8d4b241
Remove redundant indirect dependencies after optimizing setup for one…
mprse ce5b68c
Revert "Fix guards for mbedtls_ssl_ticket_write() and mbedtls_ssl_tic…
mprse 48a6a66
Add ssl-opt tls 1.2 tests for single cipher builds
mprse 460192e
Fix and sync configuration file and configuration verifiation
mprse 6a5cc74
Fix typos and comments
mprse 0957e7b
Rmove MBEDTLS_NIST_KW_C dependency from MBEDTLS_SSL_TICKET_C
mprse e32cd44
Add changelog entry: tls 1.2 builds with single encryption type
mprse 52a428b
Fix MBEDTLS_SSL_TICKET_C, MBEDTLS_SSL_SESSION_TICKETS dependencies
mprse 68a01a6
Fix session tickets related build flags in fuzz_server and ssl_server2
mprse 1f02c6c
Reword change log entry
mprse d61a4d3
Fix missing guard and double-space
mprse 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
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
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.
Hmm, sorry, can you remind me why
SSL_SESSION_TICKETS
, as opposed toSSL_TICKET_C
, has a dependency on AEAD? I'm afraid we might have done the wrong thing here (and I'm afraid it was based on a suggestion from me, sorry if that's the case.)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.
From the commit message:
Then
MBEDTLS_CIPHER_MODE_AEAD
was switched todefined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C)
as it couldn't be used incheck_config.h
.Then
MBEDTLS_NIST_KW_C
was removed.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.
mbedtls_cipher_auth_[encrypt/decrypt]ext()
functions depend onAEAD (MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C)
ssl_msg.c
(guarded withMBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C
) andssl_ticket.c
.SSL_SESSION_TICKETS
should depend onAEAD
(GCM || CCM || ChachaPoly
), but you refered toSSL_TICKET_C
(notSSL_SESSION_TICKETS
).MBEDTLS_SSL_SESSION_TICKETS
and withoutSSL_TICKET_C
. SoMBEDTLS_SSL_SESSION_TICKETS
also depends onGCM || CCM || ChachaPoly
.Summary:
For me it should be fixed as follows:
SSL_TICKET_C
depends onGCM || CCM || ChachaPoly
.MBEDTLS_SSL_SESSION_TICKETS
depends onSSL_TICKET_C
.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.
This approach seems right to me.
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.
Ah, thanks for looking into this. I agree with the first point:
SSL_TICKET_C
depends onGCM || CCM || ChachaPoly
but not with the second: the library should build and be usable withSSL_SESSION_TICKETS
enabled andSSL_TICKET_C
disabled. If that's not the case, then this is a build and should be fixed.The thing is,
SESSION_TICKETS
controls support for the RFC 5077 in the protocol: that is, the new Hello extensions, the new handshake message NewSessionTicket and the new logic to decide when to resume a session. That's all that's needed client-side. On the server side though, one more thing is needed: how to generate and unwrap session tickets, and handle the keys that are used to do so. The RFC doesn't say how this should be done, and there are multiple reasonable strategies for doing it, depending on your kind of deployment (do you use a single server or a pack that need to share keys?), so we leave that to the user, who has to provide callbacks withmbedtls_ssl_conf_session_tickets_cb()
(which depends only onSESSION_TICKETS && SRV_C
). We could leave it there, but that would force all users to write code for that even for the simplest of use cases, so instead we provide example callbacks that do the job for simple deployments, and that'sssl_ticket.c
/SSL_TICKET_C
. So, if you're not in the simple use case and took the time to write your own callbacks, you don't wantcheck_config.h
to forceSSL_TICKET_C
on you because you really don't need it.From what you wrote, I think things are fine in the library, but there are issues with
ssl_client2
,ssl_server2
and/or tests that use them. I think the goal is as follows:ssl_client2
should support ticket-based resumption with justSESSION_TICKETS
and that's it;ssl_server2
can rely onSSL_TICKET_C
for ticket-based resumption, because it needs an implementation of the callbacks, and it would be a bit pointless to write a second one here while the one in the library is perfectly suitable - so, perhaps a few guards there need to be changed fromSESSION_TICKETS
toSESSION_TICKETS && SSL_TICKET_C
(edited) (server and client are not symmetrical here);ssl-opt.sh
should have dependencies that reflect what they use: if they do ticket-based resumption betweenssl_client2
andopenssl s_server
for example, thenSESSION_TICKETS
is enough; if they do it between anything andssl_server2
thenSESSION_TICKETS && TICKET_C
(edited) is needed.Final note: there are two kinds of session resumption in TLS 1.2: the "basic" one using a cache, which used to be the only one, and it always enabled as it's part of the protocol, but on the server side requires the application to either use
SSL_CACHE_C
or write its own code (for example if the cache is to be shared between multiple servers, quite similarly toSSL_TICKET_C
), and the "new" one using tickets. All of the above is only about the new one :)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.
Ok but in this case
ssl_server2.c
should useMBEDTLS_SSL_SESSION_TICKETS && SSL_TICKET_C
guards. Linker undefined references: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.
Yes, indeed I think the current guards are wrong and
MBEDTLS_SSL_SESSION_TICKETS && SSL_TICKET_C
would be correct.