Loading openssl/src/dh.rs +4 −4 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ use foreign_types::ForeignTypeRef; use std::mem; use std::ptr; use {cvt, cvt_p, init}; use {cvt, cvt_p}; use bn::BigNum; foreign_type! { Loading Loading @@ -43,7 +43,7 @@ impl Dh { #[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] pub fn get_1024_160() -> Result<Dh, ErrorStack> { unsafe { init(); ffi::init(); cvt_p(ffi::DH_get_1024_160()).map(Dh) } } Loading @@ -52,7 +52,7 @@ impl Dh { #[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] pub fn get_2048_224() -> Result<Dh, ErrorStack> { unsafe { init(); ffi::init(); cvt_p(ffi::DH_get_2048_224()).map(Dh) } } Loading @@ -61,7 +61,7 @@ impl Dh { #[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] pub fn get_2048_256() -> Result<Dh, ErrorStack> { unsafe { init(); ffi::init(); cvt_p(ffi::DH_get_2048_256()).map(Dh) } } Loading openssl/src/ssl/tests/mod.rs +0 −72 Original line number Diff line number Diff line Loading @@ -114,29 +114,6 @@ impl Server { ], ) } fn new_dtlsv1<I>(input: I) -> (Server, UdpConnected) where I: IntoIterator<Item = &'static str>, I::IntoIter: Send + 'static, { let mut input = input.into_iter(); let (s, addr) = Server::spawn( &["-dtls1"], Some(Box::new(move |mut io| for s in input.by_ref() { if io.write_all(s.as_bytes()).is_err() { break; } })), ); // Need to wait for the UDP socket to get bound in our child process, // but don't currently have a great way to do that so just wait for a // bit. thread::sleep(Duration::from_millis(100)); let socket = UdpSocket::bind("127.0.0.1:0").unwrap(); socket.connect(&addr).unwrap(); (s, UdpConnected(socket)) } } impl Drop for Server { Loading @@ -146,25 +123,6 @@ impl Drop for Server { } } #[derive(Debug)] struct UdpConnected(UdpSocket); impl Read for UdpConnected { fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { self.0.recv(buf) } } impl Write for UdpConnected { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.0.send(buf) } fn flush(&mut self) -> io::Result<()> { Ok(()) } } macro_rules! run_test( ($module:ident, $blk:expr) => ( #[cfg(test)] Loading Loading @@ -195,13 +153,6 @@ macro_rules! run_test( let (_s, stream) = Server::new(); $blk(SslMethod::tls(), stream); } #[test] #[ignore] // FIXME(#467) fn dtlsv1() { let (_s, stream) = Server::new_dtlsv1(Some("hello")); $blk(SslMethod::dtls(), stream); } } ); ); Loading Loading @@ -479,18 +430,6 @@ run_test!(get_peer_certificate, |method, stream| { assert_eq!(node_id, fingerprint) }); #[test] #[cfg_attr(any(libressl, windows, target_arch = "arm"), ignore)] // FIXME(#467) fn test_write_dtlsv1() { let (_s, stream) = Server::new_dtlsv1(iter::repeat("y\n")); let ctx = SslContext::builder(SslMethod::dtls()).unwrap(); let mut stream = Ssl::new(&ctx.build()).unwrap().connect(stream).unwrap(); stream.write_all(b"hello").unwrap(); stream.flush().unwrap(); stream.write_all(b" there").unwrap(); stream.flush().unwrap(); } #[test] fn test_read() { let (_s, tcp) = Server::new(); Loading Loading @@ -796,17 +735,6 @@ fn test_alpn_server_select_none() { assert_eq!(None, stream.ssl().selected_alpn_protocol()); } #[test] #[cfg_attr(any(libressl, windows, target_arch = "arm"), ignore)] // FIXME(#467) fn test_read_dtlsv1() { let (_s, stream) = Server::new_dtlsv1(Some("hello")); let ctx = SslContext::builder(SslMethod::dtls()).unwrap(); let mut stream = Ssl::new(&ctx.build()).unwrap().connect(stream).unwrap(); let mut buf = [0u8; 100]; assert!(stream.read(&mut buf).is_ok()); } fn wait_io(stream: &TcpStream, read: bool, timeout_ms: u32) -> bool { unsafe { let mut set: select::fd_set = mem::zeroed(); Loading Loading
openssl/src/dh.rs +4 −4 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ use foreign_types::ForeignTypeRef; use std::mem; use std::ptr; use {cvt, cvt_p, init}; use {cvt, cvt_p}; use bn::BigNum; foreign_type! { Loading Loading @@ -43,7 +43,7 @@ impl Dh { #[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] pub fn get_1024_160() -> Result<Dh, ErrorStack> { unsafe { init(); ffi::init(); cvt_p(ffi::DH_get_1024_160()).map(Dh) } } Loading @@ -52,7 +52,7 @@ impl Dh { #[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] pub fn get_2048_224() -> Result<Dh, ErrorStack> { unsafe { init(); ffi::init(); cvt_p(ffi::DH_get_2048_224()).map(Dh) } } Loading @@ -61,7 +61,7 @@ impl Dh { #[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] pub fn get_2048_256() -> Result<Dh, ErrorStack> { unsafe { init(); ffi::init(); cvt_p(ffi::DH_get_2048_256()).map(Dh) } } Loading
openssl/src/ssl/tests/mod.rs +0 −72 Original line number Diff line number Diff line Loading @@ -114,29 +114,6 @@ impl Server { ], ) } fn new_dtlsv1<I>(input: I) -> (Server, UdpConnected) where I: IntoIterator<Item = &'static str>, I::IntoIter: Send + 'static, { let mut input = input.into_iter(); let (s, addr) = Server::spawn( &["-dtls1"], Some(Box::new(move |mut io| for s in input.by_ref() { if io.write_all(s.as_bytes()).is_err() { break; } })), ); // Need to wait for the UDP socket to get bound in our child process, // but don't currently have a great way to do that so just wait for a // bit. thread::sleep(Duration::from_millis(100)); let socket = UdpSocket::bind("127.0.0.1:0").unwrap(); socket.connect(&addr).unwrap(); (s, UdpConnected(socket)) } } impl Drop for Server { Loading @@ -146,25 +123,6 @@ impl Drop for Server { } } #[derive(Debug)] struct UdpConnected(UdpSocket); impl Read for UdpConnected { fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { self.0.recv(buf) } } impl Write for UdpConnected { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.0.send(buf) } fn flush(&mut self) -> io::Result<()> { Ok(()) } } macro_rules! run_test( ($module:ident, $blk:expr) => ( #[cfg(test)] Loading Loading @@ -195,13 +153,6 @@ macro_rules! run_test( let (_s, stream) = Server::new(); $blk(SslMethod::tls(), stream); } #[test] #[ignore] // FIXME(#467) fn dtlsv1() { let (_s, stream) = Server::new_dtlsv1(Some("hello")); $blk(SslMethod::dtls(), stream); } } ); ); Loading Loading @@ -479,18 +430,6 @@ run_test!(get_peer_certificate, |method, stream| { assert_eq!(node_id, fingerprint) }); #[test] #[cfg_attr(any(libressl, windows, target_arch = "arm"), ignore)] // FIXME(#467) fn test_write_dtlsv1() { let (_s, stream) = Server::new_dtlsv1(iter::repeat("y\n")); let ctx = SslContext::builder(SslMethod::dtls()).unwrap(); let mut stream = Ssl::new(&ctx.build()).unwrap().connect(stream).unwrap(); stream.write_all(b"hello").unwrap(); stream.flush().unwrap(); stream.write_all(b" there").unwrap(); stream.flush().unwrap(); } #[test] fn test_read() { let (_s, tcp) = Server::new(); Loading Loading @@ -796,17 +735,6 @@ fn test_alpn_server_select_none() { assert_eq!(None, stream.ssl().selected_alpn_protocol()); } #[test] #[cfg_attr(any(libressl, windows, target_arch = "arm"), ignore)] // FIXME(#467) fn test_read_dtlsv1() { let (_s, stream) = Server::new_dtlsv1(Some("hello")); let ctx = SslContext::builder(SslMethod::dtls()).unwrap(); let mut stream = Ssl::new(&ctx.build()).unwrap().connect(stream).unwrap(); let mut buf = [0u8; 100]; assert!(stream.read(&mut buf).is_ok()); } fn wait_io(stream: &TcpStream, read: bool, timeout_ms: u32) -> bool { unsafe { let mut set: select::fd_set = mem::zeroed(); Loading