Fix for improperly initialized PKA_ECDSASignOutTypeDef on STM32 PKA sign.

This commit is contained in:
David Garske
2021-05-25 14:55:22 -07:00
parent 839231c508
commit b0782cb8f8
3 changed files with 2 additions and 3 deletions

View File

@@ -7706,7 +7706,7 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
} }
if ((ret = wc_DsaPublicKeyDecode(key, &idx, sigCtx->key.dsa, if ((ret = wc_DsaPublicKeyDecode(key, &idx, sigCtx->key.dsa,
keySz)) != 0) { keySz)) != 0) {
WOLFSSL_MSG("ASN Key decode error RSA"); WOLFSSL_MSG("ASN Key decode error DSA");
goto exit_cs; goto exit_cs;
} }
if (sigSz != DSA_SIG_SIZE) { if (sigSz != DSA_SIG_SIZE) {

View File

@@ -6797,7 +6797,6 @@ int wc_ecc_verify_hash(const byte* sig, word32 siglen, const byte* hash,
#endif /* !NO_ASN */ #endif /* !NO_ASN */
#if !defined(WOLFSSL_STM32_PKA) && !defined(WOLFSSL_PSOC6_CRYPTO) #if !defined(WOLFSSL_STM32_PKA) && !defined(WOLFSSL_PSOC6_CRYPTO)
static int wc_ecc_check_r_s_range(ecc_key* key, mp_int* r, mp_int* s) static int wc_ecc_check_r_s_range(ecc_key* key, mp_int* r, mp_int* s)
{ {
int err; int err;

View File

@@ -825,7 +825,7 @@ int stm32_ecc_sign_hash_ex(const byte* hash, word32 hashlen, WC_RNG* rng,
const uint8_t *prime, *coef, *gen_x, *gen_y, *order; const uint8_t *prime, *coef, *gen_x, *gen_y, *order;
const uint32_t *coef_sign; const uint32_t *coef_sign;
XMEMSET(&pka_ecc, 0x00, sizeof(PKA_ECDSASignInTypeDef)); XMEMSET(&pka_ecc, 0x00, sizeof(PKA_ECDSASignInTypeDef));
XMEMSET(&pka_ecc, 0x00, sizeof(PKA_ECDSASignOutTypeDef)); XMEMSET(&pka_ecc_out, 0x00, sizeof(PKA_ECDSASignOutTypeDef));
if (r == NULL || s == NULL || hash == NULL || key == NULL) { if (r == NULL || s == NULL || hash == NULL || key == NULL) {
return ECC_BAD_ARG_E; return ECC_BAD_ARG_E;