From 8ec33326c14ad659de687d6a37d77a7af234de85 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 23 Jun 2015 22:38:38 +0300 Subject: [PATCH] SAE: Merge sae_derive_commit() error case return statements These error cases have the exact same outcome, so a single return statement can be used. Signed-off-by: Jouni Malinen --- src/common/sae.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/sae.c b/src/common/sae.c index fe5cb6a29..850dd5f15 100644 --- a/src/common/sae.c +++ b/src/common/sae.c @@ -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;