aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/crypto/rand.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/src/crypto/rand.rs')
-rw-r--r--openssl/src/crypto/rand.rs23
1 files changed, 0 insertions, 23 deletions
diff --git a/openssl/src/crypto/rand.rs b/openssl/src/crypto/rand.rs
deleted file mode 100644
index 519449e9..00000000
--- a/openssl/src/crypto/rand.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-use libc::c_int;
-use ffi;
-use error::ErrorStack;
-
-pub fn rand_bytes(buf: &mut [u8]) -> Result<(), ErrorStack> {
- unsafe {
- ffi::init();
- assert!(buf.len() <= c_int::max_value() as usize);
- try_ssl_if!(ffi::RAND_bytes(buf.as_mut_ptr(), buf.len() as c_int) != 1);
- Ok(())
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::rand_bytes;
-
- #[test]
- fn test_rand_bytes() {
- let mut buf = [0; 32];
- rand_bytes(&mut buf).unwrap();
- }
-}