aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-12-10 22:49:39 (GMT)
committerJouni Malinen <j@w1.fi>2008-12-10 22:49:39 (GMT)
commit3ee81d489a5129d3b06e28510008f247373d0166 (patch)
tree9f90b1119da9f6670a0476b24db7a9737b52f23d /src/eap_peer
parent1edb9533f1a7c7a9c0dc0af619931415ff7caf41 (diff)
downloadhostap-06-3ee81d489a5129d3b06e28510008f247373d0166.zip
hostap-06-3ee81d489a5129d3b06e28510008f247373d0166.tar.gz
hostap-06-3ee81d489a5129d3b06e28510008f247373d0166.tar.bz2
Don't include unused calls to SHA256 functions if EAP-AKA' is not enabled
Diffstat (limited to 'src/eap_peer')
-rw-r--r--src/eap_peer/eap_aka.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/eap_peer/eap_aka.c b/src/eap_peer/eap_aka.c
index ff68dfb..4e08090 100644
--- a/src/eap_peer/eap_aka.c
+++ b/src/eap_peer/eap_aka.c
@@ -340,9 +340,11 @@ static void eap_aka_add_checkcode(struct eap_aka_data *data,
addr = wpabuf_head(data->id_msgs);
len = wpabuf_len(data->id_msgs);
wpa_hexdump(MSG_MSGDUMP, "EAP-AKA: AT_CHECKCODE data", addr, len);
+#ifdef EAP_AKA_PRIME
if (data->eap_method == EAP_TYPE_AKA_PRIME)
sha256_vector(1, &addr, &len, hash);
else
+#endif /* EAP_AKA_PRIME */
sha1_vector(1, &addr, &len, hash);
eap_sim_msg_add(msg, EAP_SIM_AT_CHECKCODE, 0, hash,
@@ -385,9 +387,11 @@ static int eap_aka_verify_checkcode(struct eap_aka_data *data,
/* Checkcode is SHA1/SHA256 hash over all EAP-AKA/Identity packets. */
addr = wpabuf_head(data->id_msgs);
len = wpabuf_len(data->id_msgs);
+#ifdef EAP_AKA_PRIME
if (data->eap_method == EAP_TYPE_AKA_PRIME)
sha256_vector(1, &addr, &len, hash);
else
+#endif /* EAP_AKA_PRIME */
sha1_vector(1, &addr, &len, hash);
if (os_memcmp(hash, checkcode, hash_len) != 0) {