-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
Support TLS 1.3 post handshake auth in trio.ssl #741
Comments
The API for this should be considered alongside #198, which is about the way renegotiation/post-handshake-auth create nasty issues for Also, this appears to be the only openssl man page that discusses post-handshake auth: https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_verify.html Anyway, on further investigation, I suspect the way the
I'm not certain of anything I just said, so it should all be checked. If it is correct, then I guess we want to do something like: Client side: enabling post-handshake auth is generally an opt-in thing in TLS 1.3 and in the openssl and Python stdlib APIs, so it can/should be opt-in for us too. This is a flag you set in the context, saying "yep, I'm prepared to handle post-handshake auth if the server requests it" (which then sets an extension flag in the handshake, etc.) Then when the server actually sends a post-handshake auth request: openssl/the stdlib don't provide any way for the client to examine the request and handle it in an async way. So, I guess we're just not going to support that, which means that We should strongly consider making renegotiation support opt-in as well. This is what BoringSSL and golang do, and it would help a lot with #198. It would also increase consistency between TLS 1.3 and TLS <1.3 – can we just have a single flag that controls both renegotiation support and post-handshake auth support? Important thing to check: TLS 1.3 also supports "rekeying". The basic form of rekeying is harmless: it just lets one side say "everything I send after this will be encrypted with a new key", so it doesn't trigger any weird send/receive interlocking by itself. BUT, a rekey message can also request that the peer also rekey. The way this is intended to work is, when we receive this message, we don't have to do anything except an internal "rekey requested" flag, and then the next time we're going to send some application data, at that point we do a rekey and send both the rekey message and the application data (encrypted with the new key) together. So in theory this shouldn't cause any problems with Server side: The server needs a way to send a post-auth handshake request. Something like I guess the simplest way to do this is: declare that after calling Server-side opt-in is a bit different from client-side opt-in. On the client, you have to include the extension right in the initial handshake, and then once you've set the flag, you have to be prepared to handle the CertificateRequest message at any moment, which changes the semantics of On the server, there is an opt-in flag called Warning: the stdlib uses a single flag that on the client means "opt-in to supporting post-handshake auth", and on the server means "don't request the client cert during the handshake". These are pretty different. Anyway, so on the server you probably don't care about setting that opt-in flag. What actually matters is whether you call This makes interaction between PHA and renegotiation more complicated on the server-side. If you don't want to deal with Also, since the So....... I think that means:
To actually implement opt-in renegotiation/PHA: we want to enable/disable Together, I think this means that it needs to be an option passed to the Another confusing thing: I don't understand what this issue is about at all: openssl/openssl#6933. It sounds like the issue is that when openssl clients were enabling PHA by default, then this caused problems in the Python test suite because suddenly the client cert wasn't available on the server side after handshake. But AFAICT, that should only happen if the server was setting |
http://www.watersprings.org/pub/id/draft-sullivan-tls-post-handshake-auth-00.html#rfc.section.1 mentions those use cases:
|
(From a past life where I was following this more closely,) that first bullet point in particular is a major use case for censorship circumvention through a CDN. (Note that Nick Sullivan (co-author of that post-handshake auth draft) works for Cloudflare, which stopped turning a blind eye to domain fronting a while ago.) |
This was recently added to the stdlib
ssl
APIs (in 3.8-dev, and also backported to the other -dev branches), so it should be a fairly straightforward matter of wrapping the new APIs: python/cpython#9460One thing I'm not clear on is how you trigger the post-handshake auth cycle if you don't want to commit to writing something immediately. (e.g., because what you decide to write will depend on the success/failure of the authentication.) Maybe you call
do_handshake
again? (If so then we need to provide a way to calldo_handshake
a second time!) Or does failure kill the connection, so it doesn't matter?The text was updated successfully, but these errors were encountered: