aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-12-10 11:51:48 -0500
committerJack Lloyd <[email protected]>2018-12-10 11:52:05 -0500
commit162e102cb3d2a1ca0f750341dea634b6434139c0 (patch)
tree4af3d141f8cb6f67cb34b0fa849267d14fc2e41f /src/cli
parente4704821ab5ad67ff78d99e05ad2b1955b1e2e20 (diff)
Fix more MSVC warnings
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/speed.cpp4
-rw-r--r--src/cli/x509.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 518601a81..5ba73820b 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -2121,13 +2121,13 @@ class Speed final : public Command
if(Botan::is_passhash9_alg_supported(alg) == false)
continue;
- for(uint8_t work_factor : { 10, 15 })
+ for(auto work_factor : { 10, 15 })
{
std::unique_ptr<Timer> timer = make_timer("passhash9 alg=" + std::to_string(alg) +
" wf=" + std::to_string(work_factor));
timer->run([&] {
- Botan::generate_passhash9(password, rng(), work_factor, alg);
+ Botan::generate_passhash9(password, rng(), static_cast<uint8_t>(work_factor), alg);
});
record_result(timer);
diff --git a/src/cli/x509.cpp b/src/cli/x509.cpp
index d894b99a4..e2b99a494 100644
--- a/src/cli/x509.cpp
+++ b/src/cli/x509.cpp
@@ -262,9 +262,9 @@ class Gen_Self_Signed final : public Command
throw CLI_Error("Failed to load key from " + get_arg("key"));
}
- const size_t days = get_arg_sz("days");
+ const uint32_t lifetime = static_cast<uint32_t>(get_arg_sz("days") * 24 * 60 * 60);
- Botan::X509_Cert_Options opts("", days * 24 * 60 * 60);
+ Botan::X509_Cert_Options opts("", lifetime);
opts.common_name = get_arg("CN");
opts.country = get_arg("country");