aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi_kdf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ffi/ffi_kdf.cpp')
-rw-r--r--src/lib/ffi/ffi_kdf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ffi/ffi_kdf.cpp b/src/lib/ffi/ffi_kdf.cpp
index 058c4c655..1a4c40893 100644
--- a/src/lib/ffi/ffi_kdf.cpp
+++ b/src/lib/ffi/ffi_kdf.cpp
@@ -72,11 +72,11 @@ int botan_bcrypt_generate(uint8_t* out, size_t* out_len,
if(flags != 0)
return BOTAN_FFI_ERROR_BAD_FLAG;
- if(wf < 2 || wf > 30)
+ if(wf < 4 || wf > 18)
throw FFI_Error("Bad bcrypt work factor " + std::to_string(wf));
Botan::RandomNumberGenerator& rng = safe_get(rng_obj);
- const std::string bcrypt = Botan::generate_bcrypt(pass, rng, wf);
+ const std::string bcrypt = Botan::generate_bcrypt(pass, rng, static_cast<uint16_t>(wf));
return write_str_output(out, out_len, bcrypt);
});
#else