2009-11-28 20:19:48 +01:00
|
|
|
/**
|
|
|
|
\page code_structure Structure of the source code
|
|
|
|
|
2012-04-24 19:37:24 +02:00
|
|
|
[ \ref _wpa_supplicant_core "wpa_supplicant core functionality" |
|
2009-11-28 20:19:48 +01:00
|
|
|
\ref generic_helper_func "Generic helper functions" |
|
|
|
|
\ref crypto_func "Cryptographic functions" |
|
|
|
|
\ref tls_func "TLS library" |
|
|
|
|
\ref configuration "Configuration" |
|
|
|
|
\ref ctrl_iface "Control interface" |
|
|
|
|
\ref wpa_code "WPA supplicant" |
|
|
|
|
\ref eap_peer "EAP peer" |
|
|
|
|
\ref eapol_supp "EAPOL supplicant" |
|
|
|
|
\ref win_port "Windows port" |
|
|
|
|
\ref test_programs "Test programs" ]
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
wpa_supplicant implementation is divided into number of independent
|
2009-11-28 20:19:48 +01:00
|
|
|
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
|
2015-01-03 14:44:35 +01:00
|
|
|
programs than wpa_supplicant. As an example, the included test
|
2009-11-28 20:19:48 +01:00
|
|
|
programs eapol_test and preauth_test are using these modules.
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref driver_wrapper "Driver interface API" is defined in \ref driver.h and
|
2009-11-28 20:19:48 +01:00
|
|
|
all hardware/driver dependent functionality is implemented in
|
|
|
|
driver_*.c.
|
|
|
|
|
|
|
|
|
2012-04-24 19:37:24 +02:00
|
|
|
\section _wpa_supplicant_core wpa_supplicant core functionality
|
2009-11-28 20:19:48 +01:00
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_supplicant.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Program initialization, main control loop
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_supplicant/main.c
|
2009-11-28 20:19:48 +01:00
|
|
|
main() for UNIX-like operating systems and MinGW (Windows); this
|
|
|
|
uses command line arguments to configure wpa_supplicant
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref events.c
|
|
|
|
Driver event processing; \ref wpa_supplicant_event() and related functions
|
2009-11-28 20:19:48 +01:00
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_supplicant_i.h
|
|
|
|
Internal definitions for wpa_supplicant core; should not be
|
2009-11-28 20:19:48 +01:00
|
|
|
included into independent modules
|
|
|
|
|
|
|
|
|
|
|
|
\section generic_helper_func Generic helper functions
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
wpa_supplicant uses generic helper functions some of which are shared
|
2009-11-28 20:19:48 +01:00
|
|
|
with with hostapd. The following C files are currently used:
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eloop.c and \ref eloop.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Event loop (select() loop with registerable timeouts, socket read
|
|
|
|
callbacks, and signal callbacks)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref common.c and \ref common.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Common helper functions
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref defs.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Definitions shared by multiple files
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref l2_packet.h, \ref l2_packet_linux.c, and \ref l2_packet_pcap.c
|
2009-11-28 20:19:48 +01:00
|
|
|
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
|
2015-01-03 14:44:35 +01:00
|
|
|
l2_packet implementation is included. \ref l2_packet_linux.c uses Linux
|
|
|
|
packet sockets and \ref l2_packet_pcap.c has a more portable version using
|
2009-11-28 20:19:48 +01:00
|
|
|
libpcap and libdnet.
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref pcsc_funcs.c and \ref pcsc_funcs.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Wrapper for PC/SC lite SIM and smart card readers
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref priv_netlink.h
|
2009-11-28 20:19:48 +01:00
|
|
|
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
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref version.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Version number definitions
|
|
|
|
|
|
|
|
|
|
|
|
\section crypto_func Cryptographic functions
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref md5.c and \ref md5.h
|
2009-11-28 20:19:48 +01:00
|
|
|
MD5 (replaced with a crypto library if TLS support is included)
|
|
|
|
HMAC-MD5 (keyed checksum for message authenticity validation)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref rc4.c and \ref rc4.h
|
2009-11-28 20:19:48 +01:00
|
|
|
RC4 (broadcast/default key encryption)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref sha1.c and \ref sha1.h
|
2009-11-28 20:19:48 +01:00
|
|
|
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)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref sha256.c and \ref sha256.h
|
2009-11-28 20:19:48 +01:00
|
|
|
SHA-256 (replaced with a crypto library if TLS support is included)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref aes-wrap.c, \ref aes_wrap.h, \ref aes.c
|
2009-11-28 20:19:48 +01:00
|
|
|
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
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref crypto.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Definition of crypto library wrapper
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref crypto_openssl.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Wrapper functions for libcrypto (OpenSSL)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref crypto_internal.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Wrapper functions for internal crypto implementation
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref crypto_gnutls.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Wrapper functions for libgcrypt (used by GnuTLS)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref ms_funcs.c and \ref ms_funcs.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Helper functions for MSCHAPV2 and LEAP
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tls.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Definition of TLS library wrapper
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tls_none.c
|
2021-09-19 08:24:29 +02:00
|
|
|
Stub implementation of TLS library wrapper for cases where TLS
|
2009-11-28 20:19:48 +01:00
|
|
|
functionality is not included.
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tls_openssl.c
|
2009-11-28 20:19:48 +01:00
|
|
|
TLS library wrapper for openssl
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tls_internal.c
|
2009-11-28 20:19:48 +01:00
|
|
|
TLS library for internal TLS implementation
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tls_gnutls.c
|
2009-11-28 20:19:48 +01:00
|
|
|
TLS library wrapper for GnuTLS
|
|
|
|
|
|
|
|
|
|
|
|
\section tls_func TLS library
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref asn1.c and \ref asn1.h
|
2009-11-28 20:19:48 +01:00
|
|
|
ASN.1 DER parsing
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref bignum.c and \ref bignum.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Big number math
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref rsa.c and \ref rsa.h
|
2009-11-28 20:19:48 +01:00
|
|
|
RSA
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref x509v3.c and \ref x509v3.h
|
2009-11-28 20:19:48 +01:00
|
|
|
X.509v3 certificate parsing and processing
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tlsv1_client.c, \ref tlsv1_client.h
|
2009-11-28 20:19:48 +01:00
|
|
|
TLSv1 client (RFC 2246)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tlsv1_client_i.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Internal structures for TLSv1 client
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tlsv1_client_read.c
|
2009-11-28 20:19:48 +01:00
|
|
|
TLSv1 client: read handshake messages
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tlsv1_client_write.c
|
2009-11-28 20:19:48 +01:00
|
|
|
TLSv1 client: write handshake messages
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tlsv1_common.c and \ref tlsv1_common.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Common TLSv1 routines and definitions
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tlsv1_cred.c and \ref tlsv1_cred.h
|
2009-11-28 20:19:48 +01:00
|
|
|
TLSv1 credentials
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref tlsv1_record.c and \ref tlsv1_record.h
|
2009-11-28 20:19:48 +01:00
|
|
|
TLSv1 record protocol
|
|
|
|
|
|
|
|
|
|
|
|
\section configuration Configuration
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref config_ssid.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Definition of per network configuration items
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref config.h
|
|
|
|
Definition of the wpa_supplicant configuration
|
2009-11-28 20:19:48 +01:00
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref config.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Configuration parser and common functions
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_supplicant/config_file.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Configuration backend for text files (e.g., wpa_supplicant.conf)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref config_winreg.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Configuration backend for Windows registry
|
|
|
|
|
|
|
|
|
|
|
|
\section ctrl_iface Control interface
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
wpa_supplicant has a \ref ctrl_iface_page "control interface"
|
2009-11-28 20:19:48 +01:00
|
|
|
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
|
2015-01-03 14:44:35 +01:00
|
|
|
are included in the wpa_supplicant distribution.
|
2009-11-28 20:19:48 +01:00
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_supplicant/ctrl_iface.c and \ref wpa_supplicant/ctrl_iface.h
|
|
|
|
wpa_supplicant-side of the control interface
|
2009-11-28 20:19:48 +01:00
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref ctrl_iface_unix.c
|
2009-11-28 20:19:48 +01:00
|
|
|
UNIX domain sockets -based control interface backend
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref ctrl_iface_udp.c
|
2009-11-28 20:19:48 +01:00
|
|
|
UDP sockets -based control interface backend
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref ctrl_iface_named_pipe.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Windows named pipes -based control interface backend
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_ctrl.c and \ref wpa_ctrl.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Library functions for external programs to provide access to the
|
2015-01-03 14:44:35 +01:00
|
|
|
wpa_supplicant control interface
|
2009-11-28 20:19:48 +01:00
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_cli.c
|
|
|
|
Example program for using wpa_supplicant control interface
|
2009-11-28 20:19:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
\section wpa_code WPA supplicant
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa.c and \ref wpa.h
|
2009-11-28 20:19:48 +01:00
|
|
|
WPA state machine and 4-Way/Group Key Handshake processing
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref preauth.c and \ref preauth.h
|
2009-11-28 20:19:48 +01:00
|
|
|
PMKSA caching and pre-authentication (RSN/WPA2)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_i.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Internal definitions for WPA code; not to be included to other modules.
|
|
|
|
|
|
|
|
\section eap_peer EAP peer
|
|
|
|
|
2009-11-28 20:28:53 +01:00
|
|
|
\ref eap_peer_module "EAP peer implementation" is a separate module that
|
2015-01-03 14:44:35 +01:00
|
|
|
can be used by other programs than just wpa_supplicant.
|
2009-11-28 20:19:48 +01:00
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap.c and \ref eap.h
|
2009-11-28 20:19:48 +01:00
|
|
|
EAP state machine and method interface
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_defs.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Common EAP definitions
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_i.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Internal definitions for EAP state machine and EAP methods; not to be
|
|
|
|
included in other modules
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_sim_common.c and \ref eap_sim_common.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Common code for EAP-SIM and EAP-AKA
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_tls_common.c and \ref eap_tls_common.h
|
2009-11-28 20:19:48 +01:00
|
|
|
Common code for EAP-PEAP, EAP-TTLS, and EAP-FAST
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_ttls.c and \ref eap_ttls.h
|
2009-11-28 20:19:48 +01:00
|
|
|
EAP-TTLS
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_pax.c, \ref eap_pax_common.h, \ref eap_pax_common.c
|
2009-11-28 20:19:48 +01:00
|
|
|
EAP-PAX
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_psk.c, \ref eap_psk_common.h, \ref eap_psk_common.c
|
2009-11-28 20:19:48 +01:00
|
|
|
EAP-PSK (note: this is not needed for WPA-PSK)
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_sake.c, \ref eap_sake_common.h, \ref eap_sake_common.c
|
2009-11-28 20:19:48 +01:00
|
|
|
EAP-SAKE
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_gpsk.c, \ref eap_gpsk_common.h, \ref eap_gpsk_common.c
|
2009-11-28 20:19:48 +01:00
|
|
|
EAP-GPSK
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eap_aka.c, \ref eap_fast.c, \ref eap_gtc.c, \ref eap_leap.c,
|
|
|
|
\ref eap_md5.c, \ref eap_mschapv2.c, \ref eap_otp.c, \ref eap_peap.c,
|
|
|
|
\ref eap_sim.c, \ref eap_tls.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Other EAP method implementations
|
|
|
|
|
|
|
|
|
|
|
|
\section eapol_supp EAPOL supplicant
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eapol_supp_sm.c and \ref eapol_supp_sm.h
|
2009-11-28 20:19:48 +01:00
|
|
|
EAPOL supplicant state machine and IEEE 802.1X processing
|
|
|
|
|
|
|
|
|
|
|
|
\section win_port Windows port
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref ndis_events.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Code for receiving NdisMIndicateStatus() events and delivering them to
|
2015-01-03 14:44:35 +01:00
|
|
|
wpa_supplicant \ref driver_ndis.c in more easier to use form
|
2009-11-28 20:19:48 +01:00
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref win_if_list.c
|
2009-11-28 20:19:48 +01:00
|
|
|
External program for listing current network interface
|
|
|
|
|
|
|
|
|
|
|
|
\section test_programs Test programs
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref radius_client.c and \ref radius_client.h
|
2009-11-28 20:19:48 +01:00
|
|
|
RADIUS authentication client implementation for eapol_test
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref radius.c and \ref radius.h
|
2009-11-28 20:19:48 +01:00
|
|
|
RADIUS message processing for eapol_test
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref eapol_test.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Standalone EAP testing tool with integrated RADIUS authentication
|
|
|
|
client
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref preauth_test.c
|
2009-11-28 20:19:48 +01:00
|
|
|
Standalone RSN pre-authentication tool
|
|
|
|
|
2015-01-03 14:44:35 +01:00
|
|
|
\ref wpa_passphrase.c
|
2009-11-28 20:19:48 +01:00
|
|
|
WPA ASCII passphrase to PSK conversion
|
|
|
|
|
|
|
|
*/
|