Fuchsia has getentropy() via musl - use it and drop the custom file
Bug: 287 Change-Id: Ia907c5dd7fd31e95098730673d2da1bede6d79ed Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61405 Commit-Queue: David Benjamin <davidben@google.com> Auto-Submit: Bob Beck <bbe@google.com> Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
parent
fa6ab4fe97
commit
7dc4a03360
@ -199,7 +199,6 @@ add_library(
|
||||
pool/pool.c
|
||||
rand_extra/deterministic.c
|
||||
rand_extra/forkunsafe.c
|
||||
rand_extra/fuchsia.c
|
||||
rand_extra/getentropy.c
|
||||
rand_extra/ios.c
|
||||
rand_extra/passive.c
|
||||
|
@ -28,8 +28,6 @@ extern "C" {
|
||||
|
||||
#if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE)
|
||||
#define OPENSSL_RAND_DETERMINISTIC
|
||||
#elif defined(OPENSSL_FUCHSIA)
|
||||
#define OPENSSL_RAND_FUCHSIA
|
||||
#elif defined(OPENSSL_TRUSTY)
|
||||
// Trusty's PRNG file is, for now, maintained outside the tree.
|
||||
#elif defined(OPENSSL_WINDOWS)
|
||||
|
@ -1,34 +0,0 @@
|
||||
/* Copyright (c) 2017, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
||||
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#include "../fipsmodule/rand/internal.h"
|
||||
|
||||
#if defined(OPENSSL_RAND_FUCHSIA)
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <zircon/syscalls.h>
|
||||
|
||||
void CRYPTO_sysrand(uint8_t *out, size_t requested) {
|
||||
zx_cprng_draw(out, requested);
|
||||
}
|
||||
|
||||
void CRYPTO_sysrand_for_seed(uint8_t *out, size_t requested) {
|
||||
CRYPTO_sysrand(out, requested);
|
||||
}
|
||||
|
||||
#endif // OPENSSL_RAND_FUCHSIA
|
@ -22,7 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(OPENSSL_MACOS)
|
||||
#if defined(OPENSSL_MACOS) || defined(OPENSSL_FUCHSIA)
|
||||
#include <sys/random.h>
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user