[fuchsia] Update to zx_cprng_draw

This CL updates our use of zx_cprng_draw to the target semantics. This
syscall now always produces the requested random bytes and never fails.
If the call would fail, the process is terminated instead.

Change-Id: I3cc3145f4c8e22252533cf1a174ac5ac70d21db7
Reviewed-on: https://chromium-review.googlesource.com/1119161
Reviewed-by: Scott Graham <scottmg@chromium.org>
diff --git a/base/rand_util.cc b/base/rand_util.cc
index 8f55cf3..ae5cdbf 100644
--- a/base/rand_util.cc
+++ b/base/rand_util.cc
@@ -110,19 +110,7 @@
   }
 
 #if defined(OS_FUCHSIA)
-  char* output_ptr = reinterpret_cast<char*>(output);
-  while (output_length > 0) {
-    // The syscall has a maximum number of bytes that can be read at once.
-    // TODO(scottmg): See ZX-1419, where this may be changed.
-    const size_t bytes_this_pass =
-        std::min(output_length, static_cast<size_t>(ZX_CPRNG_DRAW_MAX_LEN));
-
-    zx_status_t status = zx_cprng_draw_new(output_ptr, bytes_this_pass);
-    ZX_CHECK(status == ZX_OK, status) << "zx_cprng_draw_new";
-
-    output_length -= bytes_this_pass;
-    output_ptr += bytes_this_pass;
-  }
+  zx_cprng_draw(output, output_length);
 #elif defined(OS_POSIX)
   int fd = GetUrandomFD();
   bool success = ReadFromFD(fd, static_cast<char*>(output), output_length);