Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions cryptobackend/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,39 @@ 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
}
}
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
}
Expand Down
2 changes: 1 addition & 1 deletion cryptobackend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
4 changes: 2 additions & 2 deletions cryptobackend/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
2 changes: 1 addition & 1 deletion go
Submodule go updated 163 files
54 changes: 25 additions & 29 deletions patches/0001-Vendor-external-dependencies.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 @@
Expand All @@ -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 = `
Expand All @@ -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;

Expand Down Expand Up @@ -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.

Expand All @@ -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
Expand All @@ -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{}
Expand Down Expand Up @@ -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 @@
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading