This commit is contained in:
Eric Blankenhorn
2025-01-10 10:06:14 -06:00
parent 139504b9fd
commit 53831d0f32
2 changed files with 8 additions and 2 deletions

View File

@@ -26492,6 +26492,7 @@ static int test_wc_ecc_rs_to_sig(void)
byte s[KEY24];
word32 rlen = (word32)sizeof(r);
word32 slen = (word32)sizeof(s);
word32 zeroLen = 0;
/* Init stack variables. */
XMEMSET(sig, 0, ECC_MAX_SIG_SIZE);
@@ -26517,6 +26518,11 @@ static int test_wc_ecc_rs_to_sig(void)
WC_NO_ERR_TRACE(ECC_BAD_ARG_E));
ExpectIntEQ(wc_ecc_sig_to_rs(sig, siglen, r, &rlen, s, NULL),
WC_NO_ERR_TRACE(ECC_BAD_ARG_E));
ExpectIntEQ(wc_ecc_sig_to_rs(sig, siglen, r, &zeroLen, s, &slen),
WC_NO_ERR_TRACE(ASN_PARSE_E));
ExpectIntEQ(wc_ecc_sig_to_rs(sig, siglen, r, &rlen, s, &zeroLen),
WC_NO_ERR_TRACE(ASN_PARSE_E));
#endif
return EXPECT_RESULT();
} /* END test_wc_ecc_rs_to_sig */

View File

@@ -33784,7 +33784,7 @@ int DecodeECC_DSA_Sig_Bin(const byte* sig, word32 sigLen, byte* r, word32* rLen,
*rLen = (word32)len;
else {
/* Buffer too small to hold r value */
return BUFFER_E;
return ASN_PARSE_E;
}
}
if (r)
@@ -33799,7 +33799,7 @@ int DecodeECC_DSA_Sig_Bin(const byte* sig, word32 sigLen, byte* r, word32* rLen,
*sLen = (word32)len;
else {
/* Buffer too small to hold r value */
return BUFFER_E;
return ASN_PARSE_E;
}
}
if (s)