iPXE
sec80211.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Joshua Oreman <oremanj@rwcr.net>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301, USA.
18  */
19 
20 FILE_LICENCE ( GPL2_OR_LATER );
21 FILE_SECBOOT ( FORBIDDEN );
22 
23 #include <stdlib.h>
24 #include <string.h>
25 #include <errno.h>
26 #include <ipxe/ieee80211.h>
27 #include <ipxe/net80211.h>
28 #include <ipxe/sec80211.h>
29 
30 /** @file
31  *
32  * General secured-network routines required whenever any secure
33  * network support at all is compiled in. This involves things like
34  * installing keys, determining the type of security used by a probed
35  * network, and some small helper functions that take advantage of
36  * static data in this file.
37  */
38 
39 /* Unsupported cryptosystem error numbers */
40 #define ENOTSUP_WEP __einfo_error ( EINFO_ENOTSUP_WEP )
41 #define EINFO_ENOTSUP_WEP __einfo_uniqify ( EINFO_ENOTSUP, \
42  ( 0x10 | NET80211_CRYPT_WEP ), "WEP not supported" )
43 #define ENOTSUP_TKIP __einfo_error ( EINFO_ENOTSUP_TKIP )
44 #define EINFO_ENOTSUP_TKIP __einfo_uniqify ( EINFO_ENOTSUP, \
45  ( 0x10 | NET80211_CRYPT_TKIP ), "TKIP not supported" )
46 #define ENOTSUP_CCMP __einfo_error ( EINFO_ENOTSUP_CCMP )
47 #define EINFO_ENOTSUP_CCMP __einfo_uniqify ( EINFO_ENOTSUP, \
48  ( 0x10 | NET80211_CRYPT_CCMP ), "CCMP not supported" )
49 #define ENOTSUP_CRYPT( crypt ) \
50  EUNIQ ( EINFO_ENOTSUP, ( 0x10 | (crypt) ), \
51  ENOTSUP_WEP, ENOTSUP_TKIP, ENOTSUP_CCMP )
52 
53 /** Mapping from net80211 crypto/secprot types to RSN OUI descriptors */
55  /** Value of net80211_crypto_alg or net80211_security_proto */
57 
58  /** OUI+type in appropriate byte order, masked to exclude vendor */
60 };
61 
62 /** Magic number in @a oui_type showing end of list */
63 #define END_MAGIC 0xFFFFFFFF
64 
65 /** Mapping between net80211 cryptosystems and 802.11i cipher IDs */
66 static struct descriptor_map rsn_cipher_map[] = {
68  .oui_type = IEEE80211_RSN_CTYPE_WEP40 },
69 
70  { .net80211_type = NET80211_CRYPT_WEP,
71  .oui_type = IEEE80211_RSN_CTYPE_WEP104 },
72 
73  { .net80211_type = NET80211_CRYPT_TKIP,
74  .oui_type = IEEE80211_RSN_CTYPE_TKIP },
75 
76  { .net80211_type = NET80211_CRYPT_CCMP,
77  .oui_type = IEEE80211_RSN_CTYPE_CCMP },
78 
79  { .net80211_type = NET80211_CRYPT_UNKNOWN,
80  .oui_type = END_MAGIC },
81 };
82 
83 /** Mapping between net80211 handshakers and 802.11i AKM IDs */
84 static struct descriptor_map rsn_akm_map[] = {
86  .oui_type = IEEE80211_RSN_ATYPE_8021X },
87 
88  { .net80211_type = NET80211_SECPROT_PSK,
89  .oui_type = IEEE80211_RSN_ATYPE_PSK },
90 
91  { .net80211_type = NET80211_SECPROT_UNKNOWN,
92  .oui_type = END_MAGIC },
93 };
94 
95 
96 /**
97  * Install 802.11 cryptosystem
98  *
99  * @v which Pointer to the cryptosystem structure to install in
100  * @v crypt Cryptosystem ID number
101  * @v key Encryption key to use
102  * @v len Length of encryption key
103  * @v rsc Initial receive sequence counter, if applicable
104  * @ret rc Return status code
105  *
106  * The encryption key will not be accessed via the provided pointer
107  * after this function returns, so you may keep it on the stack.
108  *
109  * @a which must point to either @c dev->crypto (for the normal case
110  * of installing a unicast cryptosystem) or @c dev->gcrypto (to
111  * install a cryptosystem that will be used only for decrypting
112  * group-source frames).
113  */
114 int sec80211_install ( struct net80211_crypto **which,
115  enum net80211_crypto_alg crypt,
116  const void *key, int len, const void *rsc )
117 {
118  struct net80211_crypto *crypto = *which;
119  struct net80211_crypto *tbl_crypto;
120 
121  /* Remove old crypto if it exists */
122  free ( *which );
123  *which = NULL;
124 
125  if ( crypt == NET80211_CRYPT_NONE ) {
126  DBG ( "802.11-Sec not installing null cryptography\n" );
127  return 0;
128  }
129 
130  /* Find cryptosystem to use */
131  for_each_table_entry ( tbl_crypto, NET80211_CRYPTOS ) {
132  if ( tbl_crypto->algorithm == crypt ) {
133  crypto = zalloc ( sizeof ( *crypto ) +
134  tbl_crypto->priv_len );
135  if ( ! crypto ) {
136  DBG ( "802.11-Sec out of memory\n" );
137  return -ENOMEM;
138  }
139 
140  memcpy ( crypto, tbl_crypto, sizeof ( *crypto ) );
141  crypto->priv = ( ( void * ) crypto +
142  sizeof ( *crypto ) );
143  break;
144  }
145  }
146 
147  if ( ! crypto ) {
148  DBG ( "802.11-Sec no support for cryptosystem %d\n", crypt );
149  return -ENOTSUP_CRYPT ( crypt );
150  }
151 
152  *which = crypto;
153 
154  DBG ( "802.11-Sec installing cryptosystem %d as %p with key of "
155  "length %d\n", crypt, crypto, len );
156 
157  return crypto->init ( crypto, key, len, rsc );
158 }
159 
160 
161 /**
162  * Determine net80211 crypto or handshaking type value to return for RSN info
163  *
164  * @v rsnp Pointer to next descriptor count field in RSN IE
165  * @v rsn_end Pointer to end of RSN IE
166  * @v map Descriptor map to use
167  * @v tbl_start Start of linker table to examine for iPXE support
168  * @v tbl_end End of linker table to examine for iPXE support
169  * @ret rsnp Updated to point to first byte after descriptors
170  * @ret map_ent Descriptor map entry of translation to use
171  *
172  * The entries in the linker table must be either net80211_crypto or
173  * net80211_handshaker structures, and @a tbl_stride must be set to
174  * sizeof() the appropriate one.
175  *
176  * This function expects @a rsnp to point at a two-byte descriptor
177  * count followed by a list of four-byte cipher or AKM descriptors; it
178  * will return @c NULL if the input packet is malformed, and otherwise
179  * set @a rsnp to the first byte it has not looked at. It will return
180  * the first cipher in the list that is supported by the current build
181  * of iPXE, or the first of all if none are supported.
182  *
183  * We play rather fast and loose with type checking, because this
184  * function is only called from two well-defined places in the
185  * RSN-checking code. Don't try to use it for anything else.
186  */
187 static struct descriptor_map * rsn_pick_desc ( u8 **rsnp, u8 *rsn_end,
188  struct descriptor_map *map,
189  void *tbl_start, void *tbl_end )
190 {
191  int ndesc;
192  int ok = 0;
193  struct descriptor_map *map_ent, *map_ret = NULL;
194  u8 *rsn = *rsnp;
195  void *tblp;
196  size_t tbl_stride = ( map == rsn_cipher_map ?
197  sizeof ( struct net80211_crypto ) :
198  sizeof ( struct net80211_handshaker ) );
199 
200  if ( map != rsn_cipher_map && map != rsn_akm_map )
201  return NULL;
202 
203  /* Determine which types we support */
204  for ( tblp = tbl_start; tblp < tbl_end; tblp += tbl_stride ) {
205  struct net80211_crypto *crypto = tblp;
206  struct net80211_handshaker *hs = tblp;
207 
208  if ( map == rsn_cipher_map )
209  ok |= ( 1 << crypto->algorithm );
210  else
211  ok |= ( 1 << hs->protocol );
212  }
213 
214  /* RSN sanity checks */
215  if ( rsn + 2 > rsn_end ) {
216  DBG ( "RSN detect: malformed descriptor count\n" );
217  return NULL;
218  }
219 
220  ndesc = *( u16 * ) rsn;
221  rsn += 2;
222 
223  if ( ! ndesc ) {
224  DBG ( "RSN detect: no descriptors\n" );
225  return NULL;
226  }
227 
228  /* Determine which net80211 crypto types are listed */
229  while ( ndesc-- ) {
230  u32 desc;
231 
232  if ( rsn + 4 > rsn_end ) {
233  DBG ( "RSN detect: malformed descriptor (%d left)\n",
234  ndesc );
235  return NULL;
236  }
237 
238  desc = *( u32 * ) rsn;
239  rsn += 4;
240 
241  for ( map_ent = map; map_ent->oui_type != END_MAGIC; map_ent++ )
242  if ( map_ent->oui_type == ( desc & OUI_TYPE_MASK ) )
243  break;
244 
245  /* Use first cipher as a fallback */
246  if ( ! map_ret )
247  map_ret = map_ent;
248 
249  /* Once we find one we support, use it */
250  if ( ok & ( 1 << map_ent->net80211_type ) ) {
251  map_ret = map_ent;
252  break;
253  }
254  }
255 
256  if ( ndesc > 0 )
257  rsn += 4 * ndesc;
258 
259  *rsnp = rsn;
260  return map_ret;
261 }
262 
263 
264 /**
265  * Find the RSN or WPA information element in the provided beacon frame
266  *
267  * @v ie Pointer to first information element to check
268  * @v ie_end Pointer to end of information element space
269  * @ret is_rsn TRUE if returned IE is RSN, FALSE if it's WPA
270  * @ret end Pointer to byte immediately after last byte of data
271  * @ret data Pointer to first byte of data (the `version' field)
272  *
273  * If both an RSN and a WPA information element are found, this
274  * function will return the first one seen, which by ordering rules
275  * should always prefer the newer RSN IE.
276  *
277  * If no RSN or WPA infomration element is found, returns @c NULL and
278  * leaves @a is_rsn and @a end in an undefined state.
279  *
280  * This function will not return a pointer to an information element
281  * that states it extends past the tail of the io_buffer, or whose @a
282  * version field is incorrect.
283  */
284 u8 * sec80211_find_rsn ( union ieee80211_ie *ie, void *ie_end,
285  int *is_rsn, u8 **end )
286 {
287  u8 *rsn = NULL;
288 
289  if ( ! ieee80211_ie_bound ( ie, ie_end ) )
290  return NULL;
291 
292  while ( ie ) {
293  if ( ie->id == IEEE80211_IE_VENDOR &&
294  ie->vendor.oui == IEEE80211_WPA_OUI_VEN ) {
295  DBG ( "RSN detect: old-style WPA IE found\n" );
296  rsn = &ie->vendor.data[0];
297  *end = rsn + ie->len - 4;
298  *is_rsn = 0;
299  } else if ( ie->id == IEEE80211_IE_RSN ) {
300  DBG ( "RSN detect: 802.11i RSN IE found\n" );
301  rsn = ( u8 * ) &ie->rsn.version;
302  *end = rsn + ie->len;
303  *is_rsn = 1;
304  }
305 
306  if ( rsn && ( *end > ( u8 * ) ie_end || rsn >= *end ||
307  *( u16 * ) rsn != IEEE80211_RSN_VERSION ) ) {
308  DBG ( "RSN detect: malformed RSN IE or unknown "
309  "version, keep trying\n" );
310  rsn = NULL;
311  }
312 
313  if ( rsn )
314  break;
315 
316  ie = ieee80211_next_ie ( ie, ie_end );
317  }
318 
319  if ( ! ie ) {
320  DBG ( "RSN detect: no RSN IE found\n" );
321  return NULL;
322  }
323 
324  return rsn;
325 }
326 
327 
328 /**
329  * Detect crypto and AKM types from RSN information element
330  *
331  * @v is_rsn If TRUE, IE is a new-style RSN information element
332  * @v start Pointer to first byte of @a version field
333  * @v end Pointer to first byte not in the RSN IE
334  * @ret secprot Security handshaking protocol used by network
335  * @ret crypt Cryptosystem used by network
336  * @ret rc Return status code
337  *
338  * If the IE cannot be parsed, returns an error indication and leaves
339  * @a secprot and @a crypt unchanged.
340  */
341 int sec80211_detect_ie ( int is_rsn, u8 *start, u8 *end,
342  enum net80211_security_proto *secprot,
343  enum net80211_crypto_alg *crypt )
344 {
346  enum net80211_crypto_alg cr;
347  struct descriptor_map *map;
348  u8 *rsn = start;
349 
350  /* Set some defaults */
351  cr = ( is_rsn ? NET80211_CRYPT_CCMP : NET80211_CRYPT_TKIP );
353 
354  rsn += 2; /* version - already checked */
355  rsn += 4; /* group cipher - we don't use it here */
356 
357  if ( rsn >= end )
358  goto done;
359 
360  /* Pick crypto algorithm */
361  map = rsn_pick_desc ( &rsn, end, rsn_cipher_map,
364  if ( ! map )
365  goto invalid_rsn;
366 
367  cr = map->net80211_type;
368 
369  if ( rsn >= end )
370  goto done;
371 
372  /* Pick handshaking algorithm */
373  map = rsn_pick_desc ( &rsn, end, rsn_akm_map,
376  if ( ! map )
377  goto invalid_rsn;
378 
379  sp = map->net80211_type;
380 
381  done:
382  DBG ( "RSN detect: OK, crypto type %d, secprot type %d\n", cr, sp );
383  *secprot = sp;
384  *crypt = cr;
385  return 0;
386 
387  invalid_rsn:
388  DBG ( "RSN detect: invalid RSN IE\n" );
389  return -EINVAL;
390 }
391 
392 
393 /**
394  * Detect the cryptosystem and handshaking protocol used by an 802.11 network
395  *
396  * @v iob I/O buffer containing beacon frame
397  * @ret secprot Security handshaking protocol used by network
398  * @ret crypt Cryptosystem used by network
399  * @ret rc Return status code
400  *
401  * This function uses weak linkage, as it must be called from generic
402  * contexts but should only be linked in if some encryption is
403  * supported; you must test its address against @c NULL before calling
404  * it. If it does not exist, any network with the PRIVACY bit set in
405  * beacon->capab should be considered unknown.
406  */
407 int sec80211_detect ( struct io_buffer *iob,
408  enum net80211_security_proto *secprot,
409  enum net80211_crypto_alg *crypt )
410 {
411  struct ieee80211_frame *hdr = iob->data;
412  struct ieee80211_beacon *beacon =
413  ( struct ieee80211_beacon * ) hdr->data;
414  u8 *rsn, *rsn_end;
415  int is_rsn, rc;
416 
417  *crypt = NET80211_CRYPT_UNKNOWN;
418  *secprot = NET80211_SECPROT_UNKNOWN;
419 
420  /* Find RSN or WPA IE */
421  if ( ! ( rsn = sec80211_find_rsn ( beacon->info_element, iob->tail,
422  &is_rsn, &rsn_end ) ) ) {
423  /* No security IE at all; either WEP or no security. */
424  *secprot = NET80211_SECPROT_NONE;
425 
426  if ( beacon->capability & IEEE80211_CAPAB_PRIVACY )
427  *crypt = NET80211_CRYPT_WEP;
428  else
429  *crypt = NET80211_CRYPT_NONE;
430 
431  return 0;
432  }
433 
434  /* Determine type of security */
435  if ( ( rc = sec80211_detect_ie ( is_rsn, rsn, rsn_end, secprot,
436  crypt ) ) == 0 )
437  return 0;
438 
439  /* If we get here, the RSN IE was invalid */
440 
441  *crypt = NET80211_CRYPT_UNKNOWN;
442  *secprot = NET80211_SECPROT_UNKNOWN;
443  DBG ( "Failed to handle RSN IE:\n" );
444  DBG_HD ( rsn, rsn_end - rsn );
445  return rc;
446 }
447 
448 
449 /**
450  * Determine RSN descriptor for specified net80211 ID
451  *
452  * @v id net80211 ID value
453  * @v rsnie Whether to return a new-format (RSN IE) descriptor
454  * @v map Map to use in translation
455  * @ret desc RSN descriptor, or 0 on error
456  *
457  * If @a rsnie is false, returns an old-format (WPA vendor IE)
458  * descriptor.
459  */
460 static u32 rsn_get_desc ( unsigned id, int rsnie, struct descriptor_map *map )
461 {
463 
464  for ( ; map->oui_type != END_MAGIC; map++ ) {
465  if ( map->net80211_type == id )
466  return map->oui_type | vendor;
467  }
468 
469  return 0;
470 }
471 
472 /**
473  * Determine RSN descriptor for specified net80211 cryptosystem number
474  *
475  * @v crypt Cryptosystem number
476  * @v rsnie Whether to return a new-format (RSN IE) descriptor
477  * @ret desc RSN descriptor
478  *
479  * If @a rsnie is false, returns an old-format (WPA vendor IE)
480  * descriptor.
481  */
483 {
484  return rsn_get_desc ( crypt, rsnie, rsn_cipher_map );
485 }
486 
487 /**
488  * Determine RSN descriptor for specified net80211 handshaker number
489  *
490  * @v secprot Handshaker number
491  * @v rsnie Whether to return a new-format (RSN IE) descriptor
492  * @ret desc RSN descriptor
493  *
494  * If @a rsnie is false, returns an old-format (WPA vendor IE)
495  * descriptor.
496  */
498  int rsnie )
499 {
500  return rsn_get_desc ( secprot, rsnie, rsn_akm_map );
501 }
502 
503 /**
504  * Determine net80211 cryptosystem number from RSN descriptor
505  *
506  * @v desc RSN descriptor
507  * @ret crypt net80211 cryptosystem enumeration value
508  */
510 {
512 
513  for ( ; map->oui_type != END_MAGIC; map++ ) {
514  if ( map->oui_type == ( desc & OUI_TYPE_MASK ) )
515  break;
516  }
517 
518  return map->net80211_type;
519 }
#define IEEE80211_RSN_CTYPE_CCMP
802.11 RSN IE: cipher type for CCMP ("WPA2")
Definition: ieee80211.h:885
#define IEEE80211_RSN_OUI
Organization part for OUIs in standard RSN IE.
Definition: ieee80211.h:863
uint16_t u16
Definition: stdint.h:22
#define EINVAL
Invalid argument.
Definition: errno.h:429
u32 oui_type
OUI+type in appropriate byte order, masked to exclude vendor.
Definition: sec80211.c:59
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
Network protected with CCMP (AES-based system)
Definition: net80211.h:174
#define IEEE80211_RSN_ATYPE_8021X
802.11 RSN IE: auth method type for using an 802.1X server
Definition: ieee80211.h:895
FILE_SECBOOT(FORBIDDEN)
No security handshaking.
Definition: net80211.h:102
#define OUI_TYPE_MASK
Definition: ieee80211.h:859
static union ieee80211_ie * ieee80211_next_ie(union ieee80211_ie *ie, void *end)
Advance to next 802.11 information element.
Definition: ieee80211.h:1028
#define table_start(table)
Get start of linker table.
Definition: tables.h:283
Error codes.
Dummy value used when the cryptosystem can't be detected.
Definition: net80211.h:177
#define DBG_HD(...)
Definition: compiler.h:500
struct golan_inbox_hdr hdr
Message header.
Definition: CIB_PRM.h:28
#define IEEE80211_CAPAB_PRIVACY
Set if the network is encrypted (by any method)
Definition: ieee80211.h:401
static unsigned short vendor
Definition: davicom.c:128
Constants and data structures defined in IEEE 802.11, subsetted according to what iPXE knows how to u...
An 802.11 data or management frame without QoS or WDS header fields.
Definition: ieee80211.h:300
net80211_security_proto
An 802.11 security handshaking protocol.
Definition: net80211.h:96
Full EAP 802.1X handshaking.
Definition: net80211.h:121
#define IEEE80211_RSN_CTYPE_WEP104
802.11 RSN IE: cipher type for 104-bit WEP
Definition: ieee80211.h:879
FILE_LICENCE(GPL2_OR_LATER)
#define IEEE80211_RSN_CTYPE_WEP40
802.11 RSN IE: cipher type for 40-bit WEP
Definition: ieee80211.h:876
Network protected with WEP (awful RC4-based system)
Definition: net80211.h:145
int(* init)(struct net80211_crypto *crypto, const void *key, int keylen, const void *rsc)
Initialize cryptosystem using a given key.
Definition: net80211.h:707
int priv_len
Length of private data requested to be allocated.
Definition: net80211.h:763
Dummy value used when the handshaking type can't be detected.
Definition: net80211.h:124
#define END_MAGIC
Magic number in oui_type showing end of list.
Definition: sec80211.c:63
Definitions for general secured-network routines.
static struct descriptor_map * rsn_pick_desc(u8 **rsnp, u8 *rsn_end, struct descriptor_map *map, void *tbl_start, void *tbl_end)
Determine net80211 crypto or handshaking type value to return for RSN info.
Definition: sec80211.c:187
#define IEEE80211_RSN_ATYPE_PSK
802.11 RSN IE: auth method type for using a pre-shared key
Definition: ieee80211.h:898
#define ENOTSUP_CRYPT(crypt)
Definition: sec80211.c:49
uint32_t start
Starting offset.
Definition: netvsc.h:12
struct ena_llq_option desc
Descriptor counts.
Definition: ena.h:20
void * tail
End of data.
Definition: iobuf.h:55
#define ENOMEM
Not enough space.
Definition: errno.h:535
enum net80211_crypto_alg algorithm
The cryptographic algorithm implemented.
Definition: net80211.h:692
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static u32 rsn_get_desc(unsigned id, int rsnie, struct descriptor_map *map)
Determine RSN descriptor for specified net80211 ID.
Definition: sec80211.c:460
#define IEEE80211_WPA_OUI_VEN
Old vendor-type WPA IE OUI type + subtype.
Definition: ieee80211.h:869
Pre-shared key handshaking.
Definition: net80211.h:112
ring len
Length.
Definition: dwmac.h:231
u8 rsc[8]
Receive sequence counter for GTK.
Definition: wpa.h:69
#define NET80211_CRYPTOS
Definition: net80211.h:769
#define IEEE80211_WPA_OUI
Organization part for OUIs in old WPA IE.
Definition: ieee80211.h:866
#define ieee80211_beacon
Definition: ieee80211.h:1069
int sec80211_install(struct net80211_crypto **which, enum net80211_crypto_alg crypt, const void *key, int len, const void *rsc)
Install 802.11 cryptosystem.
Definition: sec80211.c:114
Mapping from net80211 crypto/secprot types to RSN OUI descriptors.
Definition: sec80211.c:54
#define IEEE80211_IE_VENDOR
Information element ID for Vendor Specific information element.
Definition: ieee80211.h:960
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:55
void * zalloc(size_t size)
Allocate cleared memory.
Definition: malloc.c:662
#define NET80211_HANDSHAKERS
Definition: net80211.h:675
The iPXE 802.11 MAC layer.
#define IEEE80211_IE_RSN
Information element ID for Robust Security Network information element.
Definition: ieee80211.h:834
static struct descriptor_map rsn_cipher_map[]
Mapping between net80211 cryptosystems and 802.11i cipher IDs.
Definition: sec80211.c:66
No security, an "Open" network.
Definition: net80211.h:131
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
Definition: tables.h:386
static int ieee80211_ie_bound(union ieee80211_ie *ie, void *end)
Check that 802.11 information element is bounded by buffer.
Definition: ieee80211.h:1012
#define IEEE80211_RSN_CTYPE_TKIP
802.11 RSN IE: cipher type for TKIP ("WPA")
Definition: ieee80211.h:882
u32 oui_type
OUI + type byte.
Definition: wpa.h:34
void * priv
Private data for the algorithm to store key and state info.
Definition: net80211.h:766
int sec80211_detect_ie(int is_rsn, u8 *start, u8 *end, enum net80211_security_proto *secprot, enum net80211_crypto_alg *crypt)
Detect crypto and AKM types from RSN information element.
Definition: sec80211.c:341
Definition: sis900.h:22
u32 sec80211_rsn_get_crypto_desc(enum net80211_crypto_alg crypt, int rsnie)
Determine RSN descriptor for specified net80211 cryptosystem number.
Definition: sec80211.c:482
u32 sec80211_rsn_get_akm_desc(enum net80211_security_proto secprot, int rsnie)
Determine RSN descriptor for specified net80211 handshaker number.
Definition: sec80211.c:497
static __always_inline int struct dma_mapping * map
Definition: dma.h:184
static struct descriptor_map rsn_akm_map[]
Mapping between net80211 handshakers and 802.11i AKM IDs.
Definition: sec80211.c:84
net80211_crypto_alg
An 802.11 data encryption algorithm.
Definition: net80211.h:129
void * data
Start of data.
Definition: iobuf.h:53
u32 net80211_type
Value of net80211_crypto_alg or net80211_security_proto.
Definition: sec80211.c:56
uint32_t end
Ending offset.
Definition: netvsc.h:18
#define IEEE80211_RSN_VERSION
802.11 RSN IE: expected version number
Definition: ieee80211.h:873
enum net80211_crypto_alg sec80211_rsn_get_net80211_crypt(u32 desc)
Determine net80211 cryptosystem number from RSN descriptor.
Definition: sec80211.c:509
#define table_end(table)
Get end of linker table.
Definition: tables.h:309
int sec80211_detect(struct io_buffer *iob, enum net80211_security_proto *secprot, enum net80211_crypto_alg *crypt)
Detect the cryptosystem and handshaking protocol used by an 802.11 network.
Definition: sec80211.c:407
return
Definition: natsemi.h:326
Network protected with TKIP (better RC4-based system)
Definition: net80211.h:163
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
Interface to an 802.11 cryptosystem.
Definition: net80211.h:689
#define ok(success)
Definition: test.h:46
u8 * sec80211_find_rsn(union ieee80211_ie *ie, void *ie_end, int *is_rsn, u8 **end)
Find the RSN or WPA information element in the provided beacon frame.
Definition: sec80211.c:284
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322
String functions.
struct bofm_section_header done
Definition: bofm_test.c:46
uint8_t u8
Definition: stdint.h:20
union @391 key
Sense key.
Definition: scsi.h:18
uint32_t u32
Definition: stdint.h:24
uint16_t sp
Definition: registers.h:27
if(natsemi->flags &NATSEMI_64BIT) return 1
A persistent I/O buffer.
Definition: iobuf.h:38