From d93abd4a97569488f27f65f530a95bb811fb97a2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 23 Jun 2015 22:35:09 +0300 Subject: [PATCH] SAE: Merge sae_get_rand() 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/sae.c b/src/common/sae.c index e3b61a63f..fe5cb6a29 100644 --- a/src/common/sae.c +++ b/src/common/sae.c @@ -124,9 +124,7 @@ static struct crypto_bignum * sae_get_rand(struct sae_data *sae) return NULL; for (;;) { - if (iter++ > 100) - return NULL; - if (random_get_bytes(val, order_len) < 0) + if (iter++ > 100 || random_get_bytes(val, order_len) < 0) return NULL; if (order_len_bits % 8) buf_shift_right(val, order_len, 8 - order_len_bits % 8);