diff options
| author | Joe Richey <joerichey@google.com> | 2017-03-02 11:58:07 -0800 |
|---|---|---|
| committer | Joe Richey joerichey@google.com <joerichey@google.com> | 2017-05-02 13:39:18 -0700 |
| commit | 49b3026574ab692cfabcabe90751b163a76df31b (patch) | |
| tree | c638076dd5faeadf84afd49fcf15728f68181eba /cmd/fscrypt/fscrypt.go | |
| parent | 53d15f466a665e4e564af3afdcbcfe9ff1c91331 (diff) | |
crypto: add secure random reader using getrandom
This commit adds in RandReader, a cryptographically secure io.Reader
that will fail when the os has insufficient randomness. This is done
using the getrandom() syscall in non-blocking mode.
see: http://man7.org/linux/man-pages/man2/getrandom.2.html
Any kernel new enough to have filesystem encryption will also have this
syscall.
This RandReader is preferable to the one provided by the standard
library in crypto/rand. See the bugs:
https://github.com/golang/go/issues/11833
https://github.com/golang/go/issues/19274
This will be removed when go updates the crypto/rand implementation.
Change-Id: Icccaf07bc6011b95cd31a5c268e7486807dcffe2
Diffstat (limited to 'cmd/fscrypt/fscrypt.go')
0 files changed, 0 insertions, 0 deletions