[fuchsia] Update to zx_cprng_draw_new
The new version of zx_cprng_draw either succeeds in reading the
requested amount of data or fails entirely. A future CL will rename
zx_cprng_draw_new to zx_cprng_draw once zx_cprng_draw has this new
behavior.
Change-Id: I08acad6a3443cb295f7855afdd63010dcf872820
Reviewed-on: https://dart-review.googlesource.com/59861
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Adam Barth <abarth@google.com>
diff --git a/runtime/bin/crypto_fuchsia.cc b/runtime/bin/crypto_fuchsia.cc
index fed07cf..d5297ae 100644
--- a/runtime/bin/crypto_fuchsia.cc
+++ b/runtime/bin/crypto_fuchsia.cc
@@ -18,12 +18,11 @@
const intptr_t remaining = count - read;
const intptr_t len =
(ZX_CPRNG_DRAW_MAX_LEN < remaining) ? ZX_CPRNG_DRAW_MAX_LEN : remaining;
- size_t res = 0;
- const zx_status_t status = zx_cprng_draw(buffer + read, len, &res);
+ const zx_status_t status = zx_cprng_draw_new(buffer + read, len);
if (status != ZX_OK) {
return false;
}
- read += res;
+ read += len;
}
return true;
}