aboutsummaryrefslogtreecommitdiff
path: root/openpgp/clearsign/clearsign_test.go
diff options
context:
space:
mode:
authorRoland Shoemaker <roland@golang.org>2024-12-04 10:46:07 -0800
committerGopher Robot <gobot@golang.org>2024-12-04 19:36:17 +0000
commit7042ebcbe097f305ba3a93f9a22b4befa4b83d29 (patch)
tree6301f9584db8fd637a86801645c8c024b5ccb2b2 /openpgp/clearsign/clearsign_test.go
parent3e90321ac7bcee3d924ed63ed3ad97be2079cb56 (diff)
downloadgo-x-crypto-0.30.0.tar.xz
openpgp/clearsign: just use rand.Reader in testsv0.30.0
Instead of a convoluted fake rand, it is _basically_ just as fast, and fixes errors that pop up due to bad entropy. Fixes golang/go#70682 Change-Id: Ib0f605398d1092b516b03135f602c644be2a060f Reviewed-on: https://go-review.googlesource.com/c/crypto/+/633655 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Diffstat (limited to 'openpgp/clearsign/clearsign_test.go')
-rw-r--r--openpgp/clearsign/clearsign_test.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/openpgp/clearsign/clearsign_test.go b/openpgp/clearsign/clearsign_test.go
index 051b8f1..821c35f 100644
--- a/openpgp/clearsign/clearsign_test.go
+++ b/openpgp/clearsign/clearsign_test.go
@@ -123,24 +123,12 @@ func TestSigning(t *testing.T) {
}
}
-// We use this to make test keys, so that they aren't all the same.
-type quickRand byte
-
-func (qr *quickRand) Read(p []byte) (int, error) {
- for i := range p {
- p[i] = byte(*qr)
- }
- *qr++
- return len(p), nil
-}
-
func TestMultiSign(t *testing.T) {
if testing.Short() {
t.Skip("skipping long test in -short mode")
}
- zero := quickRand(0)
- config := packet.Config{Rand: &zero}
+ var config packet.Config
for nKeys := 0; nKeys < 4; nKeys++ {
nextTest: