From fea769816cc4b43c0d86fa6fb02cfda5093e0810 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 2 Dec 2015 15:55:40 -0700 Subject: [PATCH] ed25519 verify function return descriptive error value --- wolfcrypt/src/ed25519.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index 2e5f6545e..ef4510f42 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -171,6 +171,7 @@ int wc_ed25519_sign_msg(const byte* in, word32 inlen, byte* out, msg the array of bytes containing the message msglen length of msg array stat will be 1 on successful verify and 0 on unsuccessful + return 0 and stat of 1 on success */ int wc_ed25519_verify_msg(byte* sig, word32 siglen, const byte* msg, word32 msglen, int* stat, ed25519_key* key) @@ -229,7 +230,7 @@ int wc_ed25519_verify_msg(byte* sig, word32 siglen, const byte* msg, /* comparison of R created to R in sig */ ret = ConstantCompare(rcheck, sig, ED25519_SIG_SIZE/2); if (ret != 0) - return ret; + return SIG_VERIFY_E; /* set the verification status */ *stat = 1;