summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-09-17 19:27:43 +0000
committersam <sam@FreeBSD.org>2003-09-17 19:27:43 +0000
commitc05e0fce3c3ce36d2e1a751a91e850addc6491bd (patch)
tree5e6773794afe96f545f59d05bdaced300777d80a /sbin/ifconfig
parent60c9101e19795b15be730dd01c15118f60b2737e (diff)
downloadFreeBSD-src-c05e0fce3c3ce36d2e1a751a91e850addc6491bd.zip
FreeBSD-src-c05e0fce3c3ce36d2e1a751a91e850addc6491bd.tar.gz
o add support for setting 128-bit WEP keys
o use IEEE80211_KEYBUF_SIZE instead of magic numbers o distinguish between 40-, 104-, and 128-bit WEP keys when printing status
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifieee80211.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 40c97f1..a32d7c9 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -76,6 +76,7 @@
#include <net/if_types.h>
#include <net/route.h>
#include <net80211/ieee80211.h>
+#include <net80211/ieee80211_crypto.h>
#include <net80211/ieee80211_ioctl.h>
#include <ctype.h>
@@ -229,7 +230,7 @@ set80211wepkey(const char *val, int d, int s, const struct afswtch *rafp)
{
int key = 0;
int len;
- u_int8_t data[14];
+ u_int8_t data[IEEE80211_KEYBUF_SIZE];
if (isdigit(val[0]) && val[1] == ':') {
key = atoi(val)-1;
@@ -253,7 +254,7 @@ set80211nwkey(const char *val, int d, int s, const struct afswtch *rafp)
{
int txkey;
int i, len;
- u_int8_t data[14];
+ u_int8_t data[IEEE80211_KEYBUF_SIZE];
set80211(s, IEEE80211_IOC_WEP, IEEE80211_WEP_ON, 0, NULL);
@@ -427,10 +428,12 @@ ieee80211_status (int s, struct rt_addrinfo *info __unused)
warn("WEP support, but can get keys!");
goto end;
}
- if (ireq.i_len == 0 || ireq.i_len > 13)
+ if (ireq.i_len == 0 ||
+ ireq.i_len > IEEE80211_KEYBUF_SIZE)
continue;
printf("%cwepkey %d:%s", spacer, i+1,
- ireq.i_len <= 5 ? "64-bit" : "128-bit");
+ ireq.i_len <= 5 ? "40-bit" :
+ ireq.i_len <= 13 ? "104-bit" : "128-bit");
if (spacer == '\t')
spacer = ' ';
}
OpenPOWER on IntegriCloud