]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.17] crypto/rand, internal/syscall/unix: don't use getentropy...
authorTobias Klauser <tklauser@distanz.ch>
Thu, 19 Aug 2021 14:36:38 +0000 (16:36 +0200)
committerCherry Mui <cherryyz@google.com>
Wed, 1 Sep 2021 17:08:11 +0000 (17:08 +0000)
CL 302489 switched crypto/rand to use getentropy on darwin, however this
function is not available on iOS. Enable getentropy only on macOS and
disable it on iOS.

Fixes #47814

Change-Id: Ib7ba5d77346aee87904bb93d60cacc845f5c0089
Reviewed-on: https://go-review.googlesource.com/c/go/+/343609
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
(cherry picked from commit 700743137462471189f58ee85fe64754cd340322)
Reviewed-on: https://go-review.googlesource.com/c/go/+/343989

src/crypto/rand/rand_getentropy.go
src/internal/syscall/unix/getentropy_darwin.go

index f82018a4951c743c82f15c28b82262b601112f27..dd725372ad918a85d533b3dc30e213d49616bcd7 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build darwin || openbsd
-// +build darwin openbsd
+//go:build (darwin && !ios) || openbsd
+// +build darwin,!ios openbsd
 
 package rand
 
index e1a410a454144627108c7e449430b671b2689930..c75006bf8b686742463b1d601d2ec51eff20cf46 100644 (file)
@@ -2,6 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build darwin && !ios
+// +build darwin,!ios
+
 package unix
 
 import (