Skip to content

Commit

Permalink
only conditionally skip TestMarshalHash in boring mode
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Nov 4, 2024
1 parent 57e1ab6 commit bd9da3b
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions patches/0002-Add-crypto-backend-foundation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ Subject: [PATCH] Add crypto backend foundation
src/crypto/tls/prf_test.go | 12 +-
src/crypto/x509/boring_test.go | 5 +
src/go/build/deps_test.go | 4 +
src/hash/marshal_test.go | 3 +
src/hash/boring_test.go | 5 +
src/hash/marshal_test.go | 5 +
src/hash/notboring_test.go | 5 +
src/net/smtp/smtp_test.go | 72 ++++---
src/runtime/runtime_boring.go | 5 +
53 files changed, 861 insertions(+), 106 deletions(-)
55 files changed, 873 insertions(+), 106 deletions(-)
create mode 100644 src/crypto/ed25519/boring.go
create mode 100644 src/crypto/ed25519/notboring.go
create mode 100644 src/crypto/internal/backend/backend_test.go
Expand All @@ -67,6 +69,8 @@ Subject: [PATCH] Add crypto backend foundation
create mode 100644 src/crypto/internal/backend/nobackend.go
create mode 100644 src/crypto/internal/backend/norequirefips.go
create mode 100644 src/crypto/internal/backend/stub.s
create mode 100644 src/hash/boring_test.go
create mode 100644 src/hash/notboring_test.go

diff --git a/src/crypto/aes/cipher.go b/src/crypto/aes/cipher.go
index cde2e45d2ca559..cf47a4fc57d8e2 100644
Expand Down Expand Up @@ -1909,20 +1913,44 @@ index c6a2518f62ff3a..578b4d6f68504c 100644
< crypto/rand
< crypto/internal/mlkem768
< crypto/ed25519
diff --git a/src/hash/boring_test.go b/src/hash/boring_test.go
new file mode 100644
index 00000000000000..cd07ee1c00d379
--- /dev/null
+++ b/src/hash/boring_test.go
@@ -0,0 +1,5 @@
+//go:build systemcrypto
+
+package hash_test
+
+const boringEnabled = true
diff --git a/src/hash/marshal_test.go b/src/hash/marshal_test.go
index 3091f7a67acede..b066f8281c5265 100644
index 3091f7a67acede..fead8cc4bec73a 100644
--- a/src/hash/marshal_test.go
+++ b/src/hash/marshal_test.go
@@ -65,6 +65,9 @@ func TestMarshalHash(t *testing.T) {
@@ -65,6 +65,11 @@ func TestMarshalHash(t *testing.T) {
}

h := tt.new()
+ if _, ok := h.(encoding.BinaryMarshaler); !ok {
+ t.Skip("BinaryMarshaler not implemented")
+ if boringEnabled {
+ if _, ok := h.(encoding.BinaryMarshaler); !ok {
+ t.Skip("BinaryMarshaler not implemented")
+ }
+ }
h.Write(buf[:256])
sum := h.Sum(nil)

diff --git a/src/hash/notboring_test.go b/src/hash/notboring_test.go
new file mode 100644
index 00000000000000..e1874086d3f315
--- /dev/null
+++ b/src/hash/notboring_test.go
@@ -0,0 +1,5 @@
+//go:build !systemcrypto
+
+package hash_test
+
+const boringEnabled = false
diff --git a/src/net/smtp/smtp_test.go b/src/net/smtp/smtp_test.go
index 389eda9ad54b99..110d60beb0e70c 100644
--- a/src/net/smtp/smtp_test.go
Expand Down

0 comments on commit bd9da3b

Please sign in to comment.