diff --git a/cryptobackend/backend_test.go b/cryptobackend/backend_test.go index 0af5d2dd3c..27ef32a21c 100644 --- a/cryptobackend/backend_test.go +++ b/cryptobackend/backend_test.go @@ -208,11 +208,10 @@ func requiredModuleVersionFromGoModPatch(patch []byte, modulePath string) (strin if !inGoMod { continue } - trimmed := strings.TrimSpace(line) - if !strings.HasPrefix(trimmed, "+") || strings.HasPrefix(trimmed, "+++") { + if line == "" || (line[0] != '+' && line[0] != ' ') || strings.HasPrefix(line, "+++") { continue } - fields := strings.Fields(strings.TrimPrefix(trimmed, "+")) + fields := strings.Fields(line[1:]) if len(fields) >= 2 && fields[0] == modulePath { return fields[1], true } @@ -220,6 +219,28 @@ func requiredModuleVersionFromGoModPatch(patch []byte, modulePath string) (strin return "", false } +func TestRequiredModuleVersionFromGoModPatch(t *testing.T) { + const modulePath = "example.com/module" + for _, test := range []struct { + name string + line string + want string + found bool + }{ + {"added", "+\texample.com/module v1.2.3", "v1.2.3", true}, + {"unchanged", " \texample.com/module v1.2.3", "v1.2.3", true}, + {"removed", "-\texample.com/module v1.2.3", "", false}, + } { + t.Run(test.name, func(t *testing.T) { + patch := []byte("diff --git a/src/go.mod b/src/go.mod\n" + test.line + "\n") + got, found := requiredModuleVersionFromGoModPatch(patch, modulePath) + if got != test.want || found != test.found { + t.Fatalf("requiredModuleVersionFromGoModPatch() = %q, %v; want %q, %v", got, found, test.want, test.found) + } + }) + } +} + type goModFile struct { Require []moduleRequirement } diff --git a/cryptobackend/go.mod b/cryptobackend/go.mod index 0eeb59e4bb..b2f5e97360 100644 --- a/cryptobackend/go.mod +++ b/cryptobackend/go.mod @@ -6,5 +6,5 @@ require ( github.com/microsoft/go-crypto-darwin v0.0.3-0.20260619075948-e554deeefa9f github.com/microsoft/go-crypto-openssl v0.5.0 github.com/microsoft/go-crypto-winnative v0.0.0-20260605073512-713d2add0825 - golang.org/x/crypto v0.54.1-0.20260714033321-10b54ffa51b1 + golang.org/x/crypto v0.55.0 ) diff --git a/cryptobackend/go.sum b/cryptobackend/go.sum index 28794e19a3..8b7d883a03 100644 --- a/cryptobackend/go.sum +++ b/cryptobackend/go.sum @@ -4,5 +4,5 @@ github.com/microsoft/go-crypto-openssl v0.5.0 h1:wTcBB5QN4YtsKcZdqWojL5pWIF/P+PV github.com/microsoft/go-crypto-openssl v0.5.0/go.mod h1:gJrjX+yWGi9pkbfPVDDh+ZbgjtQoRSXHjb/ZyjwKk34= github.com/microsoft/go-crypto-winnative v0.0.0-20260605073512-713d2add0825 h1:nmQ1K/L5GISW8UwbUwE376h3WXREEpREFdc3fNklcXc= github.com/microsoft/go-crypto-winnative v0.0.0-20260605073512-713d2add0825/go.mod h1:a1Z07CJIuWa8WT/pzFIGNTTKS96s8o1B1TPOziAHUxw= -golang.org/x/crypto v0.54.1-0.20260714033321-10b54ffa51b1 h1:vGPAn+SBeT/HVkWqXTwgapJgtGQJztG0WR0OTuHzMAI= -golang.org/x/crypto v0.54.1-0.20260714033321-10b54ffa51b1/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= +golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= +golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= diff --git a/go b/go index b751a977cb..98868423d6 160000 --- a/go +++ b/go @@ -1 +1 @@ -Subproject commit b751a977cb15f43599e541d38fa65df87a7f5a1b +Subproject commit 98868423d655cea2d9c2e1eaef5860ff3e6bbc45 diff --git a/patches/0001-Vendor-external-dependencies.patch b/patches/0001-Vendor-external-dependencies.patch index c36e26847c..e8148b03ef 100644 --- a/patches/0001-Vendor-external-dependencies.patch +++ b/patches/0001-Vendor-external-dependencies.patch @@ -34,7 +34,7 @@ Use a 'go' that was recently built by the current branch to ensure stable result .../microsoft/go-infra/telemetry/telemetry.go | 168 ++ src/cmd/vendor/modules.txt | 11 + src/crypto/deps_ignore.go | 40 + - src/go.mod | 14 +- + src/go.mod | 6 + src/go.sum | 6 + src/go/build/deps_test.go | 55 +- src/go/build/vendor_test.go | 5 + @@ -424,7 +424,7 @@ Use a 'go' that was recently built by the current branch to ensure stable result .../go/cryptobackend/tls13/tls13_openssl.go | 18 + .../go/cryptobackend/tls13/tls13_windows.go | 14 + src/vendor/modules.txt | 55 + - 416 files changed, 39757 insertions(+), 11 deletions(-) + 416 files changed, 39753 insertions(+), 7 deletions(-) create mode 100644 src/cmd/internal/telemetry/counter/deps_ignore.go create mode 100644 src/cmd/vendor/github.com/microsoft/go-infra/telemetry/LICENSE create mode 100644 src/cmd/vendor/github.com/microsoft/go-infra/telemetry/README.md @@ -835,7 +835,7 @@ Use a 'go' that was recently built by the current branch to ensure stable result create mode 100644 src/vendor/github.com/microsoft/go/cryptobackend/tls13/tls13_windows.go diff --git a/src/cmd/go.mod b/src/cmd/go.mod -index f55f0768249d4c..608aca7971a87e 100644 +index e027f1844b6320..25c1c1f46a694d 100644 --- a/src/cmd/go.mod +++ b/src/cmd/go.mod @@ -4,6 +4,8 @@ go 1.28 @@ -848,7 +848,7 @@ index f55f0768249d4c..608aca7971a87e 100644 golang.org/x/build v0.0.0-20260715183034-a43f90886f2e golang.org/x/mod v0.39.1-0.20260813190000-57549bfb0d25 diff --git a/src/cmd/go.sum b/src/cmd/go.sum -index b803eee2622670..f701430f92a369 100644 +index b8c1739e3e6f44..37e381d2d0087f 100644 --- a/src/cmd/go.sum +++ b/src/cmd/go.sum @@ -4,6 +4,10 @@ github.com/google/pprof v0.0.0-20260507013755-92041b743c96 h1:YDDnaZ9afWajDboPMt @@ -2674,7 +2674,7 @@ index 00000000000000..016de9bdd95956 + return filtered +} diff --git a/src/cmd/vendor/modules.txt b/src/cmd/vendor/modules.txt -index 843d5e7e81fd41..0ce155ac5b1c9c 100644 +index e6c95e5efe157a..9e01da71aba38e 100644 --- a/src/cmd/vendor/modules.txt +++ b/src/cmd/vendor/modules.txt @@ -16,6 +16,17 @@ github.com/google/pprof/third_party/svgpan @@ -2742,33 +2742,29 @@ index 00000000000000..d4671e1584dfa8 +// This file is here just to declare cryptobackend dependencies. +// This allows tracking their versions in a single patch file. diff --git a/src/go.mod b/src/go.mod -index d9c91d7b0dbcbb..437eb2862f0886 100644 +index 33b98ff2f7fb48..2f2d532941c534 100644 --- a/src/go.mod +++ b/src/go.mod @@ -3,11 +3,17 @@ module std go 1.28 require ( -- golang.org/x/crypto v0.54.1-0.20260714033321-10b54ffa51b1 -- golang.org/x/net v0.57.1-0.20260723204303-5a920b1a8090 -+ github.com/microsoft/go-crypto-darwin v0.0.3-0.20260619075948-e554deeefa9f // indirect -+ github.com/microsoft/go-crypto-openssl v0.5.1-0.20260813203406-afa6f0e831c4 // indirect -+ github.com/microsoft/go-crypto-winnative v0.0.0-20260821094543-418c3f76f8f8 // indirect -+ golang.org/x/sys v0.47.0 // indirect -+ golang.org/x/text v0.40.0 // indirect ++ github.com/microsoft/go/cryptobackend v0.0.0 + golang.org/x/crypto v0.55.0 + golang.org/x/net v0.58.1-0.20260825222430-bf481657f8f2 ) require ( -- golang.org/x/sys v0.47.0 // indirect -- golang.org/x/text v0.40.0 // indirect -+ github.com/microsoft/go/cryptobackend v0.0.0 -+ golang.org/x/crypto v0.54.1-0.20260714033321-10b54ffa51b1 -+ golang.org/x/net v0.57.1-0.20260723204303-5a920b1a8090 ++ github.com/microsoft/go-crypto-darwin v0.0.3-0.20260619075948-e554deeefa9f // indirect ++ github.com/microsoft/go-crypto-openssl v0.5.1-0.20260813203406-afa6f0e831c4 // indirect ++ github.com/microsoft/go-crypto-winnative v0.0.0-20260821094543-418c3f76f8f8 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/text v0.41.0 // indirect ) + +replace github.com/microsoft/go/cryptobackend => ../../cryptobackend diff --git a/src/go.sum b/src/go.sum -index 2d4171d08a2857..ff6ad0808a9225 100644 +index b59f19bd1159fa..3fe45636c3e06e 100644 --- a/src/go.sum +++ b/src/go.sum @@ -1,3 +1,9 @@ @@ -2778,11 +2774,11 @@ index 2d4171d08a2857..ff6ad0808a9225 100644 +github.com/microsoft/go-crypto-openssl v0.5.1-0.20260813203406-afa6f0e831c4/go.mod h1:gJrjX+yWGi9pkbfPVDDh+ZbgjtQoRSXHjb/ZyjwKk34= +github.com/microsoft/go-crypto-winnative v0.0.0-20260821094543-418c3f76f8f8 h1:lrmG+TKKulC+OpxnJNxPZB/J3/owDWbWrmjGXrjWLHs= +github.com/microsoft/go-crypto-winnative v0.0.0-20260821094543-418c3f76f8f8/go.mod h1:ic6qQ5ko8bzigvuQbGMknZ4WzS4/KDQ9cypGMdqn38s= - golang.org/x/crypto v0.54.1-0.20260714033321-10b54ffa51b1 h1:vGPAn+SBeT/HVkWqXTwgapJgtGQJztG0WR0OTuHzMAI= - golang.org/x/crypto v0.54.1-0.20260714033321-10b54ffa51b1/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= - golang.org/x/net v0.57.1-0.20260723204303-5a920b1a8090 h1:XtR9OCj3sl60bQa861zXyA2fXGYcpmj8o8fGZe8iCtQ= + golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= + golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= + golang.org/x/net v0.58.1-0.20260825222430-bf481657f8f2 h1:n/jj7rI7CnHyYBEod8I7aNr98XCOUcm0XtXzG3A0Lks= diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go -index 889ed76852e926..b47c346cc9c4ec 100644 +index 95893707c84200..4afadfae5ad7de 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -153,6 +153,13 @@ var depsRules = ` @@ -2799,7 +2795,7 @@ index 889ed76852e926..b47c346cc9c4ec 100644 # TIME is SYSCALL plus the core packages about time, including context. SYSCALL < time/tzdata -@@ -544,16 +551,46 @@ var depsRules = ` +@@ -545,16 +552,46 @@ var depsRules = ` NONE < crypto/internal/boring/sig, crypto/internal/boring/syso; sync/atomic < crypto/internal/boring/bcache; @@ -2851,7 +2847,7 @@ index 889ed76852e926..b47c346cc9c4ec 100644 < crypto/internal/boring < crypto/boring < crypto/internal/rand -@@ -579,6 +616,10 @@ var depsRules = ` +@@ -580,6 +617,10 @@ var depsRules = ` # CRYPTO-MATH is crypto that exposes math/big APIs - no cgo, net; fmt now ok. @@ -2862,7 +2858,7 @@ index 889ed76852e926..b47c346cc9c4ec 100644 CRYPTO, FMT, math/big, internal/saferio < crypto/internal/boring/bbig < crypto/internal/fips140cache -@@ -958,7 +999,7 @@ var buildIgnore = []byte("\n//go:build ignore") +@@ -959,7 +1000,7 @@ var buildIgnore = []byte("\n//go:build ignore") func findImports(pkg string) ([]string, error) { vpkg := pkg @@ -2871,7 +2867,7 @@ index 889ed76852e926..b47c346cc9c4ec 100644 vpkg = "vendor/" + pkg } dir := filepath.Join(Default.GOROOT, "src", vpkg) -@@ -968,7 +1009,7 @@ func findImports(pkg string) ([]string, error) { +@@ -969,7 +1010,7 @@ func findImports(pkg string) ([]string, error) { } var imports []string var haveImport = map[string]bool{} @@ -45389,7 +45385,7 @@ index 00000000000000..b7ffeea07c6b8d + panic("cryptobackend: not available") +} diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt -index 87a2fc95544420..c80d6261bb2a8c 100644 +index 244d13ef46538c..d0dbea0f9ffa11 100644 --- a/src/vendor/modules.txt +++ b/src/vendor/modules.txt @@ -1,3 +1,57 @@ @@ -45447,7 +45443,7 @@ index 87a2fc95544420..c80d6261bb2a8c 100644 +github.com/microsoft/go/cryptobackend/sha512 +github.com/microsoft/go/cryptobackend/tls12 +github.com/microsoft/go/cryptobackend/tls13 - # golang.org/x/crypto v0.54.1-0.20260714033321-10b54ffa51b1 + # golang.org/x/crypto v0.55.0 ## explicit; go 1.25.0 golang.org/x/crypto/chacha20 @@ -30,3 +84,4 @@ golang.org/x/text/secure/bidirule diff --git a/patches/0002-Add-crypto-backends.patch b/patches/0002-Add-crypto-backends.patch index 14fe386bf0..69b008231b 100644 --- a/patches/0002-Add-crypto-backends.patch +++ b/patches/0002-Add-crypto-backends.patch @@ -80,9 +80,9 @@ Subject: [PATCH] Add crypto backends src/crypto/internal/rand/rand.go | 8 +- src/crypto/md5/md5.go | 12 + src/crypto/md5/md5_test.go | 18 +- - src/crypto/mldsa/mldsa_fips140v1.26.go | 177 ++++++++++- + src/crypto/mldsa/mldsa_fips140v1.26.go | 181 ++++++++++- src/crypto/mldsa/mldsa_test.go | 67 +++- - src/crypto/mlkem/mlkem.go | 120 ++++++- + src/crypto/mlkem/mlkem.go | 121 ++++++- src/crypto/mlkem/mlkem_test.go | 8 + src/crypto/pbkdf2/pbkdf2.go | 9 + src/crypto/pbkdf2/pbkdf2_test.go | 6 +- @@ -122,7 +122,7 @@ Subject: [PATCH] Add crypto backends src/crypto/tls/prf_test.go | 9 + src/crypto/x509/verify_test.go | 2 +- src/go/build/buildbackend_test.go | 50 +++ - src/go/build/deps_test.go | 94 +++++- + src/go/build/deps_test.go | 97 +++++- .../build/testdata/backendtags_system/main.go | 3 + .../backendtags_system/systemcrypto.go | 3 + src/hash/example_test.go | 2 + @@ -138,7 +138,7 @@ Subject: [PATCH] Add crypto backends src/os/exec/exec_test.go | 9 + src/runtime/runtime_boring.go | 5 + src/syscall/syscall_windows.go | 3 + - 134 files changed, 2558 insertions(+), 375 deletions(-) + 134 files changed, 2562 insertions(+), 379 deletions(-) create mode 100644 src/cmd/go/systemcrypto_test.go create mode 100644 src/crypto/dsa/boring.go create mode 100644 src/crypto/dsa/notboring.go @@ -179,7 +179,7 @@ index f0e3575637c62a..9eab3b4e66e60b 100644 package main diff --git a/src/cmd/compile/internal/logopt/logopt_test.go b/src/cmd/compile/internal/logopt/logopt_test.go -index 89c4f66c7f39e2..fa68e4aa64b71d 100644 +index 1edabf9fb7ff04..5e9fc3507485bc 100644 --- a/src/cmd/compile/internal/logopt/logopt_test.go +++ b/src/cmd/compile/internal/logopt/logopt_test.go @@ -5,6 +5,7 @@ @@ -190,7 +190,7 @@ index 89c4f66c7f39e2..fa68e4aa64b71d 100644 "internal/testenv" "os" "path/filepath" -@@ -187,6 +188,10 @@ func s15a8(x *[15]int64) [15]int64 { +@@ -148,6 +149,10 @@ func s15a8(x *[15]int64) [15]int64 { goos0 := runtime.GOOS if runtime.GOARCH == "amd64" { // Test many things with "linux" (wasm will get "js") arches = []string{"arm", "arm64", "386", "amd64", "mips", "mips64", "loong64", "ppc64le", "riscv64", "s390x", "wasm"} @@ -241,10 +241,10 @@ index 9ec997a138f0f2..09c4e7955ec162 100644 testing.Verbose() diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go -index 814d978e363f8f..2e5627549a2cff 100644 +index efa22e016787c7..270985f22e8408 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go -@@ -1399,6 +1399,68 @@ func toolenv() []string { +@@ -1405,6 +1405,68 @@ func toolenv() []string { // still have full paths for stack traces for compiler crashes and the like. env = append(env, "GOFLAGS=-trimpath -ldflags=-w -gcflags=cmd/...=-dwarf=false") } @@ -313,7 +313,7 @@ index 814d978e363f8f..2e5627549a2cff 100644 return env } -@@ -1638,7 +1700,10 @@ func cmdbootstrap() { +@@ -1644,7 +1706,10 @@ func cmdbootstrap() { goInstall(toolenv(), goBootstrap, append([]string{"-a"}, toolsToInstall...)...) } @@ -598,7 +598,7 @@ index b305457a23d104..5154aa0be0007c 100644 Additional information available from 'go env' but not read from the environment: diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go -index 9a75e921c261da..c60c8e7be1769a 100644 +index bc693ce97cbe32..42187b10439f59 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -16,6 +16,7 @@ import ( @@ -618,7 +618,7 @@ index 9a75e921c261da..c60c8e7be1769a 100644 if !cfg.ModulesEnabled { buildMode = build.ImportComment } else { -@@ -935,7 +936,7 @@ func loadPackageData(ld *modload.Loader, ctx context.Context, path, parentPath, +@@ -949,7 +950,7 @@ func loadPackageData(ld *modload.Loader, ctx context.Context, path, parentPath, } if modroot != "" { if rp, err := modindex.GetPackage(modroot, r.dir); err == nil { @@ -627,7 +627,7 @@ index 9a75e921c261da..c60c8e7be1769a 100644 goto Happy } else if !errors.Is(err, modindex.ErrNotIndexed) { base.Fatal(err) -@@ -983,7 +984,8 @@ func loadPackageData(ld *modload.Loader, ctx context.Context, path, parentPath, +@@ -997,7 +998,8 @@ func loadPackageData(ld *modload.Loader, ctx context.Context, path, parentPath, // Not vendoring, or we already found the vendored path. buildMode |= build.IgnoreVendor } @@ -637,7 +637,7 @@ index 9a75e921c261da..c60c8e7be1769a 100644 } data.p.ImportPath = r.path -@@ -1008,6 +1010,42 @@ func loadPackageData(ld *modload.Loader, ctx context.Context, path, parentPath, +@@ -1022,6 +1024,42 @@ func loadPackageData(ld *modload.Loader, ctx context.Context, path, parentPath, return p, loaded, err } @@ -680,7 +680,7 @@ index 9a75e921c261da..c60c8e7be1769a 100644 // importSpec describes an import declaration in source code. It is used as a // cache key for resolvedImportCache. type importSpec struct { -@@ -1533,6 +1571,9 @@ func disallowInternal(ld *modload.Loader, ctx context.Context, srcDir string, im +@@ -1543,6 +1581,9 @@ func disallowInternal(ld *modload.Loader, ctx context.Context, srcDir string, im } goto Error } @@ -690,7 +690,7 @@ index 9a75e921c261da..c60c8e7be1769a 100644 if p.Module == nil { parent := p.Dir[:i+len(p.Dir)-len(p.ImportPath)] -@@ -2437,6 +2478,9 @@ func (p *Package) setBuildInfo(ctx context.Context, f *modfetch.Fetcher, autoVCS +@@ -2447,6 +2488,9 @@ func (p *Package) setBuildInfo(ctx context.Context, f *modfetch.Fetcher, autoVCS buildmode = "archive" } } @@ -3264,7 +3264,7 @@ index 674764b2121ebd..37aea88fb7fcf0 100644 func maybeCloner(h hash.Hash) any { diff --git a/src/crypto/mldsa/mldsa_fips140v1.26.go b/src/crypto/mldsa/mldsa_fips140v1.26.go -index d3ee1f0daec096..c37363dd9d2662 100644 +index d3ee1f0daec096..a59935af75687c 100644 --- a/src/crypto/mldsa/mldsa_fips140v1.26.go +++ b/src/crypto/mldsa/mldsa_fips140v1.26.go @@ -9,8 +9,13 @@ package mldsa @@ -3433,6 +3433,15 @@ index d3ee1f0daec096..c37363dd9d2662 100644 var errInvalidSignerOpts = errors.New("mldsa: invalid SignerOpts") // Sign returns a signature of the given message using this private key. +@@ -103,7 +218,7 @@ var errInvalidSignerOpts = errors.New("mldsa: invalid SignerOpts") + // + // [pre-hashed μ message representative]: https://www.rfc-editor.org/rfc/rfc9881.html#externalmu + func (sk *PrivateKey) Sign(_ io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) { +- if sk.k == (mldsa.PrivateKey{}) { ++ if sk.boring == nil && sk.k == (mldsa.PrivateKey{}) { + return nil, errors.New("mldsa: zero private key") + } + if opts == nil { @@ -115,9 +230,21 @@ func (sk *PrivateKey) Sign(_ io.Reader, message []byte, opts crypto.SignerOpts) if opts, ok := opts.(*Options); ok && opts != nil { context = opts.Context @@ -3548,7 +3557,14 @@ index d3ee1f0daec096..c37363dd9d2662 100644 switch pk.p.Parameters() { case "ML-DSA-44": return MLDSA44() -@@ -222,5 +390,8 @@ func Verify(pk *PublicKey, message []byte, signature []byte, opts *Options) erro +@@ -216,11 +384,14 @@ func Verify(pk *PublicKey, message []byte, signature []byte, opts *Options) erro + if pk == nil { + return errors.New("mldsa: nil public key") + } +- if pk.p == (mldsa.PublicKey{}) { ++ if pk.boring == nil && pk.p == (mldsa.PublicKey{}) { + return errors.New("mldsa: zero public key") + } if opts == nil { opts = &Options{} } @@ -3669,21 +3685,22 @@ index 0a2fc4edf11183..9c27ff51b27a4f 100644 t.Fatalf("NewPublicKey: %v", err) } diff --git a/src/crypto/mlkem/mlkem.go b/src/crypto/mlkem/mlkem.go -index f0fd6a4993a8e6..a3aea9e414b913 100644 +index f0fd6a4993a8e6..7b5b3ba7bbac09 100644 --- a/src/crypto/mlkem/mlkem.go +++ b/src/crypto/mlkem/mlkem.go -@@ -14,6 +14,10 @@ package mlkem +@@ -14,6 +14,11 @@ package mlkem import ( "crypto" "crypto/internal/fips140/mlkem" + "crypto/internal/rand" ++ cryptorand "crypto/rand" + + boring "github.com/microsoft/go/cryptobackend" + bmlkem "github.com/microsoft/go/cryptobackend/mlkem" ) const ( -@@ -36,38 +40,66 @@ const ( +@@ -36,38 +41,66 @@ const ( EncapsulationKeySize1024 = 1568 ) @@ -3697,11 +3714,11 @@ index f0fd6a4993a8e6..a3aea9e414b913 100644 +} + +func supportsBoringMLKEM768() bool { -+ return boring.Enabled && rand.IsDefaultReader(rand.Reader) && bmlkem.Supports768() ++ return boring.Enabled && rand.IsDefaultReader(cryptorand.Reader) && bmlkem.Supports768() +} + +func supportsBoringMLKEM1024() bool { -+ return boring.Enabled && rand.IsDefaultReader(rand.Reader) && bmlkem.Supports1024() ++ return boring.Enabled && rand.IsDefaultReader(cryptorand.Reader) && bmlkem.Supports1024() } // GenerateKey768 generates a new decapsulation key, drawing random bytes from @@ -3754,7 +3771,7 @@ index f0fd6a4993a8e6..a3aea9e414b913 100644 return dk.key.Bytes() } -@@ -79,13 +111,19 @@ func (dk *DecapsulationKey768) Bytes() []byte { +@@ -79,13 +112,19 @@ func (dk *DecapsulationKey768) Bytes() []byte { // // The shared key must be kept secret. func (dk *DecapsulationKey768) Decapsulate(ciphertext []byte) (sharedKey []byte, err error) { @@ -3775,7 +3792,7 @@ index f0fd6a4993a8e6..a3aea9e414b913 100644 } // Encapsulator returns the encapsulation key, like -@@ -101,22 +139,34 @@ var _ crypto.Decapsulator = (*DecapsulationKey768)(nil) +@@ -101,22 +140,34 @@ var _ crypto.Decapsulator = (*DecapsulationKey768)(nil) // An EncapsulationKey768 is the public key used to produce ciphertexts to be // decapsulated by the corresponding DecapsulationKey768. type EncapsulationKey768 struct { @@ -3812,7 +3829,7 @@ index f0fd6a4993a8e6..a3aea9e414b913 100644 return ek.key.Bytes() } -@@ -128,41 +178,64 @@ func (ek *EncapsulationKey768) Bytes() []byte { +@@ -128,41 +179,64 @@ func (ek *EncapsulationKey768) Bytes() []byte { // For testing, derandomized encapsulation is provided by the // [crypto/mlkem/mlkemtest] package. func (ek *EncapsulationKey768) Encapsulate() (sharedKey, ciphertext []byte) { @@ -3880,7 +3897,7 @@ index f0fd6a4993a8e6..a3aea9e414b913 100644 return dk.key.Bytes() } -@@ -174,13 +247,19 @@ func (dk *DecapsulationKey1024) Bytes() []byte { +@@ -174,13 +248,19 @@ func (dk *DecapsulationKey1024) Bytes() []byte { // // The shared key must be kept secret. func (dk *DecapsulationKey1024) Decapsulate(ciphertext []byte) (sharedKey []byte, err error) { @@ -3901,7 +3918,7 @@ index f0fd6a4993a8e6..a3aea9e414b913 100644 } // Encapsulator returns the encapsulation key, like -@@ -196,22 +275,34 @@ var _ crypto.Decapsulator = (*DecapsulationKey1024)(nil) +@@ -196,22 +276,34 @@ var _ crypto.Decapsulator = (*DecapsulationKey1024)(nil) // An EncapsulationKey1024 is the public key used to produce ciphertexts to be // decapsulated by the corresponding DecapsulationKey1024. type EncapsulationKey1024 struct { @@ -3938,7 +3955,7 @@ index f0fd6a4993a8e6..a3aea9e414b913 100644 return ek.key.Bytes() } -@@ -223,5 +314,8 @@ func (ek *EncapsulationKey1024) Bytes() []byte { +@@ -223,5 +315,8 @@ func (ek *EncapsulationKey1024) Bytes() []byte { // For testing, derandomized encapsulation is provided by the // [crypto/mlkem/mlkemtest] package. func (ek *EncapsulationKey1024) Encapsulate() (sharedKey, ciphertext []byte) { @@ -5983,7 +6000,7 @@ index 2c96e2435ae156..7fcab7bf82f618 100644 if err != nil { return nil diff --git a/src/crypto/tls/handshake_test.go b/src/crypto/tls/handshake_test.go -index a3478d120672bb..85f7ce951bb175 100644 +index bb98b11126dd65..c50ebe43f74f46 100644 --- a/src/crypto/tls/handshake_test.go +++ b/src/crypto/tls/handshake_test.go @@ -8,7 +8,6 @@ import ( @@ -6173,10 +6190,10 @@ index 00000000000000..ffb835ce34a2f7 + } +} diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go -index b47c346cc9c4ec..14358b226bb098 100644 +index 4afadfae5ad7de..77728ed043bb35 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go -@@ -375,8 +375,10 @@ var depsRules = ` +@@ -376,8 +376,10 @@ var depsRules = ` math/big, go/token < go/constant; @@ -6188,7 +6205,7 @@ index b47c346cc9c4ec..14358b226bb098 100644 # The vast majority of standard library packages should not be resorting to regexp. # go/types is a good chokepoint. It shouldn't use regexp, nor should anything -@@ -541,7 +543,7 @@ var depsRules = ` +@@ -542,7 +544,7 @@ var depsRules = ` < crypto/internal/fips140/edwards25519 < crypto/internal/fips140/ed25519 < crypto/internal/fips140/rsa @@ -6197,7 +6214,7 @@ index b47c346cc9c4ec..14358b226bb098 100644 crypto !< FIPS; -@@ -561,7 +563,20 @@ var depsRules = ` +@@ -562,7 +564,20 @@ var depsRules = ` < github.com/microsoft/go-crypto-winnative/internal/sysdll < github.com/microsoft/go-crypto-winnative/internal/bcrypt; @@ -6219,7 +6236,7 @@ index b47c346cc9c4ec..14358b226bb098 100644 < crypto/internal/fips140only < crypto < crypto/subtle -@@ -581,6 +596,50 @@ var depsRules = ` +@@ -582,6 +597,50 @@ var depsRules = ` github.com/microsoft/go-crypto-winnative/internal/bcrypt < github.com/microsoft/go-crypto-winnative/cng; @@ -6270,7 +6287,7 @@ index b47c346cc9c4ec..14358b226bb098 100644 FIPS, internal/godebug, embed, crypto/internal/boring/sig, crypto/internal/boring/syso, -@@ -588,7 +647,9 @@ var depsRules = ` +@@ -589,7 +648,9 @@ var depsRules = ` crypto/internal/fips140only, crypto, crypto/subtle, @@ -6281,7 +6298,14 @@ index b47c346cc9c4ec..14358b226bb098 100644 < crypto/sha3 < crypto/internal/fips140hash < crypto/internal/boring -@@ -612,6 +673,9 @@ var depsRules = ` +@@ -606,13 +667,15 @@ var depsRules = ` + crypto/hkdf, + crypto/pbkdf2, + crypto/ecdh, +- crypto/mlkem, + crypto/mldsa + < CRYPTO; + CRYPTO < golang.org/x/crypto/hkdf; @@ -6291,7 +6315,7 @@ index b47c346cc9c4ec..14358b226bb098 100644 CGO, fmt, net !< CRYPTO; # CRYPTO-MATH is crypto that exposes math/big APIs - no cgo, net; fmt now ok. -@@ -620,15 +684,28 @@ var depsRules = ` +@@ -621,15 +684,28 @@ var depsRules = ` math/big, github.com/microsoft/go-crypto-darwin/xcrypto < github.com/microsoft/go-crypto-darwin/bbig; math/big, github.com/microsoft/go-crypto-winnative/cng < github.com/microsoft/go-crypto-winnative/cng/bbig; @@ -6309,7 +6333,8 @@ index b47c346cc9c4ec..14358b226bb098 100644 + < github.com/microsoft/go/cryptobackend/bbig < crypto/internal/fips140cache < crypto/rand - < crypto/ed25519 # depends on crypto/rand.Reader +- < crypto/ed25519 # depends on crypto/rand.Reader ++ < crypto/ed25519, crypto/mlkem # depend on crypto/rand.Reader < encoding/asn1 < golang.org/x/crypto/cryptobyte/asn1 < golang.org/x/crypto/cryptobyte @@ -6323,7 +6348,7 @@ index b47c346cc9c4ec..14358b226bb098 100644 < crypto/ecdsa < CRYPTO-MATH; -@@ -662,7 +739,8 @@ var depsRules = ` +@@ -663,7 +739,8 @@ var depsRules = ` < crypto/hpke; CRYPTO-MATH, NET, container/list, encoding/hex, encoding/pem, crypto/hpke, @@ -6467,7 +6492,7 @@ index 2bbd478280241e..313e39edf7514c 100644 "v1.0.0", "v1.0.1", diff --git a/src/internal/buildcfg/exp.go b/src/internal/buildcfg/exp.go -index d075b0f7d360f2..dec7f0c1787b76 100644 +index cf9fa89497b992..e1dddce0e2a800 100644 --- a/src/internal/buildcfg/exp.go +++ b/src/internal/buildcfg/exp.go @@ -10,12 +10,14 @@ import ( @@ -6485,7 +6510,7 @@ index d075b0f7d360f2..dec7f0c1787b76 100644 baseline goexperiment.Flags } -@@ -129,6 +131,23 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) { +@@ -130,6 +132,23 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) { if strings.HasPrefix(f, "no") { f, val = f[2:], false } @@ -6509,7 +6534,7 @@ index d075b0f7d360f2..dec7f0c1787b76 100644 set, ok := names[f] if !ok { return nil, fmt.Errorf("unknown GOEXPERIMENT %s", f) -@@ -150,6 +169,9 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) { +@@ -151,6 +170,9 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) { if flags.RegabiArgs && !flags.RegabiWrappers { return nil, fmt.Errorf("GOEXPERIMENT regabiargs requires regabiwrappers") } diff --git a/patches/0008-Implement-ms_tls_config_schannel-experiment.patch b/patches/0008-Implement-ms_tls_config_schannel-experiment.patch index b9c7cb465f..1eaa388361 100644 --- a/patches/0008-Implement-ms_tls_config_schannel-experiment.patch +++ b/patches/0008-Implement-ms_tls_config_schannel-experiment.patch @@ -25,7 +25,7 @@ Subject: [PATCH] Implement ms_tls_config_schannel experiment create mode 100644 src/internal/goexperiment/exp_ms_tls_config_schannel_on.go diff --git a/src/crypto/tls/fips140_test.go b/src/crypto/tls/fips140_test.go -index c3f6ec917b5632..fa54d22ec65057 100644 +index 91dcafa8dd5ad0..545e4b4f965fa9 100644 --- a/src/crypto/tls/fips140_test.go +++ b/src/crypto/tls/fips140_test.go @@ -16,6 +16,7 @@ import ( @@ -36,7 +36,7 @@ index c3f6ec917b5632..fa54d22ec65057 100644 "internal/testenv" "math/big" "net" -@@ -67,6 +68,10 @@ func generateKeyShare(group CurveID) keyShare { +@@ -70,6 +71,10 @@ func generateKeyShare(group CurveID) keyShare { func TestFIPSServerProtocolVersion(t *testing.T) { test := func(t *testing.T, name string, v uint16, msg string) { t.Run(name, func(t *testing.T) { @@ -44,21 +44,21 @@ index c3f6ec917b5632..fa54d22ec65057 100644 + // Schannel may have disabled TLS 1.0 and 1.1. + t.Skip("skipping Schannel unsupported protocol version") + } - serverConfig := testConfigFIPS140.Clone() + serverConfig := testConfigFIPS140() serverConfig.MinVersion = VersionSSL30 serverConfig.MaxVersion = VersionTLS13 -@@ -195,6 +200,9 @@ func isFIPSSignatureScheme(alg SignatureScheme) bool { +@@ -198,6 +203,9 @@ func isFIPSSignatureScheme(alg SignatureScheme) bool { func TestFIPSServerCipherSuites(t *testing.T) { for _, id := range allCipherSuitesIncludingTLS13() { t.Run(fmt.Sprintf("suite=%s", CipherSuiteName(id)), func(t *testing.T) { + if goexperiment.MS_TLS_Config_Schannel && !isSchannelCipherSuite(id) { + t.Skip("skipping Schannel unsupported cipher suite") + } - serverConfig := testConfigFIPS140.Clone() + serverConfig := testConfigFIPS140() clientHello := &clientHelloMsg{ vers: VersionTLS12, diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go -index 64a668eae9b512..d8ac7f232590ca 100644 +index 42485f175c435f..671d19bf8f8379 100644 --- a/src/crypto/tls/handshake_client_test.go +++ b/src/crypto/tls/handshake_client_test.go @@ -20,6 +20,7 @@ import ( @@ -69,7 +69,7 @@ index 64a668eae9b512..d8ac7f232590ca 100644 "io" "math/big" "net" -@@ -2400,6 +2401,11 @@ func testGetClientCertificate(t *testing.T, version uint16) { +@@ -2427,6 +2428,11 @@ func testGetClientCertificate(t *testing.T, version uint16) { t.Logf("skipping test %d for FIPS mode", i) continue } @@ -81,7 +81,7 @@ index 64a668eae9b512..d8ac7f232590ca 100644 type serverResult struct { cs ConnectionState -@@ -2444,6 +2450,21 @@ func testGetClientCertificate(t *testing.T, version uint16) { +@@ -2471,6 +2477,21 @@ func testGetClientCertificate(t *testing.T, version uint16) { } } @@ -294,7 +294,7 @@ index 00000000000000..cccfb8866f88ab +} diff --git a/src/crypto/tls/schannel_windows_test.go b/src/crypto/tls/schannel_windows_test.go new file mode 100644 -index 00000000000000..c38f52f42fa26b +index 00000000000000..b0bfaefadc6f4e --- /dev/null +++ b/src/crypto/tls/schannel_windows_test.go @@ -0,0 +1,226 @@ @@ -411,7 +411,7 @@ index 00000000000000..c38f52f42fa26b + }, []uint16{VersionTLS12}, func() { + serverConfig := &Config{ + CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256}, -+ Certificates: testConfigServer.Certificates, ++ Certificates: testConfigServer().Certificates, + MaxVersion: VersionTLS12, + GetConfigForClient: func(chi *ClientHelloInfo) (*Config, error) { + if chi.CipherSuites[0] != TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 { @@ -440,7 +440,7 @@ index 00000000000000..c38f52f42fa26b + TLS_AES_256_GCM_SHA384, + }, []uint16{VersionTLS13}, func() { + serverConfig := &Config{ -+ Certificates: testConfigServer.Certificates, ++ Certificates: testConfigServer().Certificates, + } + clientConfig := &Config{ + InsecureSkipVerify: true, @@ -464,7 +464,7 @@ index 00000000000000..c38f52f42fa26b + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + }, []uint16{VersionTLS13, VersionTLS12}, func() { + serverConfig := &Config{ -+ Certificates: testConfigServer.Certificates, ++ Certificates: testConfigServer().Certificates, + MaxVersion: VersionTLS13, + } + clientConfig := &Config{ @@ -485,7 +485,7 @@ index 00000000000000..c38f52f42fa26b + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + }, []uint16{VersionTLS12}, func() { + serverConfig := &Config{ -+ Certificates: testConfigServer.Certificates, ++ Certificates: testConfigServer().Certificates, + } + clientConfig := &Config{ + InsecureSkipVerify: true, @@ -525,7 +525,7 @@ index 00000000000000..c38f52f42fa26b + } +} diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go -index 2bfb645e2c8e60..5edb2a19c1316e 100644 +index 296b8a7b8a9676..bb8ee4968ffe12 100644 --- a/src/crypto/tls/tls_test.go +++ b/src/crypto/tls/tls_test.go @@ -24,6 +24,7 @@ import ( @@ -536,7 +536,7 @@ index 2bfb645e2c8e60..5edb2a19c1316e 100644 "internal/testenv" "io" "math" -@@ -243,6 +244,11 @@ func skipFIPS(t *testing.T) { +@@ -251,6 +252,11 @@ func skipFIPS(t *testing.T) { if fips140tls.Required() { t.Skip("skipping test in FIPS mode") } @@ -548,7 +548,7 @@ index 2bfb645e2c8e60..5edb2a19c1316e 100644 } func TestDialTimeout(t *testing.T) { -@@ -1357,6 +1363,9 @@ func TestConnectionState(t *testing.T) { +@@ -1365,6 +1371,9 @@ func TestConnectionState(t *testing.T) { if !isFIPSVersion(v) && fips140tls.Required() { t.Skipf("skipping test in FIPS 140-3 mode for non-FIPS version %x", v) } @@ -558,7 +558,7 @@ index 2bfb645e2c8e60..5edb2a19c1316e 100644 var name string switch v { case VersionTLS10: -@@ -1605,6 +1614,11 @@ func TestClientHelloInfo_SupportsCertificate(t *testing.T) { +@@ -1613,6 +1622,11 @@ func TestClientHelloInfo_SupportsCertificate(t *testing.T) { }, "doesn't support ML-DSA"}, } for i, tt := range tests { @@ -570,7 +570,7 @@ index 2bfb645e2c8e60..5edb2a19c1316e 100644 err := tt.chi.SupportsCertificate(&tt.c) switch { case tt.wantErr == "" && err != nil: -@@ -1618,6 +1632,11 @@ func TestClientHelloInfo_SupportsCertificate(t *testing.T) { +@@ -1626,6 +1640,11 @@ func TestClientHelloInfo_SupportsCertificate(t *testing.T) { } func TestCipherSuites(t *testing.T) { @@ -611,7 +611,7 @@ index 00000000000000..a2dbc6187da2a0 +const MS_TLS_Config_Schannel = true +const MS_TLS_Config_SchannelInt = 1 diff --git a/src/internal/goexperiment/flags.go b/src/internal/goexperiment/flags.go -index 48f3c8f4060be8..8e16ada8b435b7 100644 +index 84a3d35266f871..412013e12800c5 100644 --- a/src/internal/goexperiment/flags.go +++ b/src/internal/goexperiment/flags.go @@ -55,6 +55,14 @@ package goexperiment diff --git a/patches/0010-Align-TLS-settings-with-Microsoft-policies.patch b/patches/0010-Align-TLS-settings-with-Microsoft-policies.patch index 2d42f4c565..15386d661f 100644 --- a/patches/0010-Align-TLS-settings-with-Microsoft-policies.patch +++ b/patches/0010-Align-TLS-settings-with-Microsoft-policies.patch @@ -41,7 +41,7 @@ index 144332729493c7..477856b077114c 100644 Go 1.25 added a new `decoratemappings` setting that controls whether the Go diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go -index dd4aaf546c6208..1b701b257dc01e 100644 +index 5f08beae07f129..7bf9d21264afd2 100644 --- a/src/crypto/tls/common.go +++ b/src/crypto/tls/common.go @@ -1204,7 +1204,14 @@ func (c *Config) cipherSuites(aesGCMPreferred bool) []uint16 { @@ -321,12 +321,12 @@ index ae1239f632380e..1fb12f7e379bdc 100644 if len(hello.supportedCurves) == 0 { diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go -index d8ac7f232590ca..cb418356d2887b 100644 +index 671d19bf8f8379..f1ef6541e3247b 100644 --- a/src/crypto/tls/handshake_client_test.go +++ b/src/crypto/tls/handshake_client_test.go -@@ -2722,9 +2722,20 @@ func testTLS13OnlyClientHelloCipherSuite(t *testing.T, ciphers []uint16) { +@@ -2749,9 +2749,20 @@ func testTLS13OnlyClientHelloCipherSuite(t *testing.T, ciphers []uint16) { serverConfig := &Config{ - Certificates: testConfigServer.Certificates, + Certificates: testConfigServer().Certificates, GetConfigForClient: func(chi *ClientHelloInfo) (*Config, error) { - expectedCiphersuites := defaultCipherSuitesTLS13NoAES - if fips140tls.Required() { @@ -382,7 +382,7 @@ index 7fcab7bf82f618..edb8c3b7b0a7c2 100644 for _, suiteID := range preferenceList { hs.suite = mutualCipherSuiteTLS13(hs.clientHello.cipherSuites, suiteID) diff --git a/src/crypto/tls/handshake_test.go b/src/crypto/tls/handshake_test.go -index 85f7ce951bb175..1a50a8bf39a958 100644 +index c50ebe43f74f46..3399c3efc919f6 100644 --- a/src/crypto/tls/handshake_test.go +++ b/src/crypto/tls/handshake_test.go @@ -453,6 +453,9 @@ func runMain(m *testing.M) int { @@ -397,7 +397,7 @@ index 85f7ce951bb175..1a50a8bf39a958 100644 if err != nil { diff --git a/src/crypto/tls/microsoft_test.go b/src/crypto/tls/microsoft_test.go new file mode 100644 -index 00000000000000..6ddb69f86edcd7 +index 00000000000000..a3ad32089a3751 --- /dev/null +++ b/src/crypto/tls/microsoft_test.go @@ -0,0 +1,489 @@ @@ -635,9 +635,9 @@ index 00000000000000..6ddb69f86edcd7 + }, + } + -+ baseClientConfig := testConfigClient.Clone() ++ baseClientConfig := testConfigClient() + baseClientConfig.CurvePreferences = nil -+ baseServerConfig := testConfigServer.Clone() ++ baseServerConfig := testConfigServer() + baseServerConfig.CurvePreferences = nil + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { @@ -712,10 +712,10 @@ index 00000000000000..6ddb69f86edcd7 + + t.Run("TLS13", func(t *testing.T) { + t.Parallel() -+ clientConfig := testConfigClient.Clone() ++ clientConfig := testConfigClient() + clientConfig.MaxVersion = VersionTLS13 + -+ serverConfig := testConfigServer.Clone() ++ serverConfig := testConfigServer() + serverConfig.MaxVersion = VersionTLS13 + + // Check cipher suite order in ClientHello @@ -767,10 +767,10 @@ index 00000000000000..6ddb69f86edcd7 + + t.Run("TLS12", func(t *testing.T) { + t.Parallel() -+ clientConfig := testConfigClient.Clone() ++ clientConfig := testConfigClient() + clientConfig.MaxVersion = VersionTLS12 + -+ serverConfig := testConfigServer.Clone() ++ serverConfig := testConfigServer() + serverConfig.MaxVersion = VersionTLS12 + + // For TLS 1.2, cipher suite ordering depends on hardware AES support. @@ -865,7 +865,7 @@ index 00000000000000..6ddb69f86edcd7 +} + +func testCipherSuitePreferenceOrder(t *testing.T, maxVersion uint16, expected uint16, client, server []uint16) { -+ serverConfig := testConfigServer.Clone() ++ serverConfig := testConfigServer() + serverConfig.MaxVersion = maxVersion + serverConfig.CipherSuites = server + serverConfig.GetConfigForClient = func(chi *ClientHelloInfo) (*Config, error) { @@ -874,7 +874,7 @@ index 00000000000000..6ddb69f86edcd7 + } + return nil, nil + } -+ clientConfig := testConfigClient.Clone() ++ clientConfig := testConfigClient() + clientConfig.CipherSuites = client + clientConfig.MaxVersion = maxVersion + clientConfig.InsecureSkipVerify = true