diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-15 12:19:53 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-15 12:19:53 +0000 |
commit | b2724840ba64df93e38ac4a9d150e887c5f8f15a (patch) | |
tree | 4d8c9b0644d054636dee384ac8dc5b12c6315415 /src/libcryptobox | |
parent | e32c903d9130b526a0d21bd61e2fb5e7ca98f6e3 (diff) | |
download | rspamd-b2724840ba64df93e38ac4a9d150e887c5f8f15a.tar.gz rspamd-b2724840ba64df93e38ac4a9d150e887c5f8f15a.zip |
Fix verification routine for signatures
Diffstat (limited to 'src/libcryptobox')
-rw-r--r-- | src/libcryptobox/ed25519/ed25519.c | 8 |
1 files 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 { |