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 <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>
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

Lines changed: 1 addition & 13 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy