From owner-p4-projects@FreeBSD.ORG Tue Feb 3 14:12:59 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4F54516A4D0; Tue, 3 Feb 2004 14:12:59 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 004C416A4CF for ; Tue, 3 Feb 2004 14:12:59 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 630BA43D5E for ; Tue, 3 Feb 2004 14:12:52 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i13MCq0B045823 for ; Tue, 3 Feb 2004 14:12:52 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i13MCpvk045816 for perforce@freebsd.org; Tue, 3 Feb 2004 14:12:51 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 14:12:51 -0800 (PST) Message-Id: <200402032212.i13MCpvk045816@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46441 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2004 22:13:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=46441 Change 46441 by sam@sam_ebb on 2004/02/03 14:12:16 add some comments about pre-shared key Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#15 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#15 (text+ko) ==== @@ -779,6 +779,7 @@ } } +/* XXX TODO: add statistics */ static void ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh, u_int8_t *frm, u_int8_t *efrm, struct ieee80211_node *ni, int rssi, @@ -787,17 +788,31 @@ u_int8_t *challenge = NULL; int allocbs, i, estatus; + /* + * NB: this can happen as we allow pre-shared key + * authentication to be enabled w/o wep being turned + * on so that configuration of these can be done + * in any order. It may be better to enforce the + * ordering in which case this check would just be + * for sanity/consistency. + */ if ((ic->ic_flags & IEEE80211_F_WEPON) == 0) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: WEP is off\n", __func__)); estatus = IEEE80211_STATUS_ALG; goto bad; } + /* + * Pre-shared key authentication is evil; accept + * it only if explicitly configured (it is supported + * mainly for compatibility with clients like OS X). + */ if (ic->ic_authmode != IEEE80211_AUTH_AUTO && ic->ic_authmode != IEEE80211_AUTH_SHARED) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: operating in %u mode, reject\n", __func__, ic->ic_authmode)); + ic->ic_stats.is_rx_bad_auth++; /* XXX maybe a unique error? */ estatus = IEEE80211_STATUS_ALG; goto bad; }