Fix error condition in new iOS CRYPTO_sysrand
Possibly we should run this on macOS too, so we have better test
coverage.
Bug: 287
Change-Id: I3005a445f8cb7559e91317be91a42c1db15f081a
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61529
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
diff --git a/crypto/rand_extra/ios.c b/crypto/rand_extra/ios.c
index c41d0d1..73f0ef3 100644
--- a/crypto/rand_extra/ios.c
+++ b/crypto/rand_extra/ios.c
@@ -22,7 +22,7 @@
#include <CommonCrypto/CommonRandom.h>
void CRYPTO_sysrand(uint8_t *out, size_t requested) {
- if (CCRandomGenerateBytes(out, requested) == kCCSuccess) {
+ if (CCRandomGenerateBytes(out, requested) != kCCSuccess) {
abort();
}
}