From 6611df5356bdb55aa155863d8c47dd4fba7c4941 Mon Sep 17 00:00:00 2001 From: microsoft-golang-bot Date: Mon, 7 Oct 2024 23:25:38 +0000 Subject: [PATCH 1/2] Update submodule to latest master (356ba0f0): net: detect EAI_ADDRFAMILY for cgo host lookup on FreeBSD --- go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go b/go index 065c1359e1..356ba0f065 160000 --- a/go +++ b/go @@ -1 +1 @@ -Subproject commit 065c1359e1bc3d6744a925339484592b13d713dd +Subproject commit 356ba0f06586a833cd8de9c04af0d2adddf95851 From 6590cd50093d666051b9f5e323cfcc3199987851 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Tue, 8 Oct 2024 10:26:10 +0200 Subject: [PATCH 2/2] fix conflicts --- .../0002-Add-crypto-backend-foundation.patch | 32 +++++++++++++------ patches/0005-Add-CNG-crypto-backend.patch | 28 ++-------------- 2 files changed, 25 insertions(+), 35 deletions(-) diff --git a/patches/0002-Add-crypto-backend-foundation.patch b/patches/0002-Add-crypto-backend-foundation.patch index 3e2698ba41..3de70f202f 100644 --- a/patches/0002-Add-crypto-backend-foundation.patch +++ b/patches/0002-Add-crypto-backend-foundation.patch @@ -29,7 +29,8 @@ Subject: [PATCH] Add crypto backend foundation src/crypto/md5/md5.go | 7 + src/crypto/md5/md5_test.go | 4 + src/crypto/purego_test.go | 2 +- - src/crypto/rand/rand_unix.go | 2 +- + src/crypto/rand/rand.go | 2 +- + src/crypto/rand/rand_test.go | 2 +- src/crypto/rc4/rc4.go | 18 ++ src/crypto/rsa/boring.go | 4 +- src/crypto/rsa/notboring.go | 2 +- @@ -55,7 +56,7 @@ Subject: [PATCH] Add crypto backend foundation src/go/build/deps_test.go | 4 + src/net/smtp/smtp_test.go | 72 ++++--- src/runtime/runtime_boring.go | 5 + - 51 files changed, 790 insertions(+), 104 deletions(-) + 52 files changed, 791 insertions(+), 105 deletions(-) create mode 100644 src/crypto/ed25519/boring.go create mode 100644 src/crypto/ed25519/notboring.go create mode 100644 src/crypto/internal/backend/backend_test.go @@ -931,19 +932,32 @@ index 62be347e0c6822..d284b5cf7814a6 100644 continue } -diff --git a/src/crypto/rand/rand_unix.go b/src/crypto/rand/rand_unix.go -index 40fce36314adfa..1d6231ae91d5ae 100644 ---- a/src/crypto/rand/rand_unix.go -+++ b/src/crypto/rand/rand_unix.go -@@ -10,7 +10,7 @@ +diff --git a/src/crypto/rand/rand.go b/src/crypto/rand/rand.go +index 7c18d595c2eeaa..6750262c4241e5 100644 +--- a/src/crypto/rand/rand.go ++++ b/src/crypto/rand/rand.go +@@ -7,7 +7,7 @@ package rand import ( - "crypto/internal/boring" + boring "crypto/internal/backend" - "errors" + "internal/godebug" "io" "os" +diff --git a/src/crypto/rand/rand_test.go b/src/crypto/rand/rand_test.go +index 2372413279dafe..55e68ed21ca68e 100644 +--- a/src/crypto/rand/rand_test.go ++++ b/src/crypto/rand/rand_test.go +@@ -7,7 +7,7 @@ package rand + import ( + "bytes" + "compress/flate" +- "crypto/internal/boring" ++ boring "crypto/internal/backend" + "errors" + "internal/race" + "internal/testenv" diff --git a/src/crypto/rc4/rc4.go b/src/crypto/rc4/rc4.go index 67452ec39f0fd4..47726d0ebe38d9 100644 --- a/src/crypto/rc4/rc4.go @@ -1720,7 +1734,7 @@ index 319ac61f49c994..1b2454dbaab264 100644 t.Helper() k, err := rsa.GenerateKey(rand.Reader, size) diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go -index e233535f752dfc..6b023f055b24ea 100644 +index 3adc26ae2b6e29..f05cec9d7c3253 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -447,7 +447,9 @@ var depsRules = ` diff --git a/patches/0005-Add-CNG-crypto-backend.patch b/patches/0005-Add-CNG-crypto-backend.patch index 14ee01ca9e..c9384e3853 100644 --- a/patches/0005-Add-CNG-crypto-backend.patch +++ b/patches/0005-Add-CNG-crypto-backend.patch @@ -18,7 +18,6 @@ Subject: [PATCH] Add CNG crypto backend src/crypto/internal/boring/fipstls/stub.s | 2 +- src/crypto/internal/boring/fipstls/tls.go | 2 +- src/crypto/md5/md5_test.go | 7 + - src/crypto/rand/rand_windows.go | 9 +- src/crypto/rsa/boring.go | 2 +- src/crypto/rsa/boring_test.go | 2 +- src/crypto/rsa/notboring.go | 2 +- @@ -48,7 +47,7 @@ Subject: [PATCH] Add CNG crypto backend .../goexperiment/exp_cngcrypto_off.go | 9 + src/internal/goexperiment/exp_cngcrypto_on.go | 9 + src/internal/goexperiment/flags.go | 1 + - 44 files changed, 452 insertions(+), 33 deletions(-) + 43 files changed, 444 insertions(+), 32 deletions(-) create mode 100644 src/crypto/ecdsa/badlinkname.go create mode 100644 src/crypto/internal/backend/bbig/big_cng.go create mode 100644 src/crypto/internal/backend/cng_windows.go @@ -576,29 +575,6 @@ index 3a973eebd284a4..5e24e07e2787e2 100644 for i, test := range largeUnmarshalTests { h := New() -diff --git a/src/crypto/rand/rand_windows.go b/src/crypto/rand/rand_windows.go -index 7380f1f0f1e6e6..35318d8fa67336 100644 ---- a/src/crypto/rand/rand_windows.go -+++ b/src/crypto/rand/rand_windows.go -@@ -8,10 +8,17 @@ - package rand - - import ( -+ boring "crypto/internal/backend" - "internal/syscall/windows" - ) - --func init() { Reader = &rngReader{} } -+func init() { -+ if boring.Enabled { -+ Reader = boring.RandReader -+ return -+ } -+ Reader = &rngReader{} -+} - - type rngReader struct{} - diff --git a/src/crypto/rsa/boring.go b/src/crypto/rsa/boring.go index 220f8c05c3d94b..dd20b4af2e0472 100644 --- a/src/crypto/rsa/boring.go @@ -1034,7 +1010,7 @@ index 8ec2c59f2c63e5..87b5f8e316f388 100644 golang.org/x/crypto v0.25.1-0.20240722173533-bb80217080b0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.1-0.20240722181819-765c7e89b3bd h1:pHzwejE8Zkb94bG4nA+fUeskKPFp1HPldrhv62dabro= diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go -index 097bffd599bc96..af0d39d1a84f76 100644 +index 03005f247513cf..c77db5a856b7f6 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -459,6 +459,10 @@ var depsRules = `