Merge pull request #4182 from JacobBarthelmeh/CAAM

check return of DSA decode
This commit is contained in:
Sean Parkinson
2021-07-08 08:16:46 +10:00
committed by GitHub

View File

@ -292,14 +292,13 @@ int wc_CAAM_EccVerify(const byte* sig, word32 siglen, const byte* hash,
int ret;
mp_int r, s;
ret = DecodeECC_DSA_Sig(sig, siglen, &r, &s);
if (ret == 0) {
ret = wc_CAAM_EccVerify_ex(&r, &s, hash, hashlen, res, key);
mp_free(&r);
mp_free(&s);
}
mp_init(&r);
mp_init(&s);
DecodeECC_DSA_Sig(sig, siglen, &r, &s);
ret = wc_CAAM_EccVerify_ex(&r, &s, hash, hashlen, res, key);
mp_free(&r);
mp_free(&s);
return ret;
}