From d36a1be74b7b39d500094994947a77254957bd04 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Sat, 8 Jan 2022 00:29:18 -0600 Subject: [PATCH] wolfcrypt/src/dh.c: fixes for cppcheck complaints: identicalInnerCondition --- wolfcrypt/src/dh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index 26c62832f..64bf127c5 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.c @@ -1736,10 +1736,8 @@ int wc_DhCheckPrivKey_ex(DhKey* key, const byte* priv, word32 privSz, if (ret == 0) { if (mp_iszero(q) == MP_NO) { /* priv (x) shouldn't be greater than q - 1 */ - if (ret == 0) { - if (mp_copy(&key->q, q) != MP_OKAY) - ret = MP_INIT_E; - } + if (mp_copy(&key->q, q) != MP_OKAY) + ret = MP_INIT_E; if (ret == 0) { if (mp_sub_d(q, 1, q) != MP_OKAY) ret = MP_SUB_E;