From 7bc4ea5d34fac53d33ff2ed53bb7a70a2c1aca93 Mon Sep 17 00:00:00 2001 From: Stuart Stock Date: Sun, 27 Sep 2020 20:45:10 -0500 Subject: More user friendly: check for KMS feature earlier in roughenough-kms --- src/bin/roughenough-kms.rs | 14 +++++++------- 1 file 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") { -- cgit v1.2.3