From b2724840ba64df93e38ac4a9d150e887c5f8f15a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 15 Feb 2016 12:19:53 +0000 Subject: [PATCH] Fix verification routine for signatures --- src/libcryptobox/ed25519/ed25519.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libcryptobox/ed25519/ed25519.c b/src/libcryptobox/ed25519/ed25519.c index b022c16cc..736cd96bf 100644 --- a/src/libcryptobox/ed25519/ed25519.c +++ b/src/libcryptobox/ed25519/ed25519.c @@ -29,7 +29,7 @@ typedef struct ed25519_impl_s { void (*sign) (unsigned char *sig, size_t *siglen_p, const unsigned char *m, size_t mlen, const unsigned char *sk); - bool (*verify) (const unsigned char *sig, + int (*verify) (const unsigned char *sig, const unsigned char *m, size_t mlen, const unsigned char *pk); @@ -40,7 +40,7 @@ typedef struct ed25519_impl_s { void ed_sign_##ext(unsigned char *sig, size_t *siglen_p, \ const unsigned char *m, size_t mlen, \ const unsigned char *sk); \ - bool ed_verify_##ext(const unsigned char *sig, \ + int ed_verify_##ext(const unsigned char *sig, \ const unsigned char *m, \ size_t mlen, \ const unsigned char *pk) @@ -98,7 +98,9 @@ ed25519_verify (const unsigned char *sig, size_t mlen, const unsigned char *pk) { - return (ed25519_opt->verify (sig, m, mlen, pk) == 0); + int ret = ed25519_opt->verify (sig, m, mlen, pk); + + return (ret == 0 ? true : false); } struct ed25519_test_vector { -- 2.39.5