You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@tatsuhiro-t are there any guarantees that std::uniform_int_distribution will produce as good of any entropy as getrandom? This post hints otherwise. If plain insecure rand was not good enough for aria2, I'd expect need for good entropy. Can you summarize what aria2 needs good entropy for or why bad (or not guaranteed to be good) entropy would not be a security concern in your eyes? Thanks!
The counterpart of getrandom in C++1x API is std::random_device. The difference of getrandom and the current code is whether sampling from /dev/urandom or use pseudo random generator mt19937.
This function is used when we need some random data like producing ID or padding length.
For security stuff, we use the function provided by crypto library (e.g., OpenSSL).
The one exception is BitTorrent InternalDHEKeyExchange which uses this random generator to produce keys. It is only used if no cyrpto library is available. So it might be affected but the current code has existed as fallback so we didn't lower the bar. Also BitTorrent encryption is considered as insecure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Fixes #1304
Fixes #1249