summaryrefslogtreecommitdiff
path: root/openssl
diff options
context:
space:
mode:
authorJonas Platte <jplatte+git@posteo.de>2020-12-31 22:06:14 +0100
committerJonas Platte <jplatte+git@posteo.de>2021-01-01 04:11:49 +0100
commit7f4d6fa7488902fb98774df068751ee4e16918f7 (patch)
tree1ca0fd824d250dde728af29eada9bc1c804ed59d /openssl
parenta80c8efa6f35bf0f6c3e7e39f9d849b84d3dbc35 (diff)
downloadrust-openssl-7f4d6fa7488902fb98774df068751ee4e16918f7.zip
Remove remaining uses of extern crate in openssl, systest
Diffstat (limited to 'openssl')
-rw-r--r--openssl/src/asn1.rs1
-rw-r--r--openssl/src/bio.rs1
-rw-r--r--openssl/src/bn.rs1
-rw-r--r--openssl/src/cms.rs1
-rw-r--r--openssl/src/dh.rs1
-rw-r--r--openssl/src/dsa.rs1
-rw-r--r--openssl/src/ecdsa.rs1
-rw-r--r--openssl/src/hash.rs1
-rw-r--r--openssl/src/lib.rs10
-rw-r--r--openssl/src/macros.rs2
-rw-r--r--openssl/src/ocsp.rs1
-rw-r--r--openssl/src/pkcs7.rs1
-rw-r--r--openssl/src/pkey.rs1
-rw-r--r--openssl/src/rsa.rs1
-rw-r--r--openssl/src/sign.rs1
-rw-r--r--openssl/src/ssl/bio.rs1
-rw-r--r--openssl/src/ssl/callbacks.rs1
-rw-r--r--openssl/src/ssl/connector.rs1
-rw-r--r--openssl/src/ssl/mod.rs2
-rw-r--r--openssl/src/stack.rs1
-rw-r--r--openssl/src/symm.rs1
-rw-r--r--openssl/src/version.rs1
-rw-r--r--openssl/src/x509/mod.rs1
-rw-r--r--openssl/src/x509/store.rs1
-rw-r--r--openssl/src/x509/verify.rs1
25 files changed, 25 insertions, 11 deletions
diff --git a/openssl/src/asn1.rs b/openssl/src/asn1.rs
index b7ae2031..d1323116 100644
--- a/openssl/src/asn1.rs
+++ b/openssl/src/asn1.rs
@@ -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)]
diff --git a/openssl/src/bio.rs b/openssl/src/bio.rs
index 3037fcfd..717ccd05 100644
--- a/openssl/src/bio.rs
+++ b/openssl/src/bio.rs
@@ -1,3 +1,4 @@
+use cfg_if::cfg_if;
use libc::c_int;
use std::marker::PhantomData;
use std::ptr;
diff --git a/openssl/src/bn.rs b/openssl/src/bn.rs
index 88f009e1..9639593b 100644
--- a/openssl/src/bn.rs
+++ b/openssl/src/bn.rs
@@ -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;
diff --git a/openssl/src/cms.rs b/openssl/src/cms.rs
index b23df640..a925b7c4 100644
--- a/openssl/src/cms.rs
+++ b/openssl/src/cms.rs
@@ -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;
diff --git a/openssl/src/dh.rs b/openssl/src/dh.rs
index 068b96b6..ecb703b5 100644
--- a/openssl/src/dh.rs
+++ b/openssl/src/dh.rs
@@ -1,3 +1,4 @@
+use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef};
use std::mem;
use std::ptr;
diff --git a/openssl/src/dsa.rs b/openssl/src/dsa.rs
index 5f6ab1c7..691d09ec 100644
--- a/openssl/src/dsa.rs
+++ b/openssl/src/dsa.rs
@@ -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;
diff --git a/openssl/src/ecdsa.rs b/openssl/src/ecdsa.rs
index 7773f9ab..ffd0d32a 100644
--- a/openssl/src/ecdsa.rs
+++ b/openssl/src/ecdsa.rs
@@ -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;
diff --git a/openssl/src/hash.rs b/openssl/src/hash.rs
index 23a1e5f2..317d20e2 100644
--- a/openssl/src/hash.rs
+++ b/openssl/src/hash.rs
@@ -1,3 +1,4 @@
+use cfg_if::cfg_if;
use std::ffi::CString;
use std::fmt;
use std::io;
diff --git a/openssl/src/lib.rs b/openssl/src/lib.rs
index d1e3af49..f908f3ab 100644
--- a/openssl/src/lib.rs
+++ b/openssl/src/lib.rs
@@ -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;
diff --git a/openssl/src/macros.rs b/openssl/src/macros.rs
index d1d35d27..c448bcd6 100644
--- a/openssl/src/macros.rs
+++ b/openssl/src/macros.rs
@@ -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;
diff --git a/openssl/src/ocsp.rs b/openssl/src/ocsp.rs
index 1a37cd9b..ea1a7aed 100644
--- a/openssl/src/ocsp.rs
+++ b/openssl/src/ocsp.rs
@@ -1,3 +1,4 @@
+use bitflags::bitflags;
use foreign_types::ForeignTypeRef;
use libc::{c_int, c_long, c_ulong};
use std::mem;
diff --git a/openssl/src/pkcs7.rs b/openssl/src/pkcs7.rs
index 76a96f3e..577ee16b 100644
--- a/openssl/src/pkcs7.rs
+++ b/openssl/src/pkcs7.rs
@@ -1,3 +1,4 @@
+use bitflags::bitflags;
use foreign_types::ForeignTypeRef;
use libc::c_int;
use std::ptr;
diff --git a/openssl/src/pkey.rs b/openssl/src/pkey.rs
index d7bcdf0e..32122e0b 100644
--- a/openssl/src/pkey.rs
+++ b/openssl/src/pkey.rs
@@ -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;
diff --git a/openssl/src/rsa.rs b/openssl/src/rsa.rs
index 21e647cc..fad240f0 100644
--- a/openssl/src/rsa.rs
+++ b/openssl/src/rsa.rs
@@ -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;
diff --git a/openssl/src/sign.rs b/openssl/src/sign.rs
index df42aa0e..d53c62cb 100644
--- a/openssl/src/sign.rs
+++ b/openssl/src/sign.rs
@@ -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};
diff --git a/openssl/src/ssl/bio.rs b/openssl/src/ssl/bio.rs
index 0ce85472..aed08c5e 100644
--- a/openssl/src/ssl/bio.rs
+++ b/openssl/src/ssl/bio.rs
@@ -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,
diff --git a/openssl/src/ssl/callbacks.rs b/openssl/src/ssl/callbacks.rs
index 333b60a6..99cddb01 100644
--- a/openssl/src/ssl/callbacks.rs
+++ b/openssl/src/ssl/callbacks.rs
@@ -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")))]
diff --git a/openssl/src/ssl/connector.rs b/openssl/src/ssl/connector.rs
index 855aec62..6aa4c719 100644
--- a/openssl/src/ssl/connector.rs
+++ b/openssl/src/ssl/connector.rs
@@ -1,3 +1,4 @@
+use cfg_if::cfg_if;
use std::io::{Read, Write};
use std::ops::{Deref, DerefMut};
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index e60c4bee..25d0e901 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -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};
diff --git a/openssl/src/stack.rs b/openssl/src/stack.rs
index a4936fc5..25d06eea 100644
--- a/openssl/src/stack.rs
+++ b/openssl/src/stack.rs
@@ -1,3 +1,4 @@
+use cfg_if::cfg_if;
use foreign_types::{ForeignType, ForeignTypeRef, Opaque};
use libc::c_int;
use std::borrow::Borrow;
diff --git a/openssl/src/symm.rs b/openssl/src/symm.rs
index cf0974cc..50243ed2 100644
--- a/openssl/src/symm.rs
+++ b/openssl/src/symm.rs
@@ -52,6 +52,7 @@
//! println!("Decrypted: '{}'", output_string);
//! ```
+use cfg_if::cfg_if;
use libc::c_int;
use std::cmp;
use std::ptr;
diff --git a/openssl/src/version.rs b/openssl/src/version.rs
index 0d2d5bb6..7e3ee288 100644
--- a/openssl/src/version.rs
+++ b/openssl/src/version.rs
@@ -11,6 +11,7 @@
// limitations under the License.
//
+use cfg_if::cfg_if;
use std::ffi::CStr;
cfg_if! {
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs
index 2559c593..47d91660 100644
--- a/openssl/src/x509/mod.rs
+++ b/openssl/src/x509/mod.rs
@@ -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;
diff --git a/openssl/src/x509/store.rs b/openssl/src/x509/store.rs
index 88ca3546..97593c49 100644
--- a/openssl/src/x509/store.rs
+++ b/openssl/src/x509/store.rs
@@ -35,6 +35,7 @@
//! let store: X509Store = builder.build();
//! ```
+use cfg_if::cfg_if;
use foreign_types::ForeignTypeRef;
use std::mem;
diff --git a/openssl/src/x509/verify.rs b/openssl/src/x509/verify.rs
index a19b725b..b17586b3 100644
--- a/openssl/src/x509/verify.rs
+++ b/openssl/src/x509/verify.rs
@@ -1,3 +1,4 @@
+use bitflags::bitflags;
use foreign_types::ForeignTypeRef;
use libc::{c_uint, c_ulong};
use std::net::IpAddr;