Skip to content

Commit

Permalink
fix:update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
mertakman committed Jan 10, 2025
1 parent 8eaffda commit b574a60
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 38 deletions.
40 changes: 22 additions & 18 deletions patches/0002-Add-crypto-backend-foundation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Subject: [PATCH] Add crypto backend foundation
.../internal/backend/fips140/isrequirefips.go | 9 +
.../internal/backend/fips140/norequirefips.go | 9 +
.../backend/fips140/nosystemcrypto.go | 11 +
src/crypto/internal/backend/nobackend.go | 229 ++++++++++++++++++
src/crypto/internal/backend/nobackend.go | 233 ++++++++++++++++++
src/crypto/internal/backend/stub.s | 10 +
src/crypto/internal/cryptotest/allocations.go | 2 +-
.../internal/cryptotest/implementations.go | 2 +-
Expand Down Expand Up @@ -68,15 +68,15 @@ Subject: [PATCH] Add crypto backend foundation
src/crypto/tls/handshake_server.go | 10 +-
src/crypto/tls/handshake_server_tls13.go | 25 +-
src/crypto/tls/internal/fips140tls/fipstls.go | 3 +-
src/crypto/tls/prf.go | 41 ++++
src/crypto/tls/prf.go | 41 +++
src/go/build/deps_test.go | 8 +-
src/hash/boring_test.go | 9 +
src/hash/example_test.go | 2 +
src/hash/marshal_test.go | 9 +
src/hash/notboring_test.go | 9 +
src/net/smtp/smtp_test.go | 72 ++++--
src/runtime/runtime_boring.go | 5 +
72 files changed, 1217 insertions(+), 89 deletions(-)
72 files changed, 1221 insertions(+), 89 deletions(-)
create mode 100644 src/crypto/dsa/boring.go
create mode 100644 src/crypto/dsa/notboring.go
create mode 100644 src/crypto/ed25519/boring.go
Expand Down Expand Up @@ -1148,10 +1148,10 @@ index 00000000000000..83691d7dd42d51
+}
diff --git a/src/crypto/internal/backend/nobackend.go b/src/crypto/internal/backend/nobackend.go
new file mode 100644
index 00000000000000..2ad15a0d1e370e
index 00000000000000..3ebb6d5e4b4bb5
--- /dev/null
+++ b/src/crypto/internal/backend/nobackend.go
@@ -0,0 +1,229 @@
@@ -0,0 +1,233 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
Expand Down Expand Up @@ -1180,19 +1180,23 @@ index 00000000000000..2ad15a0d1e370e
+
+func SupportsHash(h crypto.Hash) bool { panic("cryptobackend: not available") }
+
+func NewMD5() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA1() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA224() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA256() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA384() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA512() hash.Hash { panic("cryptobackend: not available") }
+
+func MD5(p []byte) (sum [16]byte) { panic("cryptobackend: not available") }
+func SHA1(p []byte) (sum [20]byte) { panic("cryptobackend: not available") }
+func SHA224(p []byte) (sum [28]byte) { panic("cryptobackend: not available") }
+func SHA256(p []byte) (sum [32]byte) { panic("cryptobackend: not available") }
+func SHA384(p []byte) (sum [48]byte) { panic("cryptobackend: not available") }
+func SHA512(p []byte) (sum [64]byte) { panic("cryptobackend: not available") }
+func NewMD5() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA1() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA224() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA256() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA384() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA512() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA512_224() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA512_256() hash.Hash { panic("cryptobackend: not available") }
+
+func MD5(p []byte) (sum [16]byte) { panic("cryptobackend: not available") }
+func SHA1(p []byte) (sum [20]byte) { panic("cryptobackend: not available") }
+func SHA224(p []byte) (sum [28]byte) { panic("cryptobackend: not available") }
+func SHA256(p []byte) (sum [32]byte) { panic("cryptobackend: not available") }
+func SHA384(p []byte) (sum [48]byte) { panic("cryptobackend: not available") }
+func SHA512(p []byte) (sum [64]byte) { panic("cryptobackend: not available") }
+func SHA512_224(p []byte) (sum [28]byte) { panic("cryptobackend: not available") }
+func SHA512_256(p []byte) (sum [32]byte) { panic("cryptobackend: not available") }
+
+func NewHMAC(h func() hash.Hash, key []byte) hash.Hash { panic("cryptobackend: not available") }
+
Expand Down
22 changes: 12 additions & 10 deletions patches/0003-Add-BoringSSL-crypto-backend.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Subject: [PATCH] Add BoringSSL crypto backend

