Skip to content

Commit

Permalink
fix patches
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Jan 9, 2025
1 parent f154f9f commit d45bb85
Show file tree
Hide file tree
Showing 2 changed files with 1,088 additions and 950 deletions.
30 changes: 22 additions & 8 deletions patches/0006-Add-Darwin-crypto-backend.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Date: Tue, 17 Dec 2024 13:17:39 +0000
Subject: [PATCH] Add Darwin crypto backend

---
.gitignore | 2 +
src/crypto/ecdsa/ecdsa.go | 6 +-
src/crypto/ed25519/ed25519_test.go | 3 +-
.../internal/backend/bbig/big_darwin.go | 12 +
Expand All @@ -21,19 +22,32 @@ Subject: [PATCH] Add Darwin crypto backend
.../goexperiment/exp_darwincrypto_off.go | 9 +
.../goexperiment/exp_darwincrypto_on.go | 9 +
src/internal/goexperiment/flags.go | 1 +
17 files changed, 502 insertions(+), 13 deletions(-)
18 files changed, 504 insertions(+), 13 deletions(-)
create mode 100644 src/crypto/internal/backend/bbig/big_darwin.go
create mode 100644 src/crypto/internal/backend/darwin_darwin.go
create mode 100644 src/crypto/internal/backend/fips140/darwin.go
create mode 100644 src/crypto/rsa/darwin.go
create mode 100644 src/internal/goexperiment/exp_darwincrypto_off.go
create mode 100644 src/internal/goexperiment/exp_darwincrypto_on.go

diff --git a/.gitignore b/.gitignore
index c6512e64a4ef39..b3b01db73b009d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,8 @@ _testmain.go
/test/run.out
/test/times.out

+!/src/vendor/github.com/microsoft/go-crypto-darwin/internal/cryptokit/CryptoKit.o
+
# This file includes artifacts of Go build that should not be checked in.
# For files created by specific development environment (e.g. editor),
# use alternative ways to exclude files from git.
diff --git a/src/crypto/ecdsa/ecdsa.go b/src/crypto/ecdsa/ecdsa.go
index 41ac17df22d7d7..84a7ba02c88620 100644
index 049da55bd70f2c..cd075f0efbc744 100644
--- a/src/crypto/ecdsa/ecdsa.go
+++ b/src/crypto/ecdsa/ecdsa.go
@@ -159,7 +159,7 @@ func (priv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOp
@@ -161,7 +161,7 @@ func (priv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOp
func GenerateKey(c elliptic.Curve, rand io.Reader) (*PrivateKey, error) {
randutil.MaybeReadByte(rand)

Expand All @@ -42,7 +56,7 @@ index 41ac17df22d7d7..84a7ba02c88620 100644
x, y, d, err := boring.GenerateKeyECDSA(c.Params().Name)
if err != nil {
return nil, err
@@ -208,7 +208,7 @@ var errNoAsm = errors.New("no assembly implementation available")
@@ -210,7 +210,7 @@ var errNoAsm = errors.New("no assembly implementation available")
func SignASN1(rand io.Reader, priv *PrivateKey, hash []byte) ([]byte, error) {
randutil.MaybeReadByte(rand)

Expand All @@ -51,7 +65,7 @@ index 41ac17df22d7d7..84a7ba02c88620 100644
b, err := boringPrivateKey(priv)
if err != nil {
return nil, err
@@ -319,7 +319,7 @@ func addASN1IntBytes(b *cryptobyte.Builder, bytes []byte) {
@@ -321,7 +321,7 @@ func addASN1IntBytes(b *cryptobyte.Builder, bytes []byte) {
// The inputs are not considered confidential, and may leak through timing side
// channels, or if an attacker has control of part of the inputs.
func VerifyASN1(pub *PublicKey, hash, sig []byte) bool {
Expand Down Expand Up @@ -688,7 +702,7 @@ index 7d7115cff81cea..d3ba67fe4d0611 100644
}
default:
diff --git a/src/go.mod b/src/go.mod
index 897c3802237b4e..0119f5ce8fe623 100644
index e9da0eb1301b93..f03fcd766104e9 100644
--- a/src/go.mod
+++ b/src/go.mod
@@ -4,6 +4,7 @@ go 1.24
Expand All @@ -700,7 +714,7 @@ index 897c3802237b4e..0119f5ce8fe623 100644
golang.org/x/crypto v0.30.0
golang.org/x/net v0.32.1-0.20241206180132-552d8ac903a1
diff --git a/src/go.sum b/src/go.sum
index 7cece574a42291..6050c2fe0c5081 100644
index b464f023942b74..90bd105cd407fb 100644
--- a/src/go.sum
+++ b/src/go.sum
@@ -1,5 +1,7 @@
Expand All @@ -712,7 +726,7 @@ index 7cece574a42291..6050c2fe0c5081 100644
github.com/microsoft/go-crypto-winnative v0.0.0-20250108090702-b49854c00e37/go.mod h1:JkxQeL8dGcyCuKjn1Etz4NmQrOMImMy4BA9hptEfVFA=
golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY=
diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go
index 1fcadbf6c19d79..b0da426bf18177 100644
index 997244c84e57c5..4b0585fe1bea25 100644
--- a/src/go/build/deps_test.go
+++ b/src/go/build/deps_test.go
@@ -519,6 +519,8 @@ var depsRules = `
Expand Down
Loading

0 comments on commit d45bb85

Please sign in to comment.