aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Gierlings <[email protected]>2019-08-17 12:53:55 +0200
committerMatthias Gierlings <[email protected]>2019-08-17 12:53:55 +0200
commit57906d1135521f2b31d81fce26d403621d3d5523 (patch)
tree0ac325db7f78905e1b04cd8d852357d76d922f0a /src
parentdb1b06d2ee44a1bc72de3bdd4c4098cc8c149dcc (diff)
Updates private key prior to signature output
Diffstat (limited to 'src')
-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";
}
};