Skip to content

Commit 7042ebc

Browse files
rolandshoemakergopherbot
authored andcommitted
openpgp/clearsign: just use rand.Reader in tests
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Roland Shoemaker <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]>
1 parent 3e90321 commit 7042ebc

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

openpgp/clearsign/clearsign_test.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -123,24 +123,12 @@ func TestSigning(t *testing.T) {
123123
}
124124
}
125125

126-
// We use this to make test keys, so that they aren't all the same.
127-
type quickRand byte
128-
129-
func (qr *quickRand) Read(p []byte) (int, error) {
130-
for i := range p {
131-
p[i] = byte(*qr)
132-
}
133-
*qr++
134-
return len(p), nil
135-
}
136-
137126
func TestMultiSign(t *testing.T) {
138127
if testing.Short() {
139128
t.Skip("skipping long test in -short mode")
140129
}
141130

142-
zero := quickRand(0)
143-
config := packet.Config{Rand: &zero}
131+
var config packet.Config
144132

145133
for nKeys := 0; nKeys < 4; nKeys++ {
146134
nextTest:

0 commit comments

Comments
 (0)