diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2021-08-19 16:36:38 +0200 |
---|---|---|
committer | Cherry Mui <cherryyz@google.com> | 2021-09-01 17:08:11 +0000 |
commit | c35f8a37d916b70bf70d16be93051a2e49696be3 (patch) | |
tree | 4febafd5acf8847a22db69dd3b35f1e91601b9b3 /src | |
parent | 47a57bc4f0c6a2b7ac12d4eed4ce305446654459 (diff) | |
download | go-c35f8a37d916b70bf70d16be93051a2e49696be3.tar.gz go-c35f8a37d916b70bf70d16be93051a2e49696be3.zip |
[release-branch.go1.17] crypto/rand, internal/syscall/unix: don't use getentropy on iOS
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
Diffstat (limited to 'src')
-rw-r--r-- | src/crypto/rand/rand_getentropy.go | 4 | ||||
-rw-r--r-- | src/internal/syscall/unix/getentropy_darwin.go | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/crypto/rand/rand_getentropy.go b/src/crypto/rand/rand_getentropy.go index f82018a495..dd725372ad 100644 --- a/src/crypto/rand/rand_getentropy.go +++ b/src/crypto/rand/rand_getentropy.go @@ -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 diff --git a/src/internal/syscall/unix/getentropy_darwin.go b/src/internal/syscall/unix/getentropy_darwin.go index e1a410a454..c75006bf8b 100644 --- a/src/internal/syscall/unix/getentropy_darwin.go +++ b/src/internal/syscall/unix/getentropy_darwin.go @@ -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 ( |