Commit 6ff2ba80 authored by Adam Barth's avatar Adam Barth Committed by CQ bot account: [email protected]
Browse files

[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 <[email protected]>
Reviewed-by: default avatarDavid Benjamin <[email protected]>
CQ-Verified: CQ bot account: [email protected] <[email protected]>
parent 43eb0af5
......@@ -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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment