From cbc8e988761c2c7efa7b64ee2d03861d9feca6fc Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Wed, 17 Jan 2024 08:49:09 -0700 Subject: [PATCH] Return correct error code in TEMPLATE DecodeECC_DSA_Sig_Ex --- wolfcrypt/src/asn.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index dad45668d..3cb649ed7 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -32149,6 +32149,11 @@ int DecodeECC_DSA_Sig_Ex(const byte* sig, word32 sigLen, mp_int* r, mp_int* s, /* Decode the DSA signature. */ ret = GetASN_Items(dsaSigASN, dataASN, dsaSigASN_Length, 0, sig, &idx, sigLen); + + if (ret != 0) { + ret = ASN_ECC_KEY_E; + } + #ifndef NO_STRICT_ECDSA_LEN /* sanity check that the index has been advanced all the way to the end of * the buffer */