From cc95edf4dce6cdc40ab013744837f5602d55a8cb Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Wed, 9 Aug 2017 18:17:28 +0300 Subject: [PATCH] fixed grumbles --- parity/secretstore.rs | 5 +++++ secret_store/src/http_listener.rs | 6 ------ secret_store/src/key_server_cluster/decryption_session.rs | 2 +- secret_store/src/key_server_cluster/signing_session.rs | 2 +- secret_store/src/key_storage.rs | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/parity/secretstore.rs b/parity/secretstore.rs index 8094ef323..eb5922540 100644 --- a/parity/secretstore.rs +++ b/parity/secretstore.rs @@ -87,6 +87,7 @@ mod server { use std::sync::Arc; use ethcore_secretstore; use ethkey::KeyPair; + use ansi_term::Colour::Red; use super::{Configuration, Dependencies, NodeSecretKey}; /// Key server @@ -97,6 +98,10 @@ mod server { impl KeyServer { /// Create new key server pub fn new(mut conf: Configuration, deps: Dependencies) -> Result { + if !conf.acl_check_enabled { + warn!("Running SecretStore with disabled ACL check: {}", Red.bold().paint("everyone has access to stored keys")); + } + let self_secret: Arc = match conf.self_secret.take() { Some(NodeSecretKey::Plain(secret)) => Arc::new(ethcore_secretstore::PlainNodeKeyPair::new( KeyPair::from_secret(secret).map_err(|e| format!("invalid secret: {}", e))?)), diff --git a/secret_store/src/http_listener.rs b/secret_store/src/http_listener.rs index 86688618a..883389365 100644 --- a/secret_store/src/http_listener.rs +++ b/secret_store/src/http_listener.rs @@ -78,9 +78,6 @@ impl KeyServerHttpListener where T: KeyServer + 'static { let shared_handler = Arc::new(KeyServerSharedHttpHandler { key_server: key_server, }); - /*let handler = KeyServerHttpHandler { - handler: shared_handler.clone(), - };*/ let http_server = listener_address .map(|listener_address| format!("{}:{}", listener_address.address, listener_address.port)) @@ -89,9 +86,6 @@ impl KeyServerHttpListener where T: KeyServer + 'static { handler: shared_handler.clone(), }).expect("cannot start HttpServer")); - /*let listener_addr: &str = &format!("{}:{}", listener_address.address, listener_address.port); - let http_server = HttpServer::http(&listener_addr).expect("cannot start HttpServer"); - let http_server = http_server.handle(handler).expect("cannot start HttpServer");*/ let listener = KeyServerHttpListener { http_server: http_server, handler: shared_handler, diff --git a/secret_store/src/key_server_cluster/decryption_session.rs b/secret_store/src/key_server_cluster/decryption_session.rs index afc73f858..bc3c6aad0 100644 --- a/secret_store/src/key_server_cluster/decryption_session.rs +++ b/secret_store/src/key_server_cluster/decryption_session.rs @@ -467,7 +467,7 @@ impl Ord for DecryptionSessionId { mod tests { use std::sync::Arc; use std::collections::BTreeMap; - use super::super::super::acl_storage::DummyAclStorage; + use acl_storage::DummyAclStorage; use ethkey::{self, KeyPair, Random, Generator, Public, Secret}; use key_server_cluster::{NodeId, DocumentKeyShare, SessionId, Error, EncryptedDocumentKeyShadow, SessionMeta}; use key_server_cluster::cluster::tests::DummyCluster; diff --git a/secret_store/src/key_server_cluster/signing_session.rs b/secret_store/src/key_server_cluster/signing_session.rs index e647c8b14..e56306142 100644 --- a/secret_store/src/key_server_cluster/signing_session.rs +++ b/secret_store/src/key_server_cluster/signing_session.rs @@ -572,7 +572,7 @@ mod tests { use std::collections::{BTreeMap, VecDeque}; use ethkey::{self, Random, Generator, Public}; use util::H256; - use super::super::super::acl_storage::DummyAclStorage; + use acl_storage::DummyAclStorage; use key_server_cluster::{NodeId, SessionId, SessionMeta, Error, KeyStorage}; use key_server_cluster::cluster::tests::DummyCluster; use key_server_cluster::generation_session::{Session as GenerationSession}; diff --git a/secret_store/src/key_storage.rs b/secret_store/src/key_storage.rs index 2fad4cdf7..fdbb5fa40 100644 --- a/secret_store/src/key_storage.rs +++ b/secret_store/src/key_storage.rs @@ -200,7 +200,7 @@ pub mod tests { use devtools::RandomTempPath; use ethkey::{Random, Generator, Public, Secret}; use util::Database; - use super::super::types::all::{Error, NodeAddress, ServiceConfiguration, ClusterConfiguration, ServerKeyId}; + use types::all::{Error, NodeAddress, ServiceConfiguration, ClusterConfiguration, ServerKeyId}; use super::{DB_META_KEY_VERSION, KeyStorage, PersistentKeyStorage, DocumentKeyShare, SerializableDocumentKeyShareV0, SerializableDocumentKeyShareV1, upgrade_db};