[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>
This commit is contained in:
Adam Barth 2018-06-12 00:26:07 -07:00 committed by CQ bot account: commit-bot@chromium.org
parent 43eb0af5f1
commit 6ff2ba80b7

View File

@ -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;
}
}