summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Stock <stuart@int08h.com>2020-09-27 20:45:10 -0500
committerStuart Stock <stuart@int08h.com>2020-09-27 20:45:10 -0500
commit7bc4ea5d34fac53d33ff2ed53bb7a70a2c1aca93 (patch)
tree24ad91f9d2d39571c6d547c4b728739efcf82871
parent7338262e70ad88734de933b09499f7b0ade81312 (diff)
downloadroughenough-7bc4ea5d34fac53d33ff2ed53bb7a70a2c1aca93.zip
More user friendly: check for KMS feature earlier in roughenough-kmsHEADmaster
-rw-r--r--src/bin/roughenough-kms.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/roughenough-kms.rs b/src/bin/roughenough-kms.rs
index fecfdde..24ff0b9 100644
--- a/src/bin/roughenough-kms.rs
+++ b/src/bin/roughenough-kms.rs
@@ -92,6 +92,13 @@ fn get_kms(kms_key: &str) -> impl KmsProvider {
pub fn main() {
SimpleLogger::new().with_level(LevelFilter::Info).init().unwrap();
+ if !(cfg!(feature = "gcpkms") || cfg!(feature = "awskms")) {
+ warn!("KMS support was not compiled into this build; nothing to do.");
+ warn!("See the Roughenough documentation for information on KMS support.");
+ warn!(" https://github.com/int08h/roughenough/blob/master/doc/OPTIONAL-FEATURES.md");
+ return
+ }
+
let matches = App::new("roughenough-kms")
.version(roughenough_version().as_ref())
.long_about("Encrypt and decrypt Roughenough long-term server seeds using a KMS")
@@ -118,13 +125,6 @@ pub fn main() {
.help("32 byte hex seed for the server's long-term identity"),
).get_matches();
- if !(cfg!(feature = "gcpkms") || cfg!(feature = "awskms")) {
- warn!("KMS support was not compiled into this build; nothing to do.");
- warn!("See the Roughenough documentation for information on KMS support.");
- warn!(" https://github.com/int08h/roughenough/blob/master/doc/OPTIONAL-FEATURES.md");
- return
- }
-
let kms_key = matches.value_of("KEY_ID").expect("Invalid KMS key id");
if matches.is_present("SEED") {