Skip to content

Commit 185c050

Browse files
authored
upgrade CNG backend (#1544)
1 parent f7e8c86 commit 185c050

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
@@ -1094,26 +1094,26 @@ index a0548a7f9179c5..ae6117a1554b7f 100644
10941094
package x509
10951095

10961096
diff --git a/src/go.mod b/src/go.mod
1097-
index 49d6362771d4b2..1cba724d406b3a 100644
1097+
index 49d6362771d4b2..e6732366baebd4 100644
10981098
--- a/src/go.mod
10991099
+++ b/src/go.mod
11001100
@@ -4,6 +4,7 @@ go 1.23
11011101

11021102
require (
11031103
github.com/golang-fips/openssl/v2 v2.0.4-0.20241114123251-c5672cc7ce15
1104-
+ github.com/microsoft/go-crypto-winnative v0.0.0-20240925170411-b29b5cde7fdd
1104+
+ github.com/microsoft/go-crypto-winnative v0.0.0-20250211161411-fea4f38f45ec
11051105
golang.org/x/crypto v0.23.1-0.20240603234054-0b431c7de36a
11061106
golang.org/x/net v0.25.1-0.20240603202750-6249541f2a6c
11071107
)
11081108
diff --git a/src/go.sum b/src/go.sum
1109-
index f88678bf643820..c86114e6cf3c8a 100644
1109+
index f88678bf643820..73e7bc41ab2fe2 100644
11101110
--- a/src/go.sum
11111111
+++ b/src/go.sum
11121112
@@ -1,5 +1,7 @@
11131113
github.com/golang-fips/openssl/v2 v2.0.4-0.20241114123251-c5672cc7ce15 h1:6Mb55x7RlLVNEPY6liVYeVTMR5FuZqHViyyrr7tih7A=
11141114
github.com/golang-fips/openssl/v2 v2.0.4-0.20241114123251-c5672cc7ce15/go.mod h1:7tuBqX2Zov8Yq5mJ2yzlKhpnxOnWyEzi38AzeWRuQdg=
1115-
+github.com/microsoft/go-crypto-winnative v0.0.0-20240925170411-b29b5cde7fdd h1:2ziav5Bdjyv0VYCCftEExmA+QQZ193w8BvSgoEZ+qAY=
1116-
+github.com/microsoft/go-crypto-winnative v0.0.0-20240925170411-b29b5cde7fdd/go.mod h1:fveERXKbeK+XLmOyU24caKnIT/S5nniAX9XCRHfnrM4=
1115+
+github.com/microsoft/go-crypto-winnative v0.0.0-20250211161411-fea4f38f45ec h1:sgB+KKrkX1u1v8C1kFrGThsVw0rPUSqNmWYmzGs0Iy4=
1116+
+github.com/microsoft/go-crypto-winnative v0.0.0-20250211161411-fea4f38f45ec/go.mod h1:fveERXKbeK+XLmOyU24caKnIT/S5nniAX9XCRHfnrM4=
11171117
golang.org/x/crypto v0.23.1-0.20240603234054-0b431c7de36a h1:37MIv+iGfwMYzWJECGyrPCtd5nuqcciRUeJfkNCkCf0=
11181118
golang.org/x/crypto v0.23.1-0.20240603234054-0b431c7de36a/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
11191119
golang.org/x/net v0.25.1-0.20240603202750-6249541f2a6c h1:CR/7/SLUhIJw6g675eeoDiwggElO2MV9rGkNYjqi8GM=

patches/0006-Vendor-crypto-backends.patch

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ To reproduce, run 'go mod vendor' in 'go/src'.
5555
.../microsoft/go-crypto-winnative/cng/rand.go | 28 +
5656
.../microsoft/go-crypto-winnative/cng/rc4.go | 61 ++
5757
.../microsoft/go-crypto-winnative/cng/rsa.go | 374 ++++++++
58-
.../go-crypto-winnative/cng/tls1prf.go | 92 ++
58+
.../go-crypto-winnative/cng/tls1prf.go | 93 ++
5959
.../internal/bcrypt/bcrypt_windows.go | 284 ++++++
6060
.../internal/bcrypt/zsyscall_windows.go | 389 ++++++++
6161
.../internal/subtle/aliasing.go | 32 +
6262
.../internal/sysdll/sys_windows.go | 55 ++
6363
src/vendor/modules.txt | 11 +
64-
56 files changed, 9221 insertions(+)
64+
56 files changed, 9222 insertions(+)
6565
create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/.gitleaks.toml
6666
create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/LICENSE
6767
create mode 100644 src/vendor/github.com/golang-fips/openssl/v2/README.md
@@ -8780,10 +8780,10 @@ index 00000000000000..7e3f7abe3487cb
87808780
+}
87818781
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
87828782
new file mode 100644
8783-
index 00000000000000..30ef2242bc3cf3
8783+
index 00000000000000..e8f5c904fec325
87848784
--- /dev/null
87858785
+++ b/src/vendor/github.com/microsoft/go-crypto-winnative/cng/tls1prf.go
8786-
@@ -0,0 +1,92 @@
8786+
@@ -0,0 +1,93 @@
87878787
+// Copyright (c) Microsoft Corporation.
87888788
+// Licensed under the MIT License.
87898789
+
@@ -8834,6 +8834,7 @@ index 00000000000000..30ef2242bc3cf3
88348834
+ if err := bcrypt.GenerateSymmetricKey(alg, &kh, nil, secret, 0); err != nil {
88358835
+ return err
88368836
+ }
8837+
+ defer bcrypt.DestroyKey(kh)
88378838
+
88388839
+ buffers := make([]bcrypt.Buffer, 0, 3)
88398840
+ if len(label) > 0 {
@@ -9661,15 +9662,15 @@ index 00000000000000..1722410e5af193
96619662
+ return getSystemDirectory() + "\\" + dll
96629663
+}
96639664
diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt
9664-
index b8a0b84a282a32..8329b1b4649b69 100644
9665+
index b8a0b84a282a32..676e784fcf04e2 100644
96659666
--- a/src/vendor/modules.txt
96669667
+++ b/src/vendor/modules.txt
96679668
@@ -1,3 +1,14 @@
96689669
+# github.com/golang-fips/openssl/v2 v2.0.4-0.20241114123251-c5672cc7ce15
96699670
+## explicit; go 1.20
96709671
+github.com/golang-fips/openssl/v2
96719672
+github.com/golang-fips/openssl/v2/bbig
9672-
+# github.com/microsoft/go-crypto-winnative v0.0.0-20240925170411-b29b5cde7fdd
9673+
+# github.com/microsoft/go-crypto-winnative v0.0.0-20250211161411-fea4f38f45ec
96739674
+## explicit; go 1.17
96749675
+github.com/microsoft/go-crypto-winnative/cng
96759676
+github.com/microsoft/go-crypto-winnative/cng/bbig

0 commit comments

Comments
 (0)