From 1be2ec67563f04728a4a65c798fa6a3f584f04ea Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 6 Aug 2015 19:26:27 -0400 Subject: 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 --- crypto/rand/rand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crypto/rand/rand.c') 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); -- cgit v1.2.3