From: Jouni Malinen Date: Sun, 6 Jan 2013 16:59:46 +0000 (+0200) Subject: SAE: Remove unnecessary sae_derive_k() wrapper X-Git-Tag: aosp-kk-from-upstream~641 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30846fa65fd0aa944149311086f6f7a3dbd612a7;p=thirdparty%2Fhostap.git SAE: Remove unnecessary sae_derive_k() wrapper Signed-hostap: Jouni Malinen --- diff --git a/src/common/sae.c b/src/common/sae.c index 6aed89c42..6cf027298 100644 --- a/src/common/sae.c +++ b/src/common/sae.c @@ -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; }