diff options
| author | Steven Fackler <[email protected]> | 2016-11-05 20:06:50 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-11-05 20:06:50 -0700 |
| commit | a0b56c437803a08413755928040a0970a93a7b83 (patch) | |
| tree | 0f21848301b62d6078eafaee10e513df4163087b /openssl/src/crypto/rand.rs | |
| parent | Merge branch 'release-v0.8.3' into release (diff) | |
| parent | Release v0.9.0 (diff) | |
| download | rust-openssl-0.9.0.tar.xz rust-openssl-0.9.0.zip | |
Merge branch 'release-v0.9.0' into releasev0.9.0
Diffstat (limited to 'openssl/src/crypto/rand.rs')
| -rw-r--r-- | openssl/src/crypto/rand.rs | 23 |
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(); - } -} |