aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-07 10:30:11 -0400
committerJack Lloyd <[email protected]>2017-09-07 10:30:11 -0400
commitf3d2b1b68592ce11da07129e8f6afa69a094bf14 (patch)
treef91a0a6f545fe29a5cac20ade8b34682f9a19ed6 /src/lib/ffi
parent1a39eca36d5b2f41b3178fbb1a359e42d47b7a74 (diff)
parent8a9722d234eef597353afa3c819335d5aec64875 (diff)
Merge GH #1189 Correct return value of botan_pk_op_verify_finish
Diffstat (limited to 'src/lib/ffi')
-rw-r--r--src/lib/ffi/ffi.h2
-rw-r--r--src/lib/ffi/ffi_kdf.cpp2
-rw-r--r--src/lib/ffi/ffi_pk_op.cpp2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ffi/ffi.h b/src/lib/ffi/ffi.h
index 005d32eee..de752f43c 100644
--- a/src/lib/ffi/ffi.h
+++ b/src/lib/ffi/ffi.h
@@ -136,6 +136,8 @@ doesn't exactly work well either!
*/
#define BOTAN_FFI_SUCCESS (0)
+#define BOTAN_FFI_INVALID_VERIFIER (1)
+
#define BOTAN_FFI_ERROR_INVALID_INPUT (-1)
#define BOTAN_FFI_ERROR_BAD_MAC (-2)
diff --git a/src/lib/ffi/ffi_kdf.cpp b/src/lib/ffi/ffi_kdf.cpp
index 1a4c40893..7aaf2dbe8 100644
--- a/src/lib/ffi/ffi_kdf.cpp
+++ b/src/lib/ffi/ffi_kdf.cpp
@@ -88,7 +88,7 @@ int botan_bcrypt_is_valid(const char* pass, const char* hash)
{
#if defined(BOTAN_HAS_BCRYPT)
return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() {
- return Botan::check_bcrypt(pass, hash) ? 0 : 1;
+ return Botan::check_bcrypt(pass, hash) ? BOTAN_FFI_SUCCESS : BOTAN_FFI_INVALID_VERIFIER;
});
#else
return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
diff --git a/src/lib/ffi/ffi_pk_op.cpp b/src/lib/ffi/ffi_pk_op.cpp
index d0ac8e3c7..fa3b32725 100644
--- a/src/lib/ffi/ffi_pk_op.cpp
+++ b/src/lib/ffi/ffi_pk_op.cpp
@@ -164,7 +164,7 @@ int botan_pk_op_verify_finish(botan_pk_op_verify_t op, const uint8_t sig[], size
if(legit)
return BOTAN_FFI_SUCCESS;
else
- return BOTAN_FFI_ERROR_INVALID_INPUT;
+ return BOTAN_FFI_INVALID_VERIFIER;
});
}