diff options
author | Jack Lloyd <[email protected]> | 2017-07-03 09:34:50 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-07-03 09:34:50 -0400 |
commit | 545ac43c03710ffb5001ff8fcaa05e8536adcdeb (patch) | |
tree | bcaebe63bf590ef3a5af0a064bf38815d3f6daae | |
parent | 9e9b2cbafe40373ec4ed82b26c9d32f36666ffe8 (diff) | |
parent | e6095ff921eb476424dc28caabd45fc8f334a5c9 (diff) |
Merge GH #1106 Fix sign_cert CLI incorrectly handling --ca-key-pass (GH #1104)
-rw-r--r-- | src/cli/x509.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cli/x509.cpp b/src/cli/x509.cpp index e2163b987..0094fef2b 100644 --- a/src/cli/x509.cpp +++ b/src/cli/x509.cpp @@ -1,5 +1,6 @@ /* * (C) 2010,2014,2015 Jack Lloyd +* (C) 2017 René Korthaus, Rohde & Schwarz Cybersecurity * * Botan is released under the Simplified BSD License (see license.txt) */ @@ -32,10 +33,11 @@ class Sign_Cert final : public Command { Botan::X509_Certificate ca_cert(get_arg("ca_cert")); std::unique_ptr<Botan::PKCS8_PrivateKey> key; + const std::string pass = get_arg("ca-key-pass"); - if(flag_set("ca_key_pass")) + if(!pass.empty()) { - key.reset(Botan::PKCS8::load_key(get_arg("ca_key"), rng(), get_arg("ca_key_pass"))); + key.reset(Botan::PKCS8::load_key(get_arg("ca_key"), rng(), pass)); } else { |