mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
check return values
This commit is contained in:
@ -1666,6 +1666,7 @@ int wc_SetEccsiHash(EccsiKey* key, const byte* hash, byte hashSz)
|
|||||||
* @param [in] pvt Public Validation Token (PVT) as an ECC point.
|
* @param [in] pvt Public Validation Token (PVT) as an ECC point.
|
||||||
* @return 0 on success.
|
* @return 0 on success.
|
||||||
* @return BAD_FUNC_ARG when key, ssk or pvt is NULL.
|
* @return BAD_FUNC_ARG when key, ssk or pvt is NULL.
|
||||||
|
* @return MP math errors when copy fails
|
||||||
*/
|
*/
|
||||||
int wc_SetEccsiPair(EccsiKey* key, const mp_int* ssk, const ecc_point* pvt)
|
int wc_SetEccsiPair(EccsiKey* key, const mp_int* ssk, const ecc_point* pvt)
|
||||||
{
|
{
|
||||||
@ -1674,9 +1675,13 @@ int wc_SetEccsiPair(EccsiKey* key, const mp_int* ssk, const ecc_point* pvt)
|
|||||||
if ((key == NULL) || (ssk == NULL) || (pvt == NULL)) {
|
if ((key == NULL) || (ssk == NULL) || (pvt == NULL)) {
|
||||||
err = BAD_FUNC_ARG;
|
err = BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
mp_copy(ssk, &key->ssk);
|
err = mp_copy(ssk, &key->ssk);
|
||||||
wc_ecc_copy_point(pvt, key->pvt);
|
}
|
||||||
|
|
||||||
|
if (err == 0) {
|
||||||
|
err = wc_ecc_copy_point(pvt, key->pvt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
Reference in New Issue
Block a user