Commit 1de9c407 authored by Keith Randall's avatar Keith Randall

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/2582Reviewed-by: 's avatarDave Cheney <dave@cheney.net>
Reviewed-by: 's avatarMinux Ma <minux@golang.org>
parent 5664eda7
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment