Skip to content

Commit

Permalink
Remove remaining uses of extern crate in openssl, systest
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Jan 1, 2021
1 parent a80c8ef commit 7f4d6fa
Show file tree
Hide file tree
Showing 26 changed files with 25 additions and 13 deletions.
1 change: 1 addition & 0 deletions openssl/src/asn1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//! use openssl::asn1::Asn1Time;
//! let tomorrow = Asn1Time::days_from_now(1);
//! ```
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use libc::{c_char, c_int, c_long, time_t};
#[cfg(ossl102)]
Expand Down
1 change: 1 addition & 0 deletions openssl/src/bio.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cfg_if::cfg_if;
use libc::c_int;
use std::marker::PhantomData;
use std::ptr;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/bn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//! ```
//!
//! [`BIGNUM`]: https://wiki.openssl.org/index.php/Manual:Bn_internal(3)
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use libc::c_int;
use std::cmp::Ordering;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/cms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! generated from a `Vec` of bytes. This `Vec` follows the smime protocol standards.
//! Data accepted by this module will be smime type `enveloped-data`.
use bitflags::bitflags;
use foreign_types::{ForeignType, ForeignTypeRef};
use libc::c_uint;
use std::ptr;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/dh.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use std::mem;
use std::ptr;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/dsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! using the private key that can be validated with the public key but not be generated
//! without the private key.
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use libc::c_int;
use std::fmt;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/ecdsa.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Low level Elliptic Curve Digital Signature Algorithm (ECDSA) functions.
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use libc::c_int;
use std::mem;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/hash.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cfg_if::cfg_if;
use std::ffi::CString;
use std::fmt;
use std::io;
Expand Down
10 changes: 0 additions & 10 deletions openssl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,6 @@
#![doc(html_root_url = "https://docs.rs/openssl/0.10")]
#![warn(rust_2018_idioms)]

#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate cfg_if;
#[macro_use]
extern crate foreign_types;

#[cfg(test)]
extern crate hex;

#[doc(inline)]
pub use ffi::init;

Expand Down
2 changes: 1 addition & 1 deletion openssl/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ macro_rules! foreign_type_and_impl_send_sync {
pub struct $borrowed:ident;
)
=> {
foreign_type! {
::foreign_types::foreign_type! {
$(#[$impl_attr])*
type CType = $ctype;
fn drop = $drop;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/ocsp.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use bitflags::bitflags;
use foreign_types::ForeignTypeRef;
use libc::{c_int, c_long, c_ulong};
use std::mem;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/pkcs7.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use bitflags::bitflags;
use foreign_types::ForeignTypeRef;
use libc::c_int;
use std::ptr;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/pkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
//! println!("{:?}", str::from_utf8(pub_key.as_slice()).unwrap());
//! ```
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use libc::{c_int, c_long};
use std::ffi::CString;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/rsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
//! let mut buf = vec![0; rsa.size() as usize];
//! let encrypted_len = rsa.public_encrypt(data, &mut buf, Padding::PKCS1).unwrap();
//! ```
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use libc::c_int;
use std::fmt;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
//! # let target = hmac.clone();
//! assert!(memcmp::eq(&hmac, &target));
//! ```
use cfg_if::cfg_if;
use foreign_types::ForeignTypeRef;
use libc::c_int;
use std::io::{self, Write};
Expand Down
1 change: 1 addition & 0 deletions openssl/src/ssl/bio.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cfg_if::cfg_if;
use ffi::{
self, BIO_clear_retry_flags, BIO_new, BIO_set_retry_read, BIO_set_retry_write, BIO,
BIO_CTRL_DGRAM_QUERY_MTU, BIO_CTRL_FLUSH,
Expand Down
1 change: 1 addition & 0 deletions openssl/src/ssl/callbacks.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cfg_if::cfg_if;
use foreign_types::ForeignType;
use foreign_types::ForeignTypeRef;
#[cfg(any(ossl111, not(osslconf = "OPENSSL_NO_PSK")))]
Expand Down
1 change: 1 addition & 0 deletions openssl/src/ssl/connector.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cfg_if::cfg_if;
use std::io::{Read, Write};
use std::ops::{Deref, DerefMut};

Expand Down
2 changes: 2 additions & 0 deletions openssl/src/ssl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
//! }
//! }
//! ```
use bitflags::bitflags;
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef, Opaque};
use libc::{c_char, c_int, c_long, c_uchar, c_uint, c_ulong, c_void};
use once_cell::sync::{Lazy, OnceCell};
Expand Down
1 change: 1 addition & 0 deletions openssl/src/stack.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef, Opaque};
use libc::c_int;
use std::borrow::Borrow;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/symm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
//! println!("Decrypted: '{}'", output_string);
//! ```
use cfg_if::cfg_if;
use libc::c_int;
use std::cmp;
use std::ptr;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// limitations under the License.
//

use cfg_if::cfg_if;
use std::ffi::CStr;

cfg_if! {
Expand Down
1 change: 1 addition & 0 deletions openssl/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! Internet protocols, including SSL/TLS, which is the basis for HTTPS,
//! the secure protocol for browsing the web.
use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use libc::{c_int, c_long};
use std::error::Error;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/x509/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
//! let store: X509Store = builder.build();
//! ```
use cfg_if::cfg_if;
use foreign_types::ForeignTypeRef;
use std::mem;

Expand Down
1 change: 1 addition & 0 deletions openssl/src/x509/verify.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use bitflags::bitflags;
use foreign_types::ForeignTypeRef;
use libc::{c_uint, c_ulong};
use std::net::IpAddr;
Expand Down
2 changes: 0 additions & 2 deletions systest/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate ctest;

use std::env;

#[path = "../openssl-sys/build/cfgs.rs"]
Expand Down

0 comments on commit 7f4d6fa

Please sign in to comment.