[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 <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/crypto/rand_extra/fuchsia.c b/crypto/rand_extra/fuchsia.c
index ce8356c..0a0d7f0 100644
--- a/crypto/rand_extra/fuchsia.c
+++ b/crypto/rand_extra/fuchsia.c
@@ -29,14 +29,12 @@
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;
}
}