📄 eap.doxygen
字号:
/**\page eap_module EAP peer implementationExtensible Authentication Protocol (EAP) is an authentication frameworkdefined in RFC 3748. %wpa_supplicant uses a separate code module for EAPpeer implementation. This module was designed to use only a minimal setof direct function calls (mainly, to debug/event functions) in order forit to be usable in other programs. The design of the EAPimplementation is based loosely on RFC 4137. The state machine isdefined in this RFC and so is the interface between the peer statemachine and methods. As such, this RFC provides useful information forunderstanding the EAP peer implementation in %wpa_supplicant.Some of the terminology used in EAP state machine is referring toEAPOL (IEEE 802.1X), but there is no strict requirement on the lowerlayer being IEEE 802.1X if EAP module is built for other programs than%wpa_supplicant. These terms should be understood to refer to thelower layer as defined in RFC 4137.\section adding_eap_methods Adding EAP methodsEach EAP method is implemented as a separate module, usually as one Cfile named eap_<name of the method>.c, e.g., eap_md5.c. All EAPmethods use the same interface between the peer state machine andmethod specific functions. This allows new EAP methods to be addedwithout modifying the core EAP state machine implementation.New EAP methods need to be registered by adding them into the build(Makefile) and the EAP method registration list in theeap_peer_register_methods() function of eap_methods.c. Each EAPmethod should use a build-time configuration option, e.g., EAP_TLS, inorder to make it possible to select which of the methods are includedin the build.EAP methods must implement the interface defined in eap_i.h. structeap_method defines the needed function pointers that each EAP methodmust provide. In addition, the EAP type and name are registered usingthis structure. This interface is based on section 4.4 of RFC 4137.It is recommended that the EAP methods would use generic helperfunctions, eap_msg_alloc() and eap_hdr_validate() when processingmessages. This allows code sharing and can avoid missing some of theneeded validation steps for received packets. In addition, thesefunctions make it easier to change between expanded and legacy EAPheader, if needed.When adding an EAP method that uses a vendor specific EAP type(Expanded Type as defined in RFC 3748, Chapter 5.7), the new methodmust be registered by passing vendor id instead of EAP_VENDOR_IETF toeap_peer_method_alloc(). These methods must not try to emulateexpanded types by registering a legacy EAP method for type 254. Seeeap_vendor_test.c for an example of an EAP method implementation thatis implemented as an expanded type.\section used_eap_library Using EAP implementation as a libraryThe Git repository has an eap_example directory that contains anexample showing how EAP peer and server code from %wpa_supplicant andhostapd can be used as a library. The example program initializes bothan EAP server and an EAP peer entities and then runs through anEAP-PEAP/MSCHAPv2 authentication.eap_example_peer.c shows the initialization and glue code needed tocontrol the EAP peer implementation. eap_example_server.c does thesame for EAP server. eap_example.c is an example that ties in both theEAP server and client parts to allow an EAP authentication to beshown.In this example, the EAP messages are passed between the server andthe peer are passed by direct function calls within the same process.In practice, server and peer functionalities would likely reside inseparate devices and the EAP messages would be transmitted between thedevices based on an external protocol. For example, in IEEE 802.11uses IEEE 802.1X EAPOL state machines to control the transmission ofEAP messages and WiMax supports optional PMK EAP authenticationmechanism that transmits EAP messages as defined in IEEE 802.16e.The EAP library links in number of helper functions from src/utils andsrc/crypto directories. Most of these are suitable as-is, but it maybe desirable to replace the debug output code in src/utils/wpa_debug.cby dropping this file from the library and re-implementing thefunctions there in a way that better fits in with the mainapplication.*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -