-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Implement TLS-Exporter #9421
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
Implement TLS-Exporter #9421
Conversation
7de124f to
d71386c
Compare
|
Sorry for the force-push. I forgot to sign off my latest commit, and there's no way to fix that with more commits. I can close and reopen this merge request, but first I'd like to ask for some help with implementing unit tests. |
8dd570e to
46e761e
Compare
a9085ea to
b2bb98f
Compare
|
@mfil Thanks for this very succinct and well-documented PR. @waleed-elmelegy-arm and I plan to do reviews over the next couple of months so we can try to get this merged. In the meantime, there are some merge conflicts (I think from the 3.6 release). Would you be able to resolve these? We aren't planning much work in this area of the code for a while, so it will be unlikely to bitrot again. |
b2bb98f to
bd94945
Compare
I've rebased onto develop, fixed some mistakes in the comments, and force-pushed. (Let me know if you prefer opening a new pull request.) I'll wait for reviews before changing the 3.6 backport pull request, ok? |
That sounds fine to me, thanks! I'll start the CI again, I seem to remember it failed the last time with a build error in some configurations. If you need a hand reproducing it let me know. |
Most of them make sense to me. In all_u16-check_names, it complains that |
|
@davidhorstmann-arm I think I fixed everything. Can you re-run the CI? |
|
I've started a CI run. |
Thank you! I'm stuck on getting the last tests to succeed. The TLS 1.2 Exporter needs client_random and server_random. If I'm seeing this correctly, if Would it be a problem to always have a |
|
I've started the CI on the updated PR |
|
Ok, the code style check is happy now, that still leaves my problem I mentioned above. |
b789256 to
8cd4456
Compare
|
I've fixed the merge conflict and added a commit that should fix the remaining CI failures. Please re-run the CI @davidhorstmann-arm @gilles-peskine-arm |
|
There's a 3.6 backport but it isn't up to date. @mfil @davidhorstmann-arm @waleed-elmelegy-arm Is there still interest in the 3.6 backport? Given the size of the code now, is it still ok for a long-term support branch? |
|
Having checked internally, it seems that we would still like to include this in Mbed TLS 3.6. @mfil Can you please update #9469 ? Since it hasn't been reviewed yet, please rebase it on top of the current head of |
|
The backport pull request is ready! |
Signed-off-by: Max Fillinger <[email protected]>
dba07e1
gilles-peskine-arm
left a comment
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.
davidhorstmann-arm
left a comment
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.
LGTM, thanks!
|
@mfil Thanks for all your work on this. Everything looks fine and the backport is approved, so I'll add it to the merge queue! |
|
Thanks @mfil for your PR and @davidhorstmann-arm, @gilles-peskine-arm, @tom-cosgrove-arm, @waleed-elmelegy-arm, @gowthamsk-arm: I have discovered this PR, it follows a part of my ticket here: So "tls-exporter" is now supported but "tls-unique" and "tls-server-end-point" are always missing. |
Description
This pull request implements the TLS-Exporter feature as defined in RFC 8446, Section 7.5 and RFC 5705.
TLS-Exporter allows the client and server to extract additional shared symmetric keys from the SSL context by inputting a label and a desired length for the key.
Currently, it is possible for library users to implement TLS-Exporter in TLS 1.2 by using
mbedtls_ssl_set_export_keys_cb()to obtain the master secret and then calculatembedtls_ssl_tls_prf(). It is not currently possible to do this for TLS 1.3. This pull request adds the functionmbedtls_ssl_export_keying_material()to implement TLS-Exporter in the library for both TLS 1.2 and 1.3.I have marked this pull request as "Draft" because I have not yet added any automated tests, and I would like some help in figuring out what would be the best way to add them. I have added options tossl_client2andssl_server2to print out the derived symmetric keys on the command line. I have checked that when connectingopenssl s_client(with the-keymatexportoption) tossl_server2, they both produce the same key.I have added a test for the TLS 1.3 Exporter. I could not find test vectors online, so I have taken the "exp master" key from RFC 8448 and used an online HMAC-SHA256 calculator to calculate the expected result. Additionally, I have added options to
ssl_client2andssl_server2to print out the derived symmetric keys on the command line. I have checked that when connectingopenssl s_client(with the-keymatexportoption) tossl_server2, they both export the same key.PR checklist
Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.