]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Remove unnecessary sae_derive_k() wrapper
authorJouni Malinen <j@w1.fi>
Sun, 6 Jan 2013 16:59:46 +0000 (18:59 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 12 Jan 2013 15:51:54 +0000 (17:51 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

src/common/sae.c

index 6aed89c42b9479fb83593094da2f483a318f6ab6..6cf027298c5e4612a06ca425e41ef40d36a7c1b6 100644 (file)
@@ -568,14 +568,6 @@ fail:
 }
 
 
-static int sae_derive_k(struct sae_data *sae, u8 *k)
-{
-       if (sae->ec)
-               return sae_derive_k_ecc(sae, k);
-       return sae_derive_k_ffc(sae, k);
-}
-
-
 static int sae_derive_keys(struct sae_data *sae, const u8 *k)
 {
        u8 null_key[SAE_KEYSEED_KEY_LEN], val[SAE_MAX_PRIME_LEN];
@@ -619,7 +611,9 @@ fail:
 int sae_process_commit(struct sae_data *sae)
 {
        u8 k[SAE_MAX_PRIME_LEN];
-       if (sae_derive_k(sae, k) < 0 || sae_derive_keys(sae, k) < 0)
+       if ((sae->ec && sae_derive_k_ecc(sae, k) < 0) ||
+           (sae->dh && sae_derive_k_ffc(sae, k) < 0) ||
+           sae_derive_keys(sae, k) < 0)
                return -1;
        return 0;
 }