1
0
mirror of https://github.com/golang/go synced 2024-11-22 08:44:41 -07:00

crypto/tls: add support for -expect-no-hrr to bogo_shim_test

The existing implementation of bogo_shim_test does not support tests
that use the expect-no-hrr flag. This change adds support for this flag.

Updates #51434

Change-Id: Iadb38fc2262783cab144a7b52904d0443e7fc2c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/594835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Russell Webb <russell.webb@protonmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
This commit is contained in:
Clide Stefani 2024-06-25 11:46:39 -04:00 committed by Gopher Robot
parent b3040679ad
commit 5881d857c5

View File

@ -54,6 +54,7 @@ var (
echConfigListB64 = flag.String("ech-config-list", "", "")
expectECHAccepted = flag.Bool("expect-ech-accept", false, "")
expectHRR = flag.Bool("expect-hrr", false, "")
expectNoHRR = flag.Bool("expect-no-hrr", false, "")
expectedECHRetryConfigs = flag.String("expect-ech-retry-configs", "", "")
expectNoECHRetryConfigs = flag.Bool("expect-no-ech-retry-configs", false, "")
onInitialExpectECHAccepted = flag.Bool("on-initial-expect-ech-accept", false, "")
@ -283,6 +284,10 @@ func bogoShim() {
log.Fatal("expected HRR but did not do it")
}
if *expectNoHRR && cs.testingOnlyDidHRR {
log.Fatal("expected no HRR but did do it")
}
if *expectSessionMiss && cs.DidResume {
log.Fatal("unexpected session resumption")
}