From 1b2c16f34f4191190670b70dc495ad0496ae12c8 Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Wed, 17 Jul 2024 09:50:03 -0700 Subject: [PATCH] Fix patch: accept new test imports adjacent to backend imports --- .../0002-Add-crypto-backend-foundation.patch | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/patches/0002-Add-crypto-backend-foundation.patch b/patches/0002-Add-crypto-backend-foundation.patch index 01fd95fc9c8..a8be14fb16f 100644 --- a/patches/0002-Add-crypto-backend-foundation.patch +++ b/patches/0002-Add-crypto-backend-foundation.patch @@ -464,18 +464,18 @@ index 46ec81b8c58bc9..1563eedf6f78d1 100644 "hash" ) diff --git a/src/crypto/hmac/hmac_test.go b/src/crypto/hmac/hmac_test.go -index 55415abf020799..904925377bba44 100644 +index 7accad763244a1..dd3211f2c37af3 100644 --- a/src/crypto/hmac/hmac_test.go +++ b/src/crypto/hmac/hmac_test.go -@@ -6,7 +6,7 @@ package hmac +@@ -5,7 +5,7 @@ + package hmac import ( - "bytes" - "crypto/internal/boring" + boring "crypto/internal/backend" + "crypto/internal/cryptotest" "crypto/md5" "crypto/sha1" - "crypto/sha256" diff --git a/src/crypto/internal/backend/backend_test.go b/src/crypto/internal/backend/backend_test.go new file mode 100644 index 00000000000000..c2c06d3bff8c74 @@ -897,7 +897,7 @@ index 843678702bf93f..28f4ae5621921d 100644 d.Reset() d.Write(data) diff --git a/src/crypto/md5/md5_test.go b/src/crypto/md5/md5_test.go -index 851e7fb10d42f5..f9d1037c9b82b9 100644 +index a5b661126dd716..7031d0abdaa13b 100644 --- a/src/crypto/md5/md5_test.go +++ b/src/crypto/md5/md5_test.go @@ -6,6 +6,7 @@ package md5 @@ -905,10 +905,10 @@ index 851e7fb10d42f5..f9d1037c9b82b9 100644 import ( "bytes" + boring "crypto/internal/backend" + "crypto/internal/cryptotest" "crypto/rand" "encoding" - "fmt" -@@ -144,6 +145,9 @@ func TestLarge(t *testing.T) { +@@ -145,6 +146,9 @@ func TestLarge(t *testing.T) { // Tests that blockGeneric (pure Go) and block (in assembly for amd64, 386, arm) match. func TestBlockGeneric(t *testing.T) { @@ -1121,7 +1121,7 @@ index c0742b9d83c527..3c89bd61e5ee2c 100644 "hash" "internal/byteorder" diff --git a/src/crypto/sha1/sha1_test.go b/src/crypto/sha1/sha1_test.go -index 85ed12609154ff..bc169888786321 100644 +index 634ab9de1ba4cb..d0a9b1b46727fa 100644 --- a/src/crypto/sha1/sha1_test.go +++ b/src/crypto/sha1/sha1_test.go @@ -8,7 +8,7 @@ package sha1 @@ -1130,9 +1130,9 @@ index 85ed12609154ff..bc169888786321 100644 "bytes" - "crypto/internal/boring" + boring "crypto/internal/backend" + "crypto/internal/cryptotest" "crypto/rand" "encoding" - "fmt" diff --git a/src/crypto/sha256/sha256.go b/src/crypto/sha256/sha256.go index 68244fd63b0c1e..02c597d785ef68 100644 --- a/src/crypto/sha256/sha256.go @@ -1147,7 +1147,7 @@ index 68244fd63b0c1e..02c597d785ef68 100644 "hash" "internal/byteorder" diff --git a/src/crypto/sha256/sha256_test.go b/src/crypto/sha256/sha256_test.go -index 7304678346b32e..7437655badee23 100644 +index d91f01e9ba3a5f..755ed4d238ee5a 100644 --- a/src/crypto/sha256/sha256_test.go +++ b/src/crypto/sha256/sha256_test.go @@ -8,7 +8,7 @@ package sha256 @@ -1156,9 +1156,9 @@ index 7304678346b32e..7437655badee23 100644 "bytes" - "crypto/internal/boring" + boring "crypto/internal/backend" + "crypto/internal/cryptotest" "crypto/rand" "encoding" - "fmt" diff --git a/src/crypto/sha512/sha512.go b/src/crypto/sha512/sha512.go index dde83625f7b852..d2fed3c2bb4533 100644 --- a/src/crypto/sha512/sha512.go @@ -1173,7 +1173,7 @@ index dde83625f7b852..d2fed3c2bb4533 100644 "hash" "internal/byteorder" diff --git a/src/crypto/sha512/sha512_test.go b/src/crypto/sha512/sha512_test.go -index 921cdbb7bbd477..2fef7ddae07480 100644 +index a1ff571383e542..b63e3af59f3829 100644 --- a/src/crypto/sha512/sha512_test.go +++ b/src/crypto/sha512/sha512_test.go @@ -8,7 +8,7 @@ package sha512 @@ -1182,9 +1182,9 @@ index 921cdbb7bbd477..2fef7ddae07480 100644 "bytes" - "crypto/internal/boring" + boring "crypto/internal/backend" + "crypto/internal/cryptotest" "crypto/rand" "encoding" - "encoding/hex" diff --git a/src/crypto/tls/boring_test.go b/src/crypto/tls/boring_test.go index be10b71bd2269b..d879139773d1d7 100644 --- a/src/crypto/tls/boring_test.go @@ -1215,10 +1215,10 @@ index eebc66880d631f..42a26005ff31f2 100644 "crypto/sha1" "crypto/sha256" diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go -index 553d2dde01de2d..6873e8daf631a7 100644 +index 5025657590d32c..bdbdee94af1bab 100644 --- a/src/crypto/tls/handshake_client.go +++ b/src/crypto/tls/handshake_client.go -@@ -763,12 +763,16 @@ func (hs *clientHandshakeState) doFullHandshake() error { +@@ -765,12 +765,16 @@ func (hs *clientHandshakeState) doFullHandshake() error { if hs.serverHello.extendedMasterSecret { c.extMasterSecret = true @@ -1237,7 +1237,7 @@ index 553d2dde01de2d..6873e8daf631a7 100644 if err := c.config.writeKeyLog(keyLogLabelTLS12, hs.hello.random, hs.masterSecret); err != nil { c.sendAlert(alertInternalError) return errors.New("tls: failed to write to key log: " + err.Error()) -@@ -829,8 +833,12 @@ func (hs *clientHandshakeState) doFullHandshake() error { +@@ -831,8 +835,12 @@ func (hs *clientHandshakeState) doFullHandshake() error { func (hs *clientHandshakeState) establishKeys() error { c := hs.c @@ -1251,7 +1251,7 @@ index 553d2dde01de2d..6873e8daf631a7 100644 var clientCipher, serverCipher any var clientHash, serverHash hash.Hash if hs.suite.cipher != nil { -@@ -970,7 +978,11 @@ func (hs *clientHandshakeState) readFinished(out []byte) error { +@@ -972,7 +980,11 @@ func (hs *clientHandshakeState) readFinished(out []byte) error { return unexpectedMessageError(serverFinished, msg) } @@ -1264,7 +1264,7 @@ index 553d2dde01de2d..6873e8daf631a7 100644 if len(verify) != len(serverFinished.verifyData) || subtle.ConstantTimeCompare(verify, serverFinished.verifyData) != 1 { c.sendAlert(alertHandshakeFailure) -@@ -1038,7 +1050,10 @@ func (hs *clientHandshakeState) sendFinished(out []byte) error { +@@ -1040,7 +1052,10 @@ func (hs *clientHandshakeState) sendFinished(out []byte) error { } finished := new(finishedMsg) @@ -1601,7 +1601,7 @@ index 33fd0ed52b1ff6..ffc3eeca9dbf95 100644 k, err := rsa.GenerateKey(rand.Reader, size) if err != nil { diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go -index 84b0096c770f44..68d3b0578d18b1 100644 +index 9146cae492e8ac..6eea04ef9269af 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -447,7 +447,9 @@ var depsRules = `