[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:
parent
43eb0af5f1
commit
6ff2ba80b7
@ -29,14 +29,12 @@ void CRYPTO_sysrand(uint8_t *out, size_t requested) {
|
|||||||
if (requested < output_bytes_this_pass) {
|
if (requested < output_bytes_this_pass) {
|
||||||
output_bytes_this_pass = requested;
|
output_bytes_this_pass = requested;
|
||||||
}
|
}
|
||||||
size_t bytes_drawn;
|
zx_status_t status = zx_cprng_draw_new(out, output_bytes_this_pass);
|
||||||
zx_status_t status =
|
|
||||||
zx_cprng_draw(out, output_bytes_this_pass, &bytes_drawn);
|
|
||||||
if (status != ZX_OK) {
|
if (status != ZX_OK) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
requested -= bytes_drawn;
|
requested -= output_bytes_this_pass;
|
||||||
out += bytes_drawn;
|
out += output_bytes_this_pass;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user