Loading openssl/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ ecdh_auto = ["openssl-sys-extras/ecdh_auto"] pkcs5_pbkdf2_hmac = ["openssl-sys/pkcs5_pbkdf2_hmac"] nightly = [] catch_unwind = [] [dependencies] bitflags = ">= 0.5.0, < 0.8.0" Loading openssl/src/crypto/mod.rs +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ pub mod rand; pub mod symm; pub mod memcmp; pub mod rsa; #[cfg(feature = "catch_unwind")] mod util; mod symm_internal; Loading openssl/src/crypto/pkey.rs +6 −1 Original line number Diff line number Diff line use libc::{c_int, c_uint, c_ulong, c_void, c_char}; use libc::{c_int, c_uint, c_ulong}; use std::io; use std::io::prelude::*; use std::iter::repeat; Loading @@ -12,6 +12,10 @@ use crypto::hash::Type as HashType; use ffi; use ssl::error::{SslError, StreamError}; use crypto::rsa::RSA; #[cfg(feature = "catch_unwind")] use libc::{c_void, c_char}; #[cfg(feature = "catch_unwind")] use crypto::util::{CallbackState, invoke_passwd_cb}; #[derive(Copy, Clone)] Loading Loading @@ -99,6 +103,7 @@ impl PKey { /// /// The callback will be passed the password buffer and should return the number of characters /// placed into the buffer. #[cfg(feature = "catch_unwind")] pub fn private_key_from_pem_cb<R, F>(reader: &mut R, pass_cb: F) -> Result<PKey, SslError> where R: Read, F: FnMut(&mut [c_char]) -> usize { Loading openssl/src/crypto/rsa.rs +6 −1 Original line number Diff line number Diff line Loading @@ -3,12 +3,16 @@ use std::fmt; use ssl::error::{SslError, StreamError}; use std::ptr; use std::io::{self, Read, Write}; use libc::{c_int, c_void, c_char}; use libc::c_int; use bn::BigNum; use bio::MemBio; use crypto::HashTypeInternals; use crypto::hash; #[cfg(feature = "catch_unwind")] use libc::{c_void, c_char}; #[cfg(feature = "catch_unwind")] use crypto::util::{CallbackState, invoke_passwd_cb}; pub struct RSA(*mut ffi::RSA); Loading Loading @@ -78,6 +82,7 @@ impl RSA { } /// Reads an RSA private key from PEM formatted data and supplies a password callback. #[cfg(feature = "catch_unwind")] pub fn private_key_from_pem_cb<R, F>(reader: &mut R, pass_cb: F) -> Result<RSA, SslError> where R: Read, F: FnMut(&mut [c_char]) -> usize { Loading Loading
openssl/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ ecdh_auto = ["openssl-sys-extras/ecdh_auto"] pkcs5_pbkdf2_hmac = ["openssl-sys/pkcs5_pbkdf2_hmac"] nightly = [] catch_unwind = [] [dependencies] bitflags = ">= 0.5.0, < 0.8.0" Loading
openssl/src/crypto/mod.rs +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ pub mod rand; pub mod symm; pub mod memcmp; pub mod rsa; #[cfg(feature = "catch_unwind")] mod util; mod symm_internal; Loading
openssl/src/crypto/pkey.rs +6 −1 Original line number Diff line number Diff line use libc::{c_int, c_uint, c_ulong, c_void, c_char}; use libc::{c_int, c_uint, c_ulong}; use std::io; use std::io::prelude::*; use std::iter::repeat; Loading @@ -12,6 +12,10 @@ use crypto::hash::Type as HashType; use ffi; use ssl::error::{SslError, StreamError}; use crypto::rsa::RSA; #[cfg(feature = "catch_unwind")] use libc::{c_void, c_char}; #[cfg(feature = "catch_unwind")] use crypto::util::{CallbackState, invoke_passwd_cb}; #[derive(Copy, Clone)] Loading Loading @@ -99,6 +103,7 @@ impl PKey { /// /// The callback will be passed the password buffer and should return the number of characters /// placed into the buffer. #[cfg(feature = "catch_unwind")] pub fn private_key_from_pem_cb<R, F>(reader: &mut R, pass_cb: F) -> Result<PKey, SslError> where R: Read, F: FnMut(&mut [c_char]) -> usize { Loading
openssl/src/crypto/rsa.rs +6 −1 Original line number Diff line number Diff line Loading @@ -3,12 +3,16 @@ use std::fmt; use ssl::error::{SslError, StreamError}; use std::ptr; use std::io::{self, Read, Write}; use libc::{c_int, c_void, c_char}; use libc::c_int; use bn::BigNum; use bio::MemBio; use crypto::HashTypeInternals; use crypto::hash; #[cfg(feature = "catch_unwind")] use libc::{c_void, c_char}; #[cfg(feature = "catch_unwind")] use crypto::util::{CallbackState, invoke_passwd_cb}; pub struct RSA(*mut ffi::RSA); Loading Loading @@ -78,6 +82,7 @@ impl RSA { } /// Reads an RSA private key from PEM formatted data and supplies a password callback. #[cfg(feature = "catch_unwind")] pub fn private_key_from_pem_cb<R, F>(reader: &mut R, pass_cb: F) -> Result<RSA, SslError> where R: Read, F: FnMut(&mut [c_char]) -> usize { Loading