mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
adjust test case and add useful comments
This commit is contained in:
@@ -21045,6 +21045,7 @@ static int test_wc_ecc_signVerify_hash (void)
|
|||||||
/* Init stack var */
|
/* Init stack var */
|
||||||
XMEMSET(sig, 0, siglen);
|
XMEMSET(sig, 0, siglen);
|
||||||
XMEMSET(&key, 0, sizeof(key));
|
XMEMSET(&key, 0, sizeof(key));
|
||||||
|
XMEMSET(adjustedSig, 0, ECC_BUFSIZE+1);
|
||||||
|
|
||||||
/* Init structs. */
|
/* Init structs. */
|
||||||
ret = wc_InitRng(&rng);
|
ret = wc_InitRng(&rng);
|
||||||
|
@@ -15965,6 +15965,8 @@ int DecodeECC_DSA_Sig_Bin(const byte* sig, word32 sigLen, byte* r, word32* rLen,
|
|||||||
XMEMCPY(s, (byte*)sig + idx, len);
|
XMEMCPY(s, (byte*)sig + idx, len);
|
||||||
|
|
||||||
#ifndef NO_STRICT_ECDSA_LEN
|
#ifndef NO_STRICT_ECDSA_LEN
|
||||||
|
/* sanity check that the index has been advanced all the way to the end of
|
||||||
|
* the buffer */
|
||||||
if (idx + len != sigLen) {
|
if (idx + len != sigLen) {
|
||||||
ret = ASN_ECC_KEY_E;
|
ret = ASN_ECC_KEY_E;
|
||||||
}
|
}
|
||||||
@@ -16006,6 +16008,8 @@ int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen, mp_int* r, mp_int* s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_STRICT_ECDSA_LEN
|
#ifndef NO_STRICT_ECDSA_LEN
|
||||||
|
/* sanity check that the index has been advanced all the way to the end of
|
||||||
|
* the buffer */
|
||||||
if (idx != sigLen) {
|
if (idx != sigLen) {
|
||||||
mp_clear(r);
|
mp_clear(r);
|
||||||
mp_clear(s);
|
mp_clear(s);
|
||||||
|
Reference in New Issue
Block a user