diff options
author | David Benjamin <davidben@chromium.org> | 2015-08-07 02:26:27 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-08-07 05:02:24 +0300 |
commit | 1be2ec67563f04728a4a65c798fa6a3f584f04ea (patch) | |
tree | f7315308c5c97e8dbcc2991592b124cdc1d4b09d /crypto/rand/rand.c | |
parent | b2d987b47c7e87477aa4230bf7b237ea79957c1e (diff) |
Fold CRYPTO_hwrand and CRYPTO_have_hwrand together.
Since the caller must check for CRYPTO_hwrand failures anyway, there's not much
point in doing the CRYPTO_have_hwrand check externally.
(As a bonus, CRYPTO_hwrand no longer compiles to abort() on ARM, so linker
deduplicating won't confuse Chrome's crash reporter...)
Change-Id: I2191d835fbda5b70812f14cd9a873a5e35c30c6d
Reviewed-on: https://boringssl-review.googlesource.com/5630
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/rand/rand.c')
-rw-r--r-- | crypto/rand/rand.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/rand/rand.c b/crypto/rand/rand.c index 39695203..e76a120d 100644 --- a/crypto/rand/rand.c +++ b/crypto/rand/rand.c @@ -75,8 +75,7 @@ int RAND_bytes(uint8_t *buf, size_t len) { return 1; } - if (!CRYPTO_have_hwrand() || - !CRYPTO_hwrand(buf, len)) { + if (!CRYPTO_hwrand(buf, len)) { /* Without a hardware RNG to save us from address-space duplication, the OS * entropy is used directly. */ CRYPTO_sysrand(buf, len); |