Skip to content

Commit 0a859f5

Browse files
authored
upgrade CNG backend (#1545)
1 parent a2a2ade commit 0a859f5

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

patches/0005-Add-CNG-crypto-backend.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,26 +1068,26 @@ index a0548a7f9179c5..ae6117a1554b7f 100644
10681068
package x509
10691069

10701070
diff --git a/src/go.mod b/src/go.mod
1071-
index d5ab3864107477..de6d1d58a0665e 100644
1071+
index d5ab3864107477..04e1efe2a5a926 100644
10721072
--- a/src/go.mod
10731073
+++ b/src/go.mod
10741074
@@ -4,6 +4,7 @@ go 1.22
10751075

10761076
require (
10771077
github.com/golang-fips/openssl/v2 v2.0.0-rc.3.0.20241114123242-248af7388443
1078-
+ github.com/microsoft/go-crypto-winnative v0.0.0-20240925170411-b29b5cde7fdd
1078+
+ github.com/microsoft/go-crypto-winnative v0.0.0-20250211161421-4edbd9b94d35
10791079
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb
10801080
golang.org/x/net v0.19.1-0.20240412193750-db050b07227e
10811081
)
10821082
diff --git a/src/go.sum b/src/go.sum
1083-
index be018b2249bcbf..6422ae3e1e8abd 100644
1083+
index be018b2249bcbf..b1a71dcac5b369 100644
10841084
--- a/src/go.sum
10851085
+++ b/src/go.sum
10861086
@@ -1,5 +1,7 @@
10871087
github.com/golang-fips/openssl/v2 v2.0.0-rc.3.0.20241114123242-248af7388443 h1:Mc/ODcDwmipcEj9deXLpre2xfu2uv9HalqpQXtJvN5o=
10881088
github.com/golang-fips/openssl/v2 v2.0.0-rc.3.0.20241114123242-248af7388443/go.mod h1:7tuBqX2Zov8Yq5mJ2yzlKhpnxOnWyEzi38AzeWRuQdg=
1089-
+github.com/microsoft/go-crypto-winnative v0.0.0-20240925170411-b29b5cde7fdd h1:2ziav5Bdjyv0VYCCftEExmA+QQZ193w8BvSgoEZ+qAY=
1090-
+github.com/microsoft/go-crypto-winnative v0.0.0-20240925170411-b29b5cde7fdd/go.mod h1:fveERXKbeK+XLmOyU24caKnIT/S5nniAX9XCRHfnrM4=
1089+
+github.com/microsoft/go-crypto-winnative v0.0.0-20250211161421-4edbd9b94d35 h1:VPMHBcE3GucQdMQylMeuk5XGpduM5P7FF5j1HbGDlWg=
1090+
+github.com/microsoft/go-crypto-winnative v0.0.0-20250211161421-4edbd9b94d35/go.mod h1:fveERXKbeK+XLmOyU24caKnIT/S5nniAX9XCRHfnrM4=
10911091
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb h1:1ceSY7sk6sJuiDREHpfyrqDnDljsLfEP2GuTClhBBfI=
10921092
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
10931093
golang.org/x/net v0.19.1-0.20240412193750-db050b07227e h1:oDnvqaqHo3ho8OChMtkQbQAyp9eqnm3J7JRtt0+Cabc=

patches/0006-Vendor-crypto-backends.patch

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ To reproduce, run 'go mod vendor' in 'go/src'.
5353
.../microsoft/go-crypto-winnative/cng/rand.go | 28 +
5454
.../microsoft/go-crypto-winnative/cng/rc4.go | 61 ++
5555
.../microsoft/go-crypto-winnative/cng/rsa.go | 374 ++++++++
56-
.../go-crypto-winnative/cng/tls1prf.go | 92 ++
56+
.../go-crypto-winnative/cng/tls1prf.go | 93 ++
5757
.../internal/bcrypt/bcrypt_windows.go | 284 ++++++
5858
.../internal/bcrypt/zsyscall_windows.go | 389 ++++++++
5959
.../internal/subtle/aliasing.go | 32 +
6060
.../internal/sysdll/sys_windows.go | 55 ++
6161
src/vendor/modules.txt | 11 +
62-
54 files changed, 9072 insertions(+)
62+
54 files changed, 9073 insertions(+)
6363
create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/.gitleaks.toml
6464
create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/LICENSE
6565
create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/README.md
@@ -8615,10 +8615,10 @@ index 00000000000000..7e3f7abe3487cb
86158615
+}
86168616
diff --git a/src/vendor/github.com/microsoft/go-crypto-winnative/cng/tls1prf.go b/src/vendor/github.com/microsoft/go-crypto-winnative/cng/tls1prf.go
86178617
new file mode 100644
8618-
index 00000000000000..30ef2242bc3cf3
8618+
index 00000000000000..e8f5c904fec325
86198619
--- /dev/null
86208620
+++ b/src/vendor/github.com/microsoft/go-crypto-winnative/cng/tls1prf.go
8621-
@@ -0,0 +1,92 @@
8621+
@@ -0,0 +1,93 @@
86228622
+// Copyright (c) Microsoft Corporation.
86238623
+// Licensed under the MIT License.
86248624
+
@@ -8669,6 +8669,7 @@ index 00000000000000..30ef2242bc3cf3
86698669
+ if err := bcrypt.GenerateSymmetricKey(alg, &kh, nil, secret, 0); err != nil {
86708670
+ return err
86718671
+ }
8672+
+ defer bcrypt.DestroyKey(kh)
86728673
+
86738674
+ buffers := make([]bcrypt.Buffer, 0, 3)
86748675
+ if len(label) > 0 {
@@ -9496,15 +9497,15 @@ index 00000000000000..1722410e5af193
94969497
+ return getSystemDirectory() + "\\" + dll
94979498
+}
94989499
diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt
9499-
index 9a234e59b10c8c..832d0ac91cdaea 100644
9500+
index 9a234e59b10c8c..52273a8e600c78 100644
95009501
--- a/src/vendor/modules.txt
95019502
+++ b/src/vendor/modules.txt
95029503
@@ -1,3 +1,14 @@
95039504
+# github.com/golang-fips/openssl/v2 v2.0.0-rc.3.0.20241114123242-248af7388443
95049505
+## explicit; go 1.20
95059506
+github.com/golang-fips/openssl/v2
95069507
+github.com/golang-fips/openssl/v2/bbig
9507-
+# github.com/microsoft/go-crypto-winnative v0.0.0-20240925170411-b29b5cde7fdd
9508+
+# github.com/microsoft/go-crypto-winnative v0.0.0-20250211161421-4edbd9b94d35
95089509
+## explicit; go 1.17
95099510
+github.com/microsoft/go-crypto-winnative/cng
95109511
+github.com/microsoft/go-crypto-winnative/cng/bbig

0 commit comments

Comments
 (0)