• Michael McLoughlin's avatar
    crypto/rand: batch large calls to linux getrandom · d401c427
    Michael McLoughlin authored
    The linux getrandom system call returns at most 33554431 = 2^25-1 bytes per
    call. The existing behavior for larger reads is to report a failure, because
    there appears to have been an unexpected short read. In this case the system
    falls back to reading from "/dev/urandom".
    
    This change performs reads of 2^25 bytes or more with multiple calls to
    getrandom.
    
    Fixes #20877
    
    Change-Id: I618855bdedafd86cd11219fe453af1d6fa2c88a7
    Reviewed-on: https://go-review.googlesource.com/49170Reviewed-by: 's avatarAdam Langley <agl@golang.org>
    Run-TryBot: Adam Langley <agl@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    d401c427
Name
Last commit
Last update
..
aes Loading commit data...
cipher Loading commit data...
des Loading commit data...
dsa Loading commit data...
ecdsa Loading commit data...
elliptic Loading commit data...
hmac Loading commit data...
internal/cipherhw Loading commit data...
md5 Loading commit data...
rand Loading commit data...
rc4 Loading commit data...
rsa Loading commit data...
sha1 Loading commit data...
sha256 Loading commit data...
sha512 Loading commit data...
subtle Loading commit data...
tls Loading commit data...
x509 Loading commit data...
crypto.go Loading commit data...
issue21104_test.go Loading commit data...