From 24ad168acfcbfc2fd7a97c276967c1b405d556d1 Mon Sep 17 00:00:00 2001 From: toddouska Date: Tue, 17 Mar 2015 14:25:57 -0700 Subject: [PATCH] put memset back before ecdsa sig decode for failure case --- wolfcrypt/src/ecc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index fe1d062c9..d246e46f8 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -2088,7 +2088,9 @@ int wc_ecc_verify_hash(const byte* sig, word32 siglen, const byte* hash, * If either of those don't allocate correctly, none of * the rest of this function will execute, and everything * gets cleaned up at the end. */ - if (err == MP_OKAY) + XMEMSET(&r, 0, sizeof(r)); + XMEMSET(&s, 0, sizeof(s)); + if (err == MP_OKAY) err = DecodeECC_DSA_Sig(sig, siglen, &r, &s); /* get the order */