wpa_supplicant / hostapd 2.5
[ wpa_supplicant core functionality | Generic helper functions | Cryptographic functions | TLS library | Configuration | Control interface | WPA supplicant | EAP peer | EAPOL supplicant | Windows port | Test programs ]
wpa_supplicant implementation is divided into number of independent modules. Core code includes functionality for controlling the network selection, association, and configuration. Independent modules include WPA code (key handshake, PMKSA caching, pre-authentication), EAPOL state machine, and EAP state machine and methods. In addition, there are number of separate files for generic helper functions.
Both WPA and EAPOL/EAP state machines can be used separately in other programs than wpa_supplicant. As an example, the included test programs eapol_test and preauth_test are using these modules.
wpa_supplicant.c Program initialization, main control loop
wpa_supplicant/main.c main() for UNIX-like operating systems and MinGW (Windows); this uses command line arguments to configure wpa_supplicant
wpa_supplicant_i.h Internal definitions for wpa_supplicant core; should not be included into independent modules
wpa_supplicant uses generic helper functions some of which are shared with with hostapd. The following C files are currently used:
defs.h Definitions shared by multiple files
l2_packet.h, l2_packet_linux.c, and l2_packet_pcap.c Layer 2 (link) access wrapper (includes native Linux implementation and wrappers for libdnet/libpcap). A new l2_packet implementation may need to be added when porting to new operating systems that are not supported by libdnet/libpcap. Makefile can be used to select which l2_packet implementation is included. l2_packet_linux.c uses Linux packet sockets and l2_packet_pcap.c has a more portable version using libpcap and libdnet.
priv_netlink.h Private version of netlink definitions from Linux kernel header files; this could be replaced with C library header file once suitable version becomes commonly available
version.h Version number definitions
rc4.c and rc4.h RC4 (broadcast/default key encryption)
sha1.c and sha1.h SHA-1 (replaced with a crypto library if TLS support is included) 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) T-PRF (for EAP-FAST) TLS-PRF (RFC 2246)
aes-wrap.c, aes_wrap.h, aes.c AES (replaced with a crypto library if TLS support is included), AES Key Wrap Algorithm with 128-bit KEK, RFC3394 (broadcast/default key encryption), One-Key CBC MAC (OMAC1) hash with AES-128, AES-128 CTR mode encryption, AES-128 EAX mode encryption/decryption, AES-128 CBC
crypto.h Definition of crypto library wrapper
crypto_openssl.c Wrapper functions for libcrypto (OpenSSL)
crypto_internal.c Wrapper functions for internal crypto implementation
crypto_gnutls.c Wrapper functions for libgcrypt (used by GnuTLS)
tls.h Definition of TLS library wrapper
tls_none.c Dummy implementation of TLS library wrapper for cases where TLS functionality is not included.
tls_openssl.c TLS library wrapper for openssl
tls_internal.c TLS library for internal TLS implementation
tls_gnutls.c TLS library wrapper for GnuTLS
tlsv1_client_i.h Internal structures for TLSv1 client
tlsv1_client_read.c TLSv1 client: read handshake messages
tlsv1_client_write.c TLSv1 client: write handshake messages
config_ssid.h Definition of per network configuration items
config.h Definition of the wpa_supplicant configuration
config.c Configuration parser and common functions
wpa_supplicant/config_file.c Configuration backend for text files (e.g., wpa_supplicant.conf)
config_winreg.c Configuration backend for Windows registry
wpa_supplicant has a control interface that can be used to get status information and manage operations from external programs. An example command line interface (wpa_cli) and GUI (wpa_gui) for this interface are included in the wpa_supplicant distribution.
ctrl_iface_unix.c UNIX domain sockets -based control interface backend
ctrl_iface_udp.c UDP sockets -based control interface backend
ctrl_iface_named_pipe.c Windows named pipes -based control interface backend
wpa_cli.c Example program for using wpa_supplicant control interface
wpa_i.h Internal definitions for WPA code; not to be included to other modules.
EAP peer implementation is a separate module that can be used by other programs than just wpa_supplicant.
eap_defs.h Common EAP definitions
eap_i.h Internal definitions for EAP state machine and EAP methods; not to be included in other modules
win_if_list.c External program for listing current network interface
eapol_test.c Standalone EAP testing tool with integrated RADIUS authentication client
preauth_test.c Standalone RSN pre-authentication tool
wpa_passphrase.c WPA ASCII passphrase to PSK conversion