aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-10-30 11:53:26 -0400
committerJack Lloyd <[email protected]>2018-10-30 11:53:26 -0400
commitd3e8ebeba055f5c97756c7be97b98d1576df156f (patch)
tree864befc7548a6c19e0a8f52e3cba68abf3a0e10b /src
parent77e891b17fd172e031e2cd130c3c8ade195233e5 (diff)
Document TSS
Diffstat (limited to 'src')
-rw-r--r--src/cli/tss.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cli/tss.cpp b/src/cli/tss.cpp
index bff9c19eb..60149ee29 100644
--- a/src/cli/tss.cpp
+++ b/src/cli/tss.cpp
@@ -9,6 +9,7 @@
#if defined(BOTAN_HAS_THRESHOLD_SECRET_SHARING)
#include <botan/tss.h>
#include <botan/hex.h>
+ #include <botan/rng.h>
#include <fstream>
#endif
@@ -43,7 +44,13 @@ class TSS_Split final : public Command
Botan::secure_vector<uint8_t> secret = slurp_file_lvec(input);
- const std::vector<uint8_t> id = Botan::hex_decode(id_str);
+ std::vector<uint8_t> id = Botan::hex_decode(id_str);
+
+ if(id.empty())
+ {
+ id.resize(16);
+ rng().randomize(id.data(), id.size());
+ }
std::vector<Botan::RTSS_Share> shares =
Botan::RTSS_Share::split(M, N, secret.data(), secret.size(), id, hash_algo, rng());