-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
SslMasterKeyHandler.WiresharkSslMasterKeyHandler key log feature failure with TLSv1.3 (exception throws) #10957
Comments
Hey -- sorry I've been busy. This dropped off my radar. Hmm from looking online: TLS v1.2 https://tools.ietf.org/html/rfc5246
TLS v1.3 https://tools.ietf.org/id/draft-ietf-tls-tls13-04.html
As for the boring-ssl callbacks, I considered that, i would have been way simpler! From what I've read they should be both 48 bytes. |
Here is an example about go-grpc, that capture according to https://gitlab.com/wireshark/wireshark/-/wikis/How-to-Export-TLS-Master-keys-of-gRPC#golang. That contains message of gRPC over HTTP2 over TLS1.3, and is able to be dissected correctly by wireshark. The key file format like:
But as far as I know, the TLS of golang is not implemented on openssl or boringssl. |
@fzakaria And more details about key-file refers to https://gitlab.com/wireshark/wireshark/-/blob/master/epan/dissectors/packet-tls-utils.c (from line.no 5924 to 5960). It seems TLS1.3 does not use format |
@fzakaria any ideas ? I think we could also add |
The easiest solution here at the moment may just be adding more documentation to the key handler; explaining it needs TLSv1 - 1.2. What do you think @normanmaurer ? When I wrote this implementation, the NSS keylog format for TLS 1.3 hadn't been published yet. |
(FWIW, I can't remember the OpenSSL bindings available to netty atm, but if we can get access to the client_random then that is a better emitted log -- ty @huangqiangxiong for the wireshark link) |
I don't catch what did you mean. Is this feature blocked by something? |
I find an alternative way to export TLS key materials in Java that is using jsslkeylog and replacing boringssl sslProvider with JDK built-in security Provider. I think some people may get help from it, so record it here https://gitlab.com/wireshark/wireshark/-/wikis/How-to-Export-TLS-Master-keys-of-gRPC#using-jsslkeylog |
I'd like to cast my vote for this suggestion:
I'm fighting a decryption bug right now and it'd be very helpful to capture incoming packets and attempt to decrypt them in Wireshark. We're using TLS1.3, though, so I can't do that without the keylog information. The other way this is handled is with a |
Hi, @daschl @fzakaria could you help to locate the bug about master key log feature with TLSv1.3?
Expected behavior
Exporting secret likes:
Actual behavior
Throw exception:
This bug also causes grpc/grpc-java#7724 merge (that is for grpc/grpc-java#7199) to be reverted.
Steps to reproduce
Enable TLS (default is TLS1.3 in current version), and enable master key log with SslMasterKeyHandler.newWireSharkSslMasterKeyHandler:
The exception will be throwed.
Minimal yet complete reproducer code (or URL to code)
To running the TLS server and client example code (that are modified based on official example):
netty-test.tar.gz
Run /netty-test/netty-http2-example/io/netty/example/http2/helloworld/server/Http2Server.java first,
and then run /netty-test/netty-http2-example/io/netty/example/http2/helloworld/client/Http2Client.java
You will get the exception.
But if you force to TLS1.2 by
The feature will work fine.
Since 4.1.52.Final is TLS1.3 enabled by default. Unlike TLS1.2, the length of master key in TLS1.3 seems to be 32 not 48, and the sessionId is also wrong to be empty.
Netty version
4.1.52.Final
JVM version (e.g.
java -version
)open jdk 1.8
OS version (e.g.
uname -a
)win10
The text was updated successfully, but these errors were encountered: