aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi
diff options
context:
space:
mode:
authorDaniel Wyatt <[email protected]>2017-04-29 13:20:28 -0400
committerDaniel Wyatt <[email protected]>2017-04-29 13:20:28 -0400
commit84efea7c27d0f541bac3dbe47377b65cca23f55c (patch)
treec3e697bd99f16b2d5b5ea9101c3aaf2ec0e0d597 /src/lib/ffi
parent29cc6bebe132a34f882d450b35a69bf71bb3e27b (diff)
Fix botan_bcrypt_is_valid return code.
Currently it returns 0 on success and BOTAN_FFI_ERROR_EXCEPTION_THROWN otherwise, which is a bit inaccurate and not consistent with the rest of the FFI interface.
Diffstat (limited to 'src/lib/ffi')
-rw-r--r--src/lib/ffi/ffi.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp
index 42b01be62..930bf60d9 100644
--- a/src/lib/ffi/ffi.cpp
+++ b/src/lib/ffi/ffi.cpp
@@ -1213,8 +1213,7 @@ int botan_bcrypt_is_valid(const char* pass, const char* hash)
try
{
#if defined(BOTAN_HAS_BCRYPT)
- if(Botan::check_bcrypt(pass, hash))
- return 0; // success
+ return Botan::check_bcrypt(pass, hash) ? 0 : 1;
#else
return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
#endif