-
Notifications
You must be signed in to change notification settings - Fork 143
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
refactor AEAD API following changes in QUIC draft-11 #138
Conversation
…tween TLS and QUIC
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.
I wrote my own key setting routines to match the QUIC specification. They call ptls_hkdf_expand() and aead->setup_crypto() for an aead context initialized with an algorithm. As long I these two APi are maintained, I am fine.
Of course there would be benefit in not having that code in Picoquic, but I need to better understand the intent of your API, and that's difficult to do from just the list of changes.
ptls_buffer_push16(&hkdf_label, (uint16_t)outlen); | ||
ptls_buffer_push_block(&hkdf_label, 1, { | ||
const char *base_label = "tls13 "; | ||
ptls_buffer_pushv(&hkdf_label, base_label, strlen(base_label)); |
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.
Is this function meant to be generic, or specific to TLS13?
Sorry for not giving a technical summary of what the change is. I consider the From the change in draft-11, we have learnt that each protocol that uses an AEAD cipher might define its own key deviation function, rather than reusing the one defined in TLS 1.3. Therefore, we need to provide an API that looks like something that has been suggested in quicwg/base-drafts#1256 (review),
This PR makes such changes. Specifically:
|
I looked at the diff and the gist, but it's not clear to me how I would construct the cleartext secrets with these new functions? |
@larseggert Yeah it was not obvious. Regarding the gist, what you might do is just copy the two functions on the gist to your source code, and replace existing calls to
|
Yes, I managed to figure out how to use What I am missing is how to replace the call to |
@larseggert Ah. Now I see what you are asking for. Sorry for the confusion.
As an example, quicly is at -09 at the moment. I expect that I would be making a change like the following to support -11.
|
Thank you! That works great. So as far as I am concerned, this is fine to merge. |
Thank you for checking. Let's merge, now that we know it works. |
The AEAD API of picotls has been designed in hope that the only difference between the traffic key derivation functions of TLS 1.3 and QUIC will be the value of the base_label.
However, the function definition of QUIC has been changed recently, and draft-11 has shipped without reverting the change (see quicwg/base-drafts#1255).
This PR changes the AEAD API of picotls so that it would be easier for the users to implement draft-11-style AEAD, as well as removing the abstraction that is no longer necessary.
https://gist.github.com/kazuho/6ace6cb277e977b89f283be7631b977f contains a code snippet that can be used to create an AEAD context for QUIC draft-11.