Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Dec 2004 01:57:22 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 66293 for review
Message-ID:  <200412030157.iB31vMAX026249@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=66293

Change 66293 by sam@sam_ebb on 2004/12/03 01:56:45

	correct unicast cipher set setting and take into account
	available s/w ciphers when validated mcast and ucast cipher
	settings

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#22 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#22 (text+ko) ====

@@ -2148,8 +2148,8 @@
 			ic->ic_flags &= ~IEEE80211_F_NOBRIDGE;
 		break;
 	case IEEE80211_IOC_MCASTCIPHER:
-		/* XXX s/w implementations */
-		if ((ic->ic_caps & cipher2cap(ireq->i_val)) == 0)
+		if ((ic->ic_caps & cipher2cap(ireq->i_val)) == 0 &&
+		    !ieee80211_crypto_available(ireq->i_val))
 			return EINVAL;
 		rsn->rsn_mcastcipher = ireq->i_val;
 		error = (ic->ic_flags & IEEE80211_F_WPA) ? ENETRESET : 0;
@@ -2163,17 +2163,20 @@
 		break;
 	case IEEE80211_IOC_UCASTCIPHERS:
 		/*
-		 * Convert cipher set to equivalent capabilities.
+		 * Convert user-specified cipher set to the set
+		 * we can support (via hardware or software).
 		 * NB: this logic intentionally ignores unknown and
 		 * unsupported ciphers so folks can specify 0xff or
 		 * similar and get all available ciphers.
 		 */
 		caps = 0;
 		for (j = 1; j < 32; j++)	/* NB: skip WEP */
-			if (ireq->i_val & (1<<j))
-				caps |= cipher2cap(j);
-		/* XXX s/w implementations */
-		caps &= ic->ic_caps;	/* restrict to supported ciphers */
+			if ((ireq->i_val & (1<<j)) &&
+			    ((ic->ic_caps & cipher2cap(j)) ||
+			     ieee80211_crypto_available(j)))
+				caps |= 1<<j;
+		if (caps == 0)			/* nothing available */
+			return EINVAL;
 		/* XXX verify ciphers ok for unicast use? */
 		/* XXX disallow if running as it'll have no effect */
 		rsn->rsn_ucastcipherset = caps;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412030157.iB31vMAX026249>