]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Merge sae_derive_commit() error case return statements
authorJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 19:38:38 +0000 (22:38 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 20:10:36 +0000 (23:10 +0300)
These error cases have the exact same outcome, so a single return
statement can be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/common/sae.c

index fe5cb6a292abe94c917e84316327bc43f6f41dc4..850dd5f1517757e9675fe728f4ce9c4097baf742 100644 (file)
@@ -488,9 +488,8 @@ static int sae_derive_commit(struct sae_data *sae)
        crypto_bignum_mod(sae->tmp->own_commit_scalar, sae->tmp->order,
                          sae->tmp->own_commit_scalar);
 
-       if (sae->tmp->ec && sae_derive_commit_element_ecc(sae, mask) < 0)
-               goto fail;
-       if (sae->tmp->dh && sae_derive_commit_element_ffc(sae, mask) < 0)
+       if ((sae->tmp->ec && sae_derive_commit_element_ecc(sae, mask) < 0) ||
+           (sae->tmp->dh && sae_derive_commit_element_ffc(sae, mask) < 0))
                goto fail;
 
        ret = 0;