summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2006-01-11 00:18:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2006-01-11 00:18:18 +0000
commit424bfd73ffebf68cb05ce04ec793b6ff382adb47 (patch)
treedc47ef585fc5a167ad46ba6e4fb31fbff7808bdf
parent8c16cd159ed70acb154b18b1413d0cf6d0074114 (diff)
Disable shared key mode until we have a way for the user to specify
that they explicitly want it. What we have currently doesn't seem to work anyway. Add support for specifying a status type when sending managemnent frames; adapted from FreeBSD. OK jsg@
-rw-r--r--sys/net80211/ieee80211_input.c20
-rw-r--r--sys/net80211/ieee80211_output.c12
2 files changed, 22 insertions, 10 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 43e057eb0e2..d2838bfc3df 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,5 +1,5 @@
/* $NetBSD: ieee80211_input.c,v 1.24 2004/05/31 11:12:24 dyoung Exp $ */
-/* $OpenBSD: ieee80211_input.c,v 1.13 2006/01/02 08:05:36 reyk Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.14 2006/01/11 00:18:17 millert Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -734,6 +734,7 @@ ieee80211_auth_open(struct ieee80211com *ic, struct ieee80211_frame *wh,
}
}
+#if 0
/* TBD send appropriate responses on error? */
static void
ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh,
@@ -904,6 +905,7 @@ ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh,
break;
}
}
+#endif
void
ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
@@ -1211,17 +1213,25 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
IEEE80211_DPRINTF(("%s: auth %d seq %d from %s\n",
__func__, algo, seq, ether_sprintf(wh->i_addr2)));
- if (algo == IEEE80211_AUTH_ALG_SHARED)
- ieee80211_auth_shared(ic, wh, frm + 6, efrm, ni, rssi,
- rstamp, seq, status);
- else if (algo == IEEE80211_AUTH_ALG_OPEN)
+ if (algo == IEEE80211_AUTH_ALG_OPEN)
ieee80211_auth_open(ic, wh, ni, rssi, rstamp, seq,
status);
+#if 0
+ else if (algo == IEEE80211_AUTH_ALG_SHARED)
+ ieee80211_auth_shared(ic, wh, frm + 6, efrm, ni, rssi,
+ rstamp, seq, status);
+#endif
else {
IEEE80211_DPRINTF(("%s: unsupported authentication "
"algorithm %d from %s\n",
__func__, algo, ether_sprintf(wh->i_addr2)));
ic->ic_stats.is_rx_auth_unsupported++;
+ if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
+ /* XXX hack to workaround calling convention */
+ IEEE80211_SEND_MGMT(ic, ni,
+ IEEE80211_FC0_SUBTYPE_AUTH,
+ (seq+1) | (IEEE80211_STATUS_ALG<<16));
+ }
return;
}
break;
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 37d1f5af9a5..15474db3944 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_output.c,v 1.13 2005/09/08 13:24:53 reyk Exp $ */
+/* $OpenBSD: ieee80211_output.c,v 1.14 2006/01/11 00:18:17 millert Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */
/*-
@@ -586,7 +586,7 @@ ieee80211_send_mgmt(struct ieee80211com *ic, struct ieee80211_node *ni,
u_int8_t *frm;
enum ieee80211_phymode mode;
u_int16_t capinfo;
- int has_challenge, is_shared_key, ret, timer;
+ int has_challenge, is_shared_key, ret, timer, status;
if (ni == NULL)
panic("null node");
@@ -703,6 +703,8 @@ ieee80211_send_mgmt(struct ieee80211com *ic, struct ieee80211_node *ni,
if (m == NULL)
senderr(ENOMEM, is_tx_nombuf);
+ status = arg >> 16;
+ arg &= 0xffff;
has_challenge = ((arg == IEEE80211_AUTH_SHARED_CHALLENGE ||
arg == IEEE80211_AUTH_SHARED_RESPONSE) &&
ni->ni_challenge != NULL);
@@ -710,7 +712,7 @@ ieee80211_send_mgmt(struct ieee80211com *ic, struct ieee80211_node *ni,
is_shared_key = has_challenge || (ni->ni_challenge != NULL &&
arg == IEEE80211_AUTH_SHARED_PASS);
- if (has_challenge) {
+ if (has_challenge && status == IEEE80211_STATUS_SUCCESS) {
MH_ALIGN(m, 2 * 3 + 2 + IEEE80211_CHALLENGE_LEN);
m->m_pkthdr.len = m->m_len =
2 * 3 + 2 + IEEE80211_CHALLENGE_LEN;
@@ -723,9 +725,9 @@ ieee80211_send_mgmt(struct ieee80211com *ic, struct ieee80211_node *ni,
(is_shared_key) ? htole16(IEEE80211_AUTH_ALG_SHARED) :
htole16(IEEE80211_AUTH_ALG_OPEN);
((u_int16_t *)frm)[1] = htole16(arg); /* sequence number */
- ((u_int16_t *)frm)[2] = 0; /* status */
+ ((u_int16_t *)frm)[2] = htole16(status);/* status */
- if (has_challenge) {
+ if (has_challenge && status == IEEE80211_STATUS_SUCCESS) {
((u_int16_t *)frm)[3] =
htole16((IEEE80211_CHALLENGE_LEN << 8) |
IEEE80211_ELEMID_CHALLENGE);