From 68632ce26bf9aeb40904d090da39d3b6be86f1ce Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 9 Oct 2018 11:21:35 +0200 Subject: [PATCH] Fix secio compied with --no-default-features (#545) --- protocols/secio/Cargo.toml | 6 +++--- protocols/secio/src/lib.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/protocols/secio/Cargo.toml b/protocols/secio/Cargo.toml index eb725579..3a156ba9 100644 --- a/protocols/secio/Cargo.toml +++ b/protocols/secio/Cargo.toml @@ -21,20 +21,20 @@ ctr = "0.1" lazy_static = { version = "0.2.11", optional = true } rw-stream-sink = { path = "../../misc/rw-stream-sink" } tokio-io = "0.1.0" -untrusted = { version = "0.5", optional = true } sha2 = "0.7.1" ed25519-dalek = "0.8.0" hmac = "0.6.3" [target.'cfg(not(target_os = "emscripten"))'.dependencies] -ring = { version = "0.12", default-features = false, optional = true } +ring = { version = "0.12", default-features = false } +untrusted = { version = "0.5" } [target.'cfg(target_os = "emscripten")'.dependencies] stdweb = { version = "0.4.8", default-features = false } [features] default = ["rsa", "secp256k1"] -rsa = ["ring/rsa_signing", "untrusted"] +rsa = ["ring/rsa_signing"] secp256k1 = ["eth-secp256k1"] aes-all = ["aesni", "lazy_static"] diff --git a/protocols/secio/src/lib.rs b/protocols/secio/src/lib.rs index 83880398..a7a61756 100644 --- a/protocols/secio/src/lib.rs +++ b/protocols/secio/src/lib.rs @@ -92,7 +92,7 @@ extern crate libp2p_core; extern crate log; extern crate protobuf; extern crate rand; -#[cfg(all(feature = "ring", not(target_os = "emscripten")))] +#[cfg(not(target_os = "emscripten"))] extern crate ring; extern crate rw_stream_sink; #[cfg(feature = "secp256k1")] @@ -103,7 +103,7 @@ extern crate sha2; extern crate stdweb; extern crate tokio_io; extern crate twofish; -#[cfg(all(feature = "ring", not(target_os = "emscripten")))] +#[cfg(not(target_os = "emscripten"))] extern crate untrusted; #[cfg(feature = "aes-all")] @@ -118,7 +118,7 @@ use ed25519_dalek::Keypair as Ed25519KeyPair; use futures::stream::MapErr as StreamMapErr; use futures::{Future, Poll, Sink, StartSend, Stream}; use libp2p_core::{PeerId, PublicKey}; -#[cfg(all(feature = "ring", not(target_os = "emscripten")))] +#[cfg(all(feature = "rsa", not(target_os = "emscripten")))] use ring::signature::RSAKeyPair; use rw_stream_sink::RwStreamSink; use std::error::Error; @@ -126,7 +126,7 @@ use std::io::{Error as IoError, ErrorKind as IoErrorKind}; use std::iter; use std::sync::Arc; use tokio_io::{AsyncRead, AsyncWrite}; -#[cfg(all(feature = "ring", not(target_os = "emscripten")))] +#[cfg(all(feature = "rsa", not(target_os = "emscripten")))] use untrusted::Input; mod algo_support;