aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-08-17 07:33:35 -0400
committerGitHub <[email protected]>2019-08-17 07:33:35 -0400
commitb00a58dac14e080187c2357abcf965e3ea1979bd (patch)
tree0ac325db7f78905e1b04cd8d852357d76d922f0a
parentdb1b06d2ee44a1bc72de3bdd4c4098cc8c149dcc (diff)
parent57906d1135521f2b31d81fce26d403621d3d5523 (diff)
Merge pull request #2069 from mgierlings/update-stateful-key
Updates private key prior to signature output
-rw-r--r--src/cli/pubkey.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cli/pubkey.cpp b/src/cli/pubkey.cpp
index 8d442b75c..74ffde906 100644
--- a/src/cli/pubkey.cpp
+++ b/src/cli/pubkey.cpp
@@ -1,5 +1,6 @@
/*
-* (C) 2010,2014,2015 Jack Lloyd
+* (C) 2010,2014,2015,2019 Jack Lloyd
+* (C) 2019 Matthias Gierlings
* (C) 2015 René Korthaus
*
* Botan is released under the Simplified BSD License (see license.txt)
@@ -216,7 +217,7 @@ class PK_Sign final : public Command
};
this->read_file(get_arg("file"), onData);
- output() << Botan::base64_encode(signer.signature(rng())) << "\n";
+ std::vector<uint8_t> sig { signer.signature(rng()) };
if(key->stateful_operation())
{
@@ -226,6 +227,8 @@ class PK_Sign final : public Command
else
updated_key << Botan::PKCS8::PEM_encode(*key, rng(), passphrase);
}
+
+ output() << Botan::base64_encode(sig) << "\n";
}
};