mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
coverity: unchecked return value with mp_copy.
This commit is contained in:
@ -128,7 +128,7 @@ int test_wc_DsaSignVerify(void)
|
||||
#if !defined(HAVE_FIPS) && defined(WOLFSSL_PUBLIC_MP)
|
||||
/* hard set q to 0 and test fail case */
|
||||
mp_free(&key.q);
|
||||
mp_init(&key.q);
|
||||
ExpectIntEQ(mp_init(&key.q), 0);
|
||||
ExpectIntEQ(wc_DsaSign(hash, signature, &key, &rng), WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
||||
|
||||
mp_set(&key.q, 1);
|
||||
|
@ -55360,7 +55360,9 @@ static wc_test_ret_t mp_test_shift(mp_int* a, mp_int* r1, WC_RNG* rng)
|
||||
if (ret != 0)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
for (i = 0; i < 4; i++) {
|
||||
mp_copy(r1, a);
|
||||
ret = mp_copy(r1, a);
|
||||
if (ret != WC_NO_ERR_TRACE(MP_VAL))
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
#if !defined(NO_DH) || defined(HAVE_ECC) || (!defined(NO_RSA) && \
|
||||
defined(WC_RSA_BLINDING) && !defined(WOLFSSL_RSA_VERIFY_ONLY))
|
||||
ret = mp_lshd(r1, i);
|
||||
@ -56785,7 +56787,9 @@ static wc_test_ret_t mp_test_shbd(mp_int* a, mp_int* b, WC_RNG* rng)
|
||||
ret = randNum(a, j, rng, NULL);
|
||||
if (ret != MP_OKAY)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
mp_copy(a, b);
|
||||
ret = mp_copy(a, b);
|
||||
if (ret != WC_NO_ERR_TRACE(MP_VAL))
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
for (k = 0; k <= DIGIT_BIT * 2; k++) {
|
||||
ret = mp_mul_2d(a, k, a);
|
||||
if (ret != MP_OKAY)
|
||||
@ -56804,7 +56808,9 @@ static wc_test_ret_t mp_test_shbd(mp_int* a, mp_int* b, WC_RNG* rng)
|
||||
ret = randNum(a, j, rng, NULL);
|
||||
if (ret != MP_OKAY)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
mp_copy(a, b);
|
||||
ret = mp_copy(a, b);
|
||||
if (ret != WC_NO_ERR_TRACE(MP_VAL))
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
for (k = 0; k < 10; k++) {
|
||||
ret = mp_lshd(a, k);
|
||||
if (ret != MP_OKAY)
|
||||
@ -57598,7 +57604,9 @@ static wc_test_ret_t mp_test_exptmod(mp_int* b, mp_int* e, mp_int* m, mp_int* r)
|
||||
mp_mul_2d(b, DIGIT_BIT, b);
|
||||
mp_add_d(b, 1, b);
|
||||
mp_set(e, 0x3);
|
||||
mp_copy(b, m);
|
||||
ret = mp_copy(b, m);
|
||||
if (ret != WC_NO_ERR_TRACE(MP_VAL))
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
ret = mp_exptmod_ex(b, e, 1, m, r);
|
||||
if (ret != MP_OKAY)
|
||||
return WC_TEST_RET_ENC_EC(ret);
|
||||
|
Reference in New Issue
Block a user