From c9c49c61fd63e6c15b03a7dc32744a3a2801f9a5 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 10 Jul 2014 23:12:02 -0700 Subject: [PATCH] Do not directly return the result of crypto_verify() --- src/libsodium/crypto_sign/ed25519/ref10/open.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libsodium/crypto_sign/ed25519/ref10/open.c b/src/libsodium/crypto_sign/ed25519/ref10/open.c index 0f98eb29..220665d3 100644 --- a/src/libsodium/crypto_sign/ed25519/ref10/open.c +++ b/src/libsodium/crypto_sign/ed25519/ref10/open.c @@ -42,7 +42,10 @@ crypto_sign_verify_detached(const unsigned char *sig, const unsigned char *m, ge_double_scalarmult_vartime(&R, h, &A, sig + 32); ge_tobytes(rcheck, &R); - return crypto_verify_32(rcheck, sig); + if (crypto_verify_32(rcheck, sig) != 0) { + return -1; + } + return 0; } int