aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-07-18 01:42:09 -0400
committerJack Lloyd <[email protected]>2015-07-18 01:42:09 -0400
commit84f6a4b4995b38796d14c1637639cbe89565ccfe (patch)
tree45275e5fd22e8aa36d81f0077277767a0b0e2023 /src/lib/ffi/ffi.cpp
parentd29c6f82a116653a9bcb7479f3e57f6bab537c72 (diff)
Add tests for some of the C89 interface.
Add missing returns to botan_kdf, botan_pbkdf, botan_pbkdf_timed; previously they always returned an error code.
Diffstat (limited to 'src/lib/ffi/ffi.cpp')
-rw-r--r--src/lib/ffi/ffi.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp
index 4a5ec13c1..18298b365 100644
--- a/src/lib/ffi/ffi.cpp
+++ b/src/lib/ffi/ffi.cpp
@@ -58,7 +58,7 @@ struct botan_struct
{
if(m_magic != MAGIC)
throw std::runtime_error("Bad magic " + std::to_string(m_magic) +
- " in ffi object expected" + std::to_string(MAGIC));
+ " in ffi object expected " + std::to_string(MAGIC));
return m_obj.get();
}
private:
@@ -583,6 +583,7 @@ int botan_pbkdf(const char* pbkdf_algo, uint8_t out[], size_t out_len,
{
std::unique_ptr<Botan::PBKDF> pbkdf(Botan::get_pbkdf(pbkdf_algo));
pbkdf->pbkdf_iterations(out, out_len, pass, salt, salt_len, iterations);
+ return 0;
}
catch(std::exception& e)
{
@@ -605,6 +606,7 @@ int botan_pbkdf_timed(const char* pbkdf_algo,
pbkdf->pbkdf_timed(out, out_len, password, salt, salt_len,
std::chrono::milliseconds(ms_to_run),
*iterations_used);
+ return 0;
}
catch(std::exception& e)
{
@@ -623,6 +625,7 @@ int botan_kdf(const char* kdf_algo,
{
std::unique_ptr<Botan::KDF> kdf(Botan::get_kdf(kdf_algo));
kdf->kdf(out, out_len, secret, secret_len, salt, salt_len);
+ return 0;
}
catch(std::exception& e)
{