---
.../internal/backend/bbig/big_boring.go | 12 +
src/crypto/internal/backend/boring_linux.go | 265 ++++++++++++++++++
src/crypto/internal/backend/boring_linux.go | 267 ++++++++++++++++++
src/crypto/internal/backend/fips140/boring.go | 11 +
3 files changed, 288 insertions(+)
3 files changed, 290 insertions(+)
create mode 100644 src/crypto/internal/backend/bbig/big_boring.go
create mode 100644 src/crypto/internal/backend/boring_linux.go
create mode 100644 src/crypto/internal/backend/fips140/boring.go
Expand All @@ -32,10 +32,10 @@ index 00000000000000..0b62cef68546d0
+var Dec = bbig.Dec
diff --git a/src/crypto/internal/backend/boring_linux.go b/src/crypto/internal/backend/boring_linux.go
new file mode 100644
index 00000000000000..e1ebc95a1db0e9
index 00000000000000..94bc444f10eb2b
--- /dev/null
+++ b/src/crypto/internal/backend/boring_linux.go
@@ -0,0 +1,265 @@
@@ -0,0 +1,267 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
Expand Down Expand Up @@ -69,12 +69,14 @@ index 00000000000000..e1ebc95a1db0e9
+ }
+}
+
+func NewMD5() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA1() hash.Hash { return boring.NewSHA1() }
+func NewSHA224() hash.Hash { return boring.NewSHA224() }
+func NewSHA256() hash.Hash { return boring.NewSHA256() }
+func NewSHA384() hash.Hash { return boring.NewSHA384() }
+func NewSHA512() hash.Hash { return boring.NewSHA512() }
+func NewMD5() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA1() hash.Hash { return boring.NewSHA1() }
+func NewSHA224() hash.Hash { return boring.NewSHA224() }
+func NewSHA256() hash.Hash { return boring.NewSHA256() }
+func NewSHA384() hash.Hash { return boring.NewSHA384() }
+func NewSHA512() hash.Hash { return boring.NewSHA512() }
+func NewSHA512_224() hash.Hash { panic("cryptobackend: not available") }
+func NewSHA512_256() hash.Hash { panic("cryptobackend: not available") }
+
+func MD5(p []byte) (sum [16]byte) { panic("cryptobackend: not available") }
+func SHA1(p []byte) (sum [20]byte) { return boring.SHA1(p) }
Expand Down
22 changes: 12 additions & 10 deletions patches/0005-Add-CNG-crypto-backend.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Subject: [PATCH] Add CNG crypto backend
src/crypto/ecdsa/badlinkname.go | 17 +
src/crypto/internal/backend/backend_test.go | 4 +-
src/crypto/internal/backend/bbig/big_cng.go | 12 +
src/crypto/internal/backend/cng_windows.go | 318 ++++++++++++++++++
src/crypto/internal/backend/cng_windows.go | 320 ++++++++++++++++++
src/crypto/internal/backend/common.go | 9 +-
src/crypto/internal/backend/fips140/cng.go | 33 ++
src/crypto/rsa/pss_test.go | 2 +-
Expand All @@ -18,7 +18,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 +
14 files changed, 418 insertions(+), 5 deletions(-)
14 files changed, 420 insertions(+), 5 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
Expand Down Expand Up @@ -84,10 +84,10 @@ index 00000000000000..92623031fd87d0
+var Dec = bbig.Dec
diff --git a/src/crypto/internal/backend/cng_windows.go b/src/crypto/internal/backend/cng_windows.go
new file mode 100644
index 00000000000000..2c22deb7f14aaf
index 00000000000000..495260a08dd029
--- /dev/null
+++ b/src/crypto/internal/backend/cng_windows.go
@@ -0,0 +1,318 @@
@@ -0,0 +1,320 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
Expand Down Expand Up @@ -134,12 +134,14 @@ index 00000000000000..2c22deb7f14aaf
+ return cng.SupportsHash(h)
+}
+
+func NewMD5() hash.Hash { return cng.NewMD5() }
+func NewSHA1() hash.Hash { return cng.NewSHA1() }
+func NewSHA224() hash.Hash { panic("cngcrypto: not available") }
+func NewSHA256() hash.Hash { return cng.NewSHA256() }
+func NewSHA384() hash.Hash { return cng.NewSHA384() }
+func NewSHA512() hash.Hash { return cng.NewSHA512() }
+func NewMD5() hash.Hash { return cng.NewMD5() }
+func NewSHA1() hash.Hash { return cng.NewSHA1() }
+func NewSHA224() hash.Hash { panic("cngcrypto: not available") }
+func NewSHA256() hash.Hash { return cng.NewSHA256() }
+func NewSHA384() hash.Hash { return cng.NewSHA384() }
+func NewSHA512() hash.Hash { return cng.NewSHA512() }
+func NewSHA512_224() hash.Hash { panic("cngcrypto: not available") }
+func NewSHA512_256() hash.Hash { panic("cngcrypto: not available") }
+
+func MD5(p []byte) (sum [16]byte) { return cng.MD5(p) }
+func SHA1(p []byte) (sum [20]byte) { return cng.SHA1(p) }
Expand Down

0 comments on commit b574a60

Please sign in to comment.