diff --git a/Cargo.toml b/Cargo.toml index 01d5b9a..d3e5450 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,12 +13,11 @@ license = "MIT" edition = "2018" [dependencies] -openssl = { version = "0.10", features = [ "vendored" ], optional = true } -openssl-sys = { package = "openssl", version = "0.10", optional = true } +openssl = { version = "0.10" } [features] -default = [ "openssl" ] -system-openssl = [ "openssl-sys" ] +default = [ "openssl-vendored" ] +openssl-vendored = [ "openssl/vendored" ] [dev-dependencies] base64 = "0.9" diff --git a/examples/read.rs b/examples/read.rs index f2e3557..789ad25 100644 --- a/examples/read.rs +++ b/examples/read.rs @@ -1,6 +1,6 @@ use base64::decode; use cryptostream::read; -use cryptostream::Cipher; +use openssl::symm::Cipher; use std::io::Read; fn main() { diff --git a/examples/readme.rs b/examples/readme.rs index 45a66d2..7cf275c 100644 --- a/examples/readme.rs +++ b/examples/readme.rs @@ -1,7 +1,6 @@ use base64::decode; use cryptostream::{read, write}; -// openssl::Cipher is re-exported as cryptostream::Cipher -use cryptostream::Cipher; +use openssl::symm::Cipher; use std::io::prelude::*; fn main() { diff --git a/examples/write.rs b/examples/write.rs index 6270687..920b39d 100644 --- a/examples/write.rs +++ b/examples/write.rs @@ -1,6 +1,6 @@ use base64::decode; use cryptostream::write; -use cryptostream::Cipher; +use openssl::symm::Cipher; use std::io::Write; fn main() { diff --git a/src/lib.rs b/src/lib.rs index 18861c1..5ea0613 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,22 +29,9 @@ //! [`bufread::Decryptor`] types for encrypting/decrypting plaintext/ciphertext on-the-fly from a //! [`BufRead`](std::io::BufRead) source. (There is no need for a `bufwrite` variant.) -#[cfg(not(feature = "system-openssl"))] -extern crate openssl; -#[cfg(feature = "system-openssl")] -extern crate openssl_sys as openssl; - pub mod bufread; pub mod read; pub mod write; -/// Because we rename the openssl crate without the `vendored` feature as openssl_sys (you cannot -/// have a dependency imported (even XOR conditionally) twice with the same name, and you cannot -/// have conditional features for dependencies based off of your own feature in Cargo.toml), we -/// re-export the `openssl::symm:Cipher` as `cryptostream::Cipher` so no `extern crate openssl` is -/// required for downstream users of this library, which won't work if the `system-openssl` option -/// were used. -pub use openssl::symm::Cipher as Cipher; - #[cfg(test)] mod tests;