-
Notifications
You must be signed in to change notification settings - Fork 17.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
crypto/tls: tls client-side test recordings don't include the close notify message #69846
Labels
FixPending
Issues that have a fix which has not yet been reviewed or submitted.
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Comments
cc @FiloSottile @rolandshoemaker @golang/security |
cherrymui
added
the
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
label
Oct 11, 2024
I am working on submitting a fix for this in gerrit (will be Change-Id: I93898de32abd89659a32ed240df6daea5aeaa7fc). I just need to wait until I get an employer CLA agreement added to my account. |
Change https://go.dev/cl/620395 mentions this issue: |
dmitshur
added
NeedsFix
The path to resolution is known, but the work has not been done.
FixPending
Issues that have a fix which has not yet been reviewed or submitted.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Oct 16, 2024
adotkhan
pushed a commit
to Psiphon-Labs/psiphon-tls
that referenced
this issue
Nov 28, 2024
This commit fixes the issue where tls testdata recordings made with the newer version of the prerecorded tls conversation test harness, doesn't end up capturing the final close notify message. The fix simply ensures that the tls.Client closes before the recording of the conversation is closed. The closing of the client connection directly is no longer needed when updating the recording since it will be closed when the tls.Client is closed. Fixes golang/go#69846 Change-Id: I93898de32abd89659a32ed240df6daea5aeaa7fc Reviewed-on: https://go-review.googlesource.com/c/go/+/620395 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> Auto-Submit: Filippo Valsorda <filippo@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
FixPending
Issues that have a fix which has not yet been reviewed or submitted.
NeedsFix
The path to resolution is known, but the work has not been done.
Go version
go version devel go1.24-7f87b82955 Mon Sep 30 18:47:31 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I compiled go master from source by going into
src
and runningmake.bash
, after downloading, untarring, and setting my GOROOT_BOOTSTRAP to a Go 1.23.1 precompiled binary tarball for linux amd64. After compiling master and setting the PATH with the go/bin directory, I found the current openssl version to use for updating tls testdata in src/crypto/tls/handshake_test.go:85. From here I got the latest release source code for OpenSSL 1.1.1 which was 1.1.1w. Then I ran./Configure enable-weak-ssl-ciphers no-shared linux-x86_64
and thenmake
to compile. Testing the commandapps/openssl version
worked fine:Next I exported the PATH as stated in the comment in the Go code:
The test dependencies are all installed. Next I will try a test that should verify the bug.
Here are the steps for running the test that will cause the failure:
What did you see happen?
$ go version go version devel go1.24-7f87b82955 Mon Sep 30 18:47:31 2024 +0000 linux/amd64 $ go test crypto/tls -run=^TestHandshakeClientECDHEECDSAAESGCM$ -v === RUN TestHandshakeClientECDHEECDSAAESGCM === RUN TestHandshakeClientECDHEECDSAAESGCM/TLSv12 === PAUSE TestHandshakeClientECDHEECDSAAESGCM/TLSv12 === CONT TestHandshakeClientECDHEECDSAAESGCM/TLSv12 --- PASS: TestHandshakeClientECDHEECDSAAESGCM (0.00s) --- PASS: TestHandshakeClientECDHEECDSAAESGCM/TLSv12 (0.00s) PASS ok crypto/tls 0.018s
$ go test crypto/tls -v -update -run=^TestHandshakeClientECDHEECDSAAESGCM$ === RUN TestHandshakeClientECDHEECDSAAESGCM === RUN TestHandshakeClientECDHEECDSAAESGCM/TLSv12 handshake_client_test.go:307: failed to load data from testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM: open testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM: no such file or directory === RUN TestHandshakeClientECDHEECDSAAESGCM/TLSv12#update handshake_client_test.go:451: Wrote testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM --- FAIL: TestHandshakeClientECDHEECDSAAESGCM (0.13s) --- FAIL: TestHandshakeClientECDHEECDSAAESGCM/TLSv12 (0.00s) --- PASS: TestHandshakeClientECDHEECDSAAESGCM/TLSv12#update (0.13s) FAIL FAIL crypto/tls 0.144s FAIL
$ go test crypto/tls -v -run=^TestHandshakeClientECDHEECDSAAESGCM$ === RUN TestHandshakeClientECDHEECDSAAESGCM === RUN TestHandshakeClientECDHEECDSAAESGCM/TLSv12 === PAUSE TestHandshakeClientECDHEECDSAAESGCM/TLSv12 === CONT TestHandshakeClientECDHEECDSAAESGCM/TLSv12 handshake_test.go:263: expected read, got write --- FAIL: TestHandshakeClientECDHEECDSAAESGCM (0.00s) --- FAIL: TestHandshakeClientECDHEECDSAAESGCM/TLSv12 (0.00s) FAIL FAIL crypto/tls 0.017s FAIL
New recording without close notify
Old with close notify
What did you expect to see?
I expected the test to have succeeded with
ok
when running the test again (step 4) after rerecording the tls test in step 3. The messages in the tls recording should include the close notify record, meaning when the test is replaying the recording it should match properly on the final message when the deferredclient.Close()
call is occurring. This will mean that all the recorded messages will match and the test will succeed. Fixing this issue will fix this recording problem for all client handshake tests that use this recording test harness. This fix would likely need to be made in both master and release-branch.go1.23 to ensure that new recordings that need to be made in client tls handshake tests function properly.The text was updated successfully, but these errors were encountered: