wolfcrypt/src/dh.c: fixes for cppcheck complaints: identicalInnerCondition

This commit is contained in:
Daniel Pouzzner
2022-01-08 00:29:18 -06:00
parent 11f72877a2
commit d36a1be74b

View File

@ -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;