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

x/crypto/openpgp/clearsign: TestMultiSign fails with "random source is broken" at Go tip #70682

Closed
dmitshur opened this issue Dec 4, 2024 · 5 comments
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Dec 4, 2024

At Go tip, TestMultiSign fails when run without -short flag, including on first class ports like linux/amd64:

=== RUN   TestMultiSign
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
    clearsign_test.go:155: cannot create key: rsa: generated p == q, random source is broken
--- FAIL: TestMultiSign (6.93s)

(E.g., build 8729461560583552209.)

Though it started failing earlier, as of go.dev/cl/632477, with a different error ("clearsign_test.go:155: cannot create key: crypto/rsa: decryption error").

CC @FiloSottile, @rolandshoemaker.

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) labels Dec 4, 2024
@dmitshur dmitshur added this to the Unreleased milestone Dec 4, 2024
@gabyhelp
Copy link

gabyhelp commented Dec 4, 2024

Related Issues

Related Code Changes

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@FiloSottile FiloSottile added the Testing An issue that has been verified to require only test changes, not just a test failure. label Dec 4, 2024
@FiloSottile
Copy link
Contributor

The test is indeed broken, and needs fixing.

@rolandshoemaker
Copy link
Member

It's unclear if that test actually needs to generate deterministic keys? rand.Reader should just be fast enough for this use case, surely?

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/633655 mentions this issue: openpgp/clearsign: just use rand.Reader

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. FixPending Issues that have a fix which has not yet been reviewed or submitted. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 4, 2024
@dmitshur
Copy link
Contributor Author

dmitshur commented Dec 4, 2024

Thanks for the quick fix! The monthly golang.org/x tagging workflow ran into this, and the fix enabled it to keep going (https://go.googlesource.com/crypto/+/refs/tags/v0.30.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

5 participants