From: Vsevolod Stakhov Date: Mon, 15 Feb 2016 12:19:53 +0000 (+0000) Subject: Fix verification routine for signatures X-Git-Tag: 1.2.0~235 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2724840ba64df93e38ac4a9d150e887c5f8f15a;p=thirdparty%2Frspamd.git Fix verification routine for signatures --- diff --git a/src/libcryptobox/ed25519/ed25519.c b/src/libcryptobox/ed25519/ed25519.c index b022c16cc7..736cd96bfe 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 {