From 07ce995b12fb01466b4e944def26f69a6055358b Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 30 Dec 2016 12:24:03 -0800 Subject: [PATCH] Fix issue with imported key not having a reset key->r, key->s and key->state, which was causing wc_ecc_encrypt to fail. --- wolfcrypt/src/ecc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 654769d78..55c86ddfe 100755 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -4364,6 +4364,9 @@ int wc_ecc_import_x963_ex(const byte* in, word32 inLen, ecc_key* key, return ECC_BAD_ARG_E; } + XMEMSET(key, 0, sizeof(ecc_key)); + key->state = ECC_STATE_NONE; + #ifdef WOLFSSL_ATECC508A /* TODO: Implement equiv call to ATECC508A */ err = BAD_COND_E;