Beruflich Dokumente
Kultur Dokumente
==================================
The design goal for wpa_supplicant was to use hardware, driver, and OS
independent, portable C code for all WPA functionality. Current
implementation supports only Linux with Host AP driver for
Prism2/2.5/3, but contributions to add support for other drivers and
operating systems are welcome.
The goal of this file and the comments in the header files is to give
enough information for other developers to be able to port the example
code. If any information is missing, feel free to contact Jouni Malinen
<jkmaline@cc.hut.fi> for more information. Contributions as patch files
are also very welcome at the same address.
Structure of the source code
---------------------------Main WPA Supplicant implementation is in wpa_supplicant.c. This file
includes definitions of internal data structures, WPA IE processing,
Supplicant state machine, EAPOL-Key processing, libpcap (receive
EAPOL-Key) and libdnet (send EAPOL-Key) initialization and processing,
driver event processing, interface with Xsupplicant.
Parser for the configuration file is implemented in config.c.
All hardware/driver dependent functionality is implemented in driver*.c
(see below).
wpa_supplicant uses generic helper functions and cryptographic
functions some of which are shared with with hostapd. The following C
files are currently used:
eloop.c
event loop (select() loop with registrable timeouts, socket read
callbacks, and signal callbacks)
common.c
common helper functions
md5.c
HMAC-MD5 (keyed checksum for message authenticity validation)
rc4.c
RC4 (broadcast/default key encryption)
sha1.c
HMAC-SHA-1 (keyed checksum for message authenticity validation)
PRF-SHA-1 (pseudorandom (key/nonce generation) function)
PBKDF2-SHA-1 (ASCII passphrase to shared secret)
aes_wrap.c (and aes.c)
AES Key Wrap Algorithm with 128-bit KEK, RFC3394 (broadcast/default
key encryption)
wpa_supplicant.c
---------------main()
- parse command line
- call config file parser
- initialize Supplicant data structures
- call functions to initialize WPA support in the driver
- initialize event loop
WPA IE generation
wpa_supplicant selects which cipher suites and key management suites
are used. Based on this information, it generates a WPA IE. This is
provided to the driver interface in the associate call. This does not
match with Windows NDIS drivers which generate the WPA IE
themselves.
wpa_supplicant allows Windows NDIS-like behavior by providing the
selected cipher and key management suites in the associate call. If
the driver generates its own WPA IE and that differs from the one
generated by wpa_supplicant, the driver has to inform wpa_supplicant
about the used WPA IE (i.e., the one it used in (Re)Associate
Request). This notification is done using EVENT_ASSOCINFO event (see
wpa_supplicant.h).
Driver events
wpa_supplicant needs to receive event callbacks when certain events
occur (association, disassociation, Michael MIC failure, scan results
available). These events and the callback details are defined in
wpa_supplicant.h.
On Linux, association and disassociation can use existing Wireless
Extensions event that is reporting new AP with SIOCGIWAP
event. Similarly, completion of scan can be reported with SIOCGIWSCAN
event.
Michael MIC failure event is not yet included in Wireless Extensions,
so this needs a custom event. Host AP driver uses custom event with
following contents: MLME-MICHAELMICFAILURE.indication(keyid=#
broadcast/unicast addr=addr2). This is the recommended format until
the event is added to Linux Wireless Extensions.