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

Check for RNG failures #141

Merged
merged 4 commits into from
May 2, 2015
Merged

Check for RNG failures #141

merged 4 commits into from
May 2, 2015

Conversation

pde
Copy link
Contributor

@pde pde commented May 1, 2015

This addresses #51. It depends on #135.

It also includes a basic log.EmergencyExit() function to call in case of catastrophic errors, though the corresponding piece of ActivityMonitor still needs to beimplemented.

I haven't yet learned a way to fake rand.Reader returning fewer than 32 bytes in the test case, or to test the resulting os.Exit(13) that we expect...

@@ -70,7 +72,12 @@ func B64dec(x string) ([]byte, error) {

func RandomString(byteLength int) string {
b := make([]byte, byteLength)
_, _ = rand.Read(b) // NOTE: Ignoring errors
_, err := io.ReadFull(rand.Reader, b) // NOTE: Ignoring errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "ignoring errors" comment

@jcjones
Copy link
Contributor

jcjones commented May 2, 2015

I'm good with this. I'll rebase the changes and commit after #135.

@jcjones jcjones self-assigned this May 2, 2015
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.24%) to 39.45% when pulling 9c272ce on randfail into 3ce6147 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.24%) to 39.45% when pulling 9c272ce on randfail into 3ce6147 on master.

jcjones added a commit that referenced this pull request May 2, 2015
@jcjones jcjones merged commit bef94d7 into master May 2, 2015
@jcjones jcjones deleted the randfail branch May 2, 2015 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants