Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment for this? I'm not quite sure I can follow the logic of this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is called before extracting entropy from a pool, in order to move entropy from the "input" pool into the desired pool.
In order to prevent
/dev/urandomfrom starving/dev/random,urandomwill only reseed from the input pool once ever 60s (by default, it's tunable). This conditional block implements that ratelimit.However, if it hasn't been initialized yet (doesn't have at least 128 bits of entropy), we should still greedily grab entropy until it has been, which is what my change does. My rationale is that we won't risk long-term starvation, since we'll only need to suck ~128 bits out, ever, and that ensuring the validity of the randomness in
/dev/urandomASAP is more important than keeping a few extra bits around to replenish/dev/urandomWhich part of that would help you as a comment? :) I don't think that entire graf merits inclusion…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the highest of high levels. perhaps: "Only attempt to rate limit
transfers of entropy if we're initialized. Until we are initialized it
makes sense to transfer all the entropy we can."
On Tue, Jun 14, 2016 at 6:58 PM, Nelson Elhage [email protected]
wrote:
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: D1B3 ADC0 E023 8CA6