mirror of
https://github.com/golang/go
synced 2024-11-19 00:44:40 -07:00
runtime: use urandom instead of random
Random is bad, it can block and prevent binaries from starting. Use urandom instead. We'd rather have bad random bits than no random bits. Change-Id: I360e1cb90ace5518a1b51708822a1dae27071ebd Reviewed-on: https://go-review.googlesource.com/2582 Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
parent
5664eda733
commit
1de9c4073b
@ -45,7 +45,7 @@ func osinit() {
|
||||
}
|
||||
}
|
||||
|
||||
var urandom_dev = []byte("/dev/random\x00")
|
||||
var urandom_dev = []byte("/dev/urandom\x00")
|
||||
|
||||
//go:nosplit
|
||||
func getRandomData(r []byte) {
|
||||
|
@ -96,7 +96,7 @@ func osinit() {
|
||||
ncpu = getncpu()
|
||||
}
|
||||
|
||||
var urandom_dev = []byte("/dev/random\x00")
|
||||
var urandom_dev = []byte("/dev/urandom\x00")
|
||||
|
||||
//go:nosplit
|
||||
func getRandomData(r []byte) {
|
||||
|
@ -145,7 +145,7 @@ func osinit() {
|
||||
ncpu = getproccount()
|
||||
}
|
||||
|
||||
var urandom_dev = []byte("/dev/random\x00")
|
||||
var urandom_dev = []byte("/dev/urandom\x00")
|
||||
|
||||
func getRandomData(r []byte) {
|
||||
if startupRandomData != nil {
|
||||
|
@ -165,7 +165,7 @@ func newosproc(mp *m, _ unsafe.Pointer) {
|
||||
}
|
||||
}
|
||||
|
||||
var urandom_dev = []byte("/dev/random\x00")
|
||||
var urandom_dev = []byte("/dev/urandom\x00")
|
||||
|
||||
//go:nosplit
|
||||
func getRandomData(r []byte) {
|
||||
|
Loading…
Reference in New Issue
Block a user