Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openpgp/clearsign: just use rand.Reader in tests #276

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions openpgp/clearsign/clearsign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,24 +171,12 @@ func TestSigningInterop(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, v6 bool) {
if testing.Short() {
t.Skip("skipping long test in -short mode")
}

zero := quickRand(0)
config := packet.Config{Rand: &zero, V6Keys: v6}
config := packet.Config{V6Keys: v6}

for nKeys := 1; nKeys < 4; nKeys++ {
nextTest:
Expand Down