diff options
author | Jack Lloyd <[email protected]> | 2017-08-31 12:08:03 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-08-31 12:08:03 -0400 |
commit | 2d6e56947de655fd39bdb2e9ad34eb7822e39f5b (patch) | |
tree | d5fec51d83361db7fd5a2dbe056a29a9223d46c5 /src/lib/ffi/ffi_kdf.cpp | |
parent | 2799c22fd10506a45df7b84a2352def6c31067ee (diff) | |
parent | 7fecb1254232311d5f2ca62f9cda1e12a4b2558c (diff) |
Merge GH #1171 Fix various MSVC warnings
Diffstat (limited to 'src/lib/ffi/ffi_kdf.cpp')
-rw-r--r-- | src/lib/ffi/ffi_kdf.cpp | 4 |
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 |