Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Commit

Permalink
Disable 'softsign' backend by default
Browse files Browse the repository at this point in the history
The 'softsign' backend is intended for testing only. This shuts it off
by default so as to start encouraging people to select specific HSM
backends instead.
  • Loading branch information
tony-iqlusion committed Mar 6, 2019
1 parent 724f06d commit 25ef23f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
16 changes: 7 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,22 @@ jobs:
command: |
rustc --version
cargo --version
cargo build
cargo build --features=yubihsm
cargo build --features=ledgertm
cargo build --features=yubihsm,ledgertm,softsign
- run:
name: build --release
command: |
rustc --version
cargo --version
cargo build --release
- run:
name: build --all-features (debug)
command: |
rustc --version
cargo --version
cargo build --all-features
cargo build --release --features=yubihsm
cargo build --release --features=ledgertm
- run:
name: test --all-features
command: |
rustc --version
cargo --version
cargo test --all --features "default softsign yubihsm yubihsm-mock"
cargo test --all --features=yubihsm,ledgertm,softsign
- run:
name: audit
command: |
Expand All @@ -50,6 +47,7 @@ jobs:
- run:
name: validate against test harness
command: |
cargo build --features=softsign
TMKMS_BIN=./target/debug/tmkms sh tests/support/run-harness-tests.sh
- save_cache:
key: cache-2019-01-25-v0 # bump restore_cache key above too
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tempfile = "3"
rand = "0.6" # TODO: switch to the getrandom crate

[features]
default = ["softsign"]
default = []
softsign = []
ledgertm = ["signatory-ledger-tm"]
yubihsm-mock = ["yubihsm/mockhsm"]
Expand Down
13 changes: 7 additions & 6 deletions src/keyring/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
mod ed25519;

use signatory::ed25519::{PublicKey, Signature};
use std::{collections::BTreeMap, sync::RwLock};
use subtle_encoding;
use tendermint::public_keys::ConsensusKey;

use self::ed25519::Signer;
use crate::{
config::provider::ProviderConfig,
error::{KmsError, KmsErrorKind::*},
};
use signatory::ed25519::{PublicKey, Signature};
use std::{collections::BTreeMap, sync::RwLock};
use subtle_encoding;
use tendermint::public_keys::ConsensusKey;

#[cfg(feature = "ledgertm")]
use self::ed25519::ledgertm;
#[cfg(feature = "softsign")]
use self::ed25519::softsign;
#[cfg(feature = "yubihsm")]
use self::ed25519::yubihsm;
use self::ed25519::{softsign, Signer};

/// File encoding for software-backed secret keys
pub type SecretKeyEncoding = subtle_encoding::Base64;
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
unused_qualifications
)]

#[cfg(not(any(feature = "softsign", feature = "yubihsm", feature = "ledgertm")))]
compile_error!(
"please enable one of the following backends with cargo's --features argument: \
yubihsm, ledgertm, softsign (e.g. --features=yubihsm)"
);

extern crate prost_amino as prost;
#[macro_use]
extern crate abscissa;
Expand Down

0 comments on commit 25ef23f

Please sign in to comment.