[rust] Add RAND symbols

- Add "RAND_" to the list of prefixes added by bindgen

SEC-97

Test: Tested //garnet/public/rust/crates/mundane-crypto
Change-Id: I58f68d100590e4a76c7e7ea602ca96ab30265fc2
diff --git a/rust/boringssl-sys/bindgen.sh b/rust/boringssl-sys/bindgen.sh
index 8034ba9..3903631 100755
--- a/rust/boringssl-sys/bindgen.sh
+++ b/rust/boringssl-sys/bindgen.sh
@@ -27,7 +27,7 @@
 # Whitelist BoringSSL-related symbols so we don't get non-BoringSSL symbols such
 # as platform-specific symbols (specific to the platform that is running
 # 'bindgen') and other C standard library symbols.
-WHITELIST="(ERR|BIO|CRYPTO|V_ASN1|ASN1|B_ASN1|CBS_ASN1|CAST|EVP|CBS|CBB|CIPHER|OPENSSL|SSLEAY|DH|DES|DIGEST|DSA|NID|EC|ECDSA|ECDH|SHA|SHA1|SHA224|SHA256|SHA384|SHA512|HMAC)_.*"
+WHITELIST="(ERR|BIO|CRYPTO|RAND|V_ASN1|ASN1|B_ASN1|CBS_ASN1|CAST|EVP|CBS|CBB|CIPHER|OPENSSL|SSLEAY|DH|DES|DIGEST|DSA|NID|EC|ECDSA|ECDH|SHA|SHA1|SHA224|SHA256|SHA384|SHA512|HMAC)_.*"
 # NOTE(joshlf) on --target: Currently, we just pass x86_64 since none of the
 # symbols we're linking against are architecture-specific (they may be
 # word-size-specific, but Fuchsia only targets 64-bit platforms). If this ever
diff --git a/rust/boringssl-sys/src/lib.rs b/rust/boringssl-sys/src/lib.rs
index 48d6cf5..620ff73 100644
--- a/rust/boringssl-sys/src/lib.rs
+++ b/rust/boringssl-sys/src/lib.rs
@@ -6,7 +6,8 @@
 #![allow(non_snake_case)]
 #![allow(non_upper_case_globals)]
 
-#[link(name = "crypto")] extern {}
+#[link(name = "crypto")]
+extern "C" {}
 
 /* automatically generated by rust-bindgen */
 
@@ -579,6 +580,7 @@
 pub const CIPHER_R_WRONG_FINAL_BLOCK_LENGTH: u32 = 123;
 pub const CIPHER_R_NO_DIRECTION_SET: u32 = 124;
 pub const CIPHER_R_INVALID_NONCE: u32 = 125;
+pub const RAND_MAX: u32 = 2147483647;
 pub const OPENSSL_VERSION_TEXT: &'static [u8; 38usize] = b"OpenSSL 1.1.0 (compatible; BoringSSL)\0";
 pub const OPENSSL_VERSION: u32 = 0;
 pub const OPENSSL_CFLAGS: u32 = 1;
@@ -1838,6 +1840,7 @@
 }
 pub type OPENSSL_INIT_SETTINGS = ossl_init_settings_st;
 pub type PKCS8_PRIV_KEY_INFO = pkcs8_priv_key_info_st;
+pub type RAND_METHOD = rand_meth_st;
 pub type RSA_METHOD = rsa_meth_st;
 pub type RSA = rsa_st;
 pub type SHA256_CTX = sha256_state_st;
@@ -12252,6 +12255,152 @@
     pub fn CRYPTO_poly1305_finish(state: *mut poly1305_state, mac: *mut u8);
 }
 extern "C" {
+    pub fn RAND_bytes(buf: *mut u8, len: usize) -> ::std::os::raw::c_int;
+}
+extern "C" {
+    pub fn RAND_cleanup();
+}
+extern "C" {
+    pub fn RAND_set_urandom_fd(fd: ::std::os::raw::c_int);
+}
+extern "C" {
+    pub fn RAND_enable_fork_unsafe_buffering(fd: ::std::os::raw::c_int);
+}
+extern "C" {
+    pub fn RAND_pseudo_bytes(buf: *mut u8, len: usize) -> ::std::os::raw::c_int;
+}
+extern "C" {
+    pub fn RAND_seed(buf: *const ::std::os::raw::c_void, num: ::std::os::raw::c_int);
+}
+extern "C" {
+    pub fn RAND_load_file(
+        path: *const ::std::os::raw::c_char,
+        num: ::std::os::raw::c_long,
+    ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+    pub fn RAND_file_name(
+        buf: *mut ::std::os::raw::c_char,
+        num: usize,
+    ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+    pub fn RAND_add(buf: *const ::std::os::raw::c_void, num: ::std::os::raw::c_int, entropy: f64);
+}
+extern "C" {
+    pub fn RAND_egd(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
+}
+extern "C" {
+    pub fn RAND_poll() -> ::std::os::raw::c_int;
+}
+extern "C" {
+    pub fn RAND_status() -> ::std::os::raw::c_int;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct rand_meth_st {
+    pub seed: ::std::option::Option<
+        unsafe extern "C" fn(buf: *const ::std::os::raw::c_void, num: ::std::os::raw::c_int),
+    >,
+    pub bytes: ::std::option::Option<
+        unsafe extern "C" fn(buf: *mut u8, num: usize) -> ::std::os::raw::c_int,
+    >,
+    pub cleanup: ::std::option::Option<unsafe extern "C" fn()>,
+    pub add: ::std::option::Option<
+        unsafe extern "C" fn(
+            buf: *const ::std::os::raw::c_void,
+            num: ::std::os::raw::c_int,
+            entropy: f64,
+        ),
+    >,
+    pub pseudorand: ::std::option::Option<
+        unsafe extern "C" fn(buf: *mut u8, num: usize) -> ::std::os::raw::c_int,
+    >,
+    pub status: ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>,
+}
+#[test]
+fn bindgen_test_layout_rand_meth_st() {
+    assert_eq!(
+        ::std::mem::size_of::<rand_meth_st>(),
+        48usize,
+        concat!("Size of: ", stringify!(rand_meth_st))
+    );
+    assert_eq!(
+        ::std::mem::align_of::<rand_meth_st>(),
+        8usize,
+        concat!("Alignment of ", stringify!(rand_meth_st))
+    );
+    assert_eq!(
+        unsafe { &(*(::std::ptr::null::<rand_meth_st>())).seed as *const _ as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(rand_meth_st),
+            "::",
+            stringify!(seed)
+        )
+    );
+    assert_eq!(
+        unsafe { &(*(::std::ptr::null::<rand_meth_st>())).bytes as *const _ as usize },
+        8usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(rand_meth_st),
+            "::",
+            stringify!(bytes)
+        )
+    );
+    assert_eq!(
+        unsafe { &(*(::std::ptr::null::<rand_meth_st>())).cleanup as *const _ as usize },
+        16usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(rand_meth_st),
+            "::",
+            stringify!(cleanup)
+        )
+    );
+    assert_eq!(
+        unsafe { &(*(::std::ptr::null::<rand_meth_st>())).add as *const _ as usize },
+        24usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(rand_meth_st),
+            "::",
+            stringify!(add)
+        )
+    );
+    assert_eq!(
+        unsafe { &(*(::std::ptr::null::<rand_meth_st>())).pseudorand as *const _ as usize },
+        32usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(rand_meth_st),
+            "::",
+            stringify!(pseudorand)
+        )
+    );
+    assert_eq!(
+        unsafe { &(*(::std::ptr::null::<rand_meth_st>())).status as *const _ as usize },
+        40usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(rand_meth_st),
+            "::",
+            stringify!(status)
+        )
+    );
+}
+extern "C" {
+    pub fn RAND_SSLeay() -> *mut RAND_METHOD;
+}
+extern "C" {
+    pub fn RAND_get_rand_method() -> *const RAND_METHOD;
+}
+extern "C" {
+    pub fn RAND_set_rand_method(arg1: *const RAND_METHOD);
+}
+extern "C" {
     pub fn ERR_load_SSL_strings();
 }
 extern "C" {