mirror of https://github.com/wolfSSL/wolfssl.git
Fix missing return checks in KSDK ED25519 code.
parent
ed1fdc410e
commit
13beadbfc3
|
@ -655,8 +655,12 @@ static int ed25519_verify_msg_final_with_sha(const byte* sig, word32 sigLen,
|
|||
return ret;
|
||||
|
||||
#ifdef FREESCALE_LTC_ECC
|
||||
LTC_PKHA_sc_reduce(h);
|
||||
LTC_PKHA_SignatureForVerify(rcheck, h, sig + (ED25519_SIG_SIZE/2), key);
|
||||
ret = LTC_PKHA_sc_reduce(h);
|
||||
if (ret != kStatus_Success)
|
||||
return ret;
|
||||
ret = LTC_PKHA_SignatureForVerify(rcheck, h, sig + (ED25519_SIG_SIZE/2), key);
|
||||
if (ret != kStatus_Success)
|
||||
return ret;
|
||||
#else
|
||||
sc_reduce(h);
|
||||
|
||||
|
|
|
@ -2051,11 +2051,15 @@ status_t LTC_PKHA_SignatureForVerify(uint8_t *rcheck, const unsigned char *a,
|
|||
if (status == kStatus_Success) {
|
||||
status = LTC_PKHA_WeierstrassToEd25519(<c0, <c0);
|
||||
}
|
||||
if (((uint32_t)ltc0.X[0]) & 0x01u) {
|
||||
ltc0.Y[ED25519_KEY_SIZE - 1] |= 0x80u;
|
||||
|
||||
if (status == kStatus_Success) {
|
||||
if (((uint32_t)ltc0.X[0]) & 0x01u) {
|
||||
ltc0.Y[ED25519_KEY_SIZE - 1] |= 0x80u;
|
||||
}
|
||||
|
||||
XMEMCPY(rcheck, ltc0.Y, ED25519_KEY_SIZE);
|
||||
}
|
||||
|
||||
XMEMCPY(rcheck, ltc0.Y, ED25519_KEY_SIZE);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue