From 6ff2ba80b758025fdb137d9357dcbba0a9c04dbf Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 12 Jun 2018 00:26:07 -0700 Subject: [PATCH] [fuchsia] Update to zx_cprng_draw_new This version doesn't have short reads. We'll eventually rename the syscall back to zx_cprng_draw once all the clients have migrated to the new semantics. Change-Id: I7a7f6751e4d85dcc9b0a03a533dd93f3cbee277f Reviewed-on: https://boringssl-review.googlesource.com/29084 Commit-Queue: David Benjamin Reviewed-by: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/rand_extra/fuchsia.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crypto/rand_extra/fuchsia.c b/crypto/rand_extra/fuchsia.c index ce8356c0..0a0d7f09 100644 --- a/crypto/rand_extra/fuchsia.c +++ b/crypto/rand_extra/fuchsia.c @@ -29,14 +29,12 @@ void CRYPTO_sysrand(uint8_t *out, size_t requested) { if (requested < output_bytes_this_pass) { output_bytes_this_pass = requested; } - size_t bytes_drawn; - zx_status_t status = - zx_cprng_draw(out, output_bytes_this_pass, &bytes_drawn); + zx_status_t status = zx_cprng_draw_new(out, output_bytes_this_pass); if (status != ZX_OK) { abort(); } - requested -= bytes_drawn; - out += bytes_drawn; + requested -= output_bytes_this_pass; + out += output_bytes_this_pass; } }