]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Merge sae_get_rand() error case return statements
authorJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 19:35:09 +0000 (22:35 +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 e3b61a63f155ded86dd3ed43678eab8338e92449..fe5cb6a292abe94c917e84316327bc43f6f41dc4 100644 (file)
@@ -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);