| 1 |
|
| 2 |
|
| 3 |
Extensible Authentication Protocol (EAP) |
| 4 |
|
| 5 |
|
| 6 |
INTRODUCTION |
| 7 |
|
| 8 |
Extensible Authentication Protocol(EAP), rfc2284, is a general protocol |
| 9 |
that allows network access points to support multiple authentication |
| 10 |
methods. Each EAP-Type indicates a specific authentication mechanism. |
| 11 |
802.1x standard authenticates wireless LAN users trying to access |
| 12 |
enterprise networks. |
| 13 |
|
| 14 |
RADIUS attribute used for EAP is EAP-Message, 79(rfc2869). RADIUS |
| 15 |
communicates all EAP messages by embedding them in this attribute. |
| 16 |
|
| 17 |
General Terminology |
| 18 |
Supplicant/EAP Client - is the software on the end-user/client machine |
| 19 |
(machine with the wireless card). |
| 20 |
Authenticator/NAS/Access Point(AP) - A network device providing users |
| 21 |
with a point of entry into the network. |
| 22 |
EAPOL - EAP over LAN as defined in 802.1x standard. |
| 23 |
EAPOW - EAP over Wireless. |
| 24 |
|
| 25 |
|
| 26 |
+----------+ +----------+ +----------+ |
| 27 |
| | EAPOL | | RADIUS | | |
| 28 |
| EAP |<------>| Access |<------>| RADIUS | |
| 29 |
| Client | EAPOW | Point | (EAP) | Server | |
| 30 |
| | | | | | |
| 31 |
+----------+ +----------+ +----------+ |
| 32 |
|
| 33 |
|
| 34 |
The sequence of events, for EAP-MD5, runs as follows: |
| 35 |
1. The end-user associates with the Access Point(AP). |
| 36 |
2. The supplicant specifies AP to use EAP by sending EAP-Start. |
| 37 |
3. AP requests the supplicant to Identify itself (EAP-Identity). |
| 38 |
4. Supplicant then sends its Identity (username) to the AP. |
| 39 |
5. AP forwards this EAP-response AS-IS to the RADIUS server. |
| 40 |
(The supplicant and the RADIUS server mutually authenticate via AP. |
| 41 |
AP just acts as a passthru till authentication is finished.) |
| 42 |
6. The server sends a challenge to the supplicant. |
| 43 |
7. The supplicant carries out a hash on the password and sends |
| 44 |
this hashed password to the RADIUS server as its response. |
| 45 |
8. The RADIUS server performs a hash on the password for that supplicant |
| 46 |
in its user database and compares the two hashed values and |
| 47 |
authenticates the client if the two values match(EAP-Success/EAP-Failure) |
| 48 |
9. AP now opens a port to accept data from the end-user. |
| 49 |
|
| 50 |
Currently, EAP is widely used in wireless networks than in wired networks. |
| 51 |
In 802.11/wireless based networking, following sequence of events happen in |
| 52 |
addition to the above EAP events. |
| 53 |
|
| 54 |
10. RADIUS server and the supplicant agree to a specific WEP key. |
| 55 |
11. The supplicant loads the key ready for logging on. |
| 56 |
12. The RADIUS server sends the key for this session (Session key) to the AP. |
| 57 |
13. The AP encrypts its Broadcast key with the Session key |
| 58 |
14. The AP sends the encypted key to the supplicant |
| 59 |
15. The supplicant decrypts the Broadcast key with the Session key and |
| 60 |
the session continues using the Broadcast and Session keys until |
| 61 |
the session ends. |
| 62 |
|
| 63 |
References: |
| 64 |
The Implementation of EAP over RADIUS is based on the following RFCs |
| 65 |
rfc2869 -- RADIUS Extensions |
| 66 |
rfc2284 -- PPP Extensible Authentication Protocol (EAP) |
| 67 |
rfc2716 -- PPP EAP TLS Authentication Protocol |
| 68 |
|
| 69 |
Following links help to understand HOW EAP works |
| 70 |
www.ieee802.org/1/mirror/8021/docs2000/ieee_plenary.PDF |
| 71 |
|
| 72 |
|
| 73 |
EAP CODE ORGANIZATION |
| 74 |
|
| 75 |
EAP is implemented as a module in freeradius |
| 76 |
and the code is placed in src/modules/rlm_eap. |
| 77 |
All EAP-Types are organized as subdirectories in rlm_eap/types/. |
| 78 |
|
| 79 |
Each EAP-Type, like types/rlm_eap_md5, contains a chunk of code that |
| 80 |
knows how to deal with a particular kind of authentication mechanism. |
| 81 |
|
| 82 |
To add a new EAP-Type then a new directory should be created as |
| 83 |
rlm_eap/types/rlm_eap_XXXX, where XXXX is EAP-Type name |
| 84 |
ie for EAP-Type like ONE TIME PASSWORD (OTP) it would be rlm_eap_otp |
| 85 |
|
| 86 |
src/modules/rlm_eap -- contains the basic EAP and generalized interfaces |
| 87 |
to all the EAP-Types. |
| 88 |
rlm_eap/types -- contains all the supported EAP-Types |
| 89 |
rlm_eap/types/rlm_eap_md5 -- EAP-MD5 authentication. |
| 90 |
rlm_eap/types/rlm_eap_tls -- EAP-TLS based authentication. |
| 91 |
rlm_eap/types/rlm_eap_ttls -- TTLS based authentication. |
| 92 |
rlm_eap/types/rlm_eap_peap -- Windows PEAP based authentication. |
| 93 |
rlm_eap/types/rlm_eap_sim -- EAP-SIM (GSM) based authentication |
| 94 |
|
| 95 |
CONFIGURATION |
| 96 |
|
| 97 |
Add the eap configuration stanza to the modules section in radiusd.conf |
| 98 |
to load and control rlm_eap and all the supported EAP-Types: |
| 99 |
|
| 100 |
For example: |
| 101 |
modules { |
| 102 |
... |
| 103 |
eap { |
| 104 |
default_eap_type = md5 |
| 105 |
|
| 106 |
md5 { |
| 107 |
} |
| 108 |
... |
| 109 |
} |
| 110 |
... |
| 111 |
} |
| 112 |
|
| 113 |
NOTE: You cannot have empty eap stanza. At least one EAP-Type sub-stanza |
| 114 |
should be defined as above, otherwise the server will not know what type |
| 115 |
of eap authentication mechanism to be used and the server will exit |
| 116 |
with error. |
| 117 |
|
| 118 |
All the various options and their associated default values for each |
| 119 |
EAP-Type are documented in the sample radiusd.conf that is provided |
| 120 |
with the distribution. |
| 121 |
|
| 122 |
Since the EAP requests may not contain a requested EAP type, the |
| 123 |
'default_eap_type' configuration options is used by the EAP module |
| 124 |
to determine which EAP type to choose for authentication. |
| 125 |
|
| 126 |
NOTE: EAP cannot authorize a user. It can only authenticate. |
| 127 |
Other Freeradius modules authorize the user. |
| 128 |
|
| 129 |
|
| 130 |
EAP SIM server |
| 131 |
|
| 132 |
To configure EAP-SIM authentication, the following attributes must be |
| 133 |
set in the server. This can be done in the users file, but in many cases |
| 134 |
will be taken from a database server, via one of the SQL interface. |
| 135 |
|
| 136 |
If one has SIM cards that one controls (i.e. whose share secret you know), |
| 137 |
one should be able to write a module to generate these attributes |
| 138 |
(the triplets) in the server. |
| 139 |
|
| 140 |
If one has access to the SS7 based settlement network, then a module to |
| 141 |
fetch appropriate triplets could be written. This module would act as |
| 142 |
an authorization only module. |
| 143 |
|
| 144 |
The attributes are: |
| 145 |
EAP-Sim-Rand1 16 bytes |
| 146 |
EAP-Sim-SRES1 4 bytes |
| 147 |
EAP-Sim-KC1 8 bytes |
| 148 |
EAP-Sim-Rand2 16 bytes |
| 149 |
EAP-Sim-SRES2 4 bytes |
| 150 |
EAP-Sim-KC2 8 bytes |
| 151 |
EAP-Sim-Rand3 16 bytes |
| 152 |
EAP-Sim-SRES3 4 bytes |
| 153 |
EAP-Sim-KC3 8 bytes |
| 154 |
|
| 155 |
EAP-SIM will send WEP attributes to the resquestor. |
| 156 |
|
| 157 |
EAP CLIENTS |
| 158 |
|
| 159 |
1. eapol_test, from wpa_supplicant. |
| 160 |
|
| 161 |
2. Freeradius has an "radeapclient" that can do EAP-MD5 (passwords), |
| 162 |
as well as EAP-SIM. It is in modules/rlm_eap/radeapclient. |
| 163 |
|
| 164 |
TESTING |
| 165 |
|
| 166 |
You will find several test cases in src/tests/ for the EAP-SIM code. |
| 167 |
|
| 168 |
|
| 169 |
HOW DO I USE IT (FAQ/Examples) |
| 170 |
|
| 171 |
1. How can I enable EAP-MD5 authentication ? |
| 172 |
|
| 173 |
In radiusd.conf |
| 174 |
|
| 175 |
modules { |
| 176 |
... |
| 177 |
eap { |
| 178 |
default_eap_type = md5 |
| 179 |
md5 { |
| 180 |
} |
| 181 |
... |
| 182 |
} |
| 183 |
... |
| 184 |
} |
| 185 |
|
| 186 |
# eap sets the authenticate type as EAP |
| 187 |
authorize { |
| 188 |
... |
| 189 |
eap |
| 190 |
} |
| 191 |
|
| 192 |
# eap authentication takes place. |
| 193 |
authenticate { |
| 194 |
eap |
| 195 |
} |
| 196 |
|
| 197 |
2. My Userbase is in LDAP and I want to use EAP-MD5 authentication |
| 198 |
|
| 199 |
In radiusd.conf |
| 200 |
|
| 201 |
modules { |
| 202 |
... |
| 203 |
eap { |
| 204 |
default_eap_type = md5 |
| 205 |
md5 { |
| 206 |
} |
| 207 |
... |
| 208 |
} |
| 209 |
... |
| 210 |
} |
| 211 |
|
| 212 |
# ldap gets the Configured password. |
| 213 |
# eap sets the authenticate type as EAP |
| 214 |
authorize { |
| 215 |
... |
| 216 |
ldap |
| 217 |
eap |
| 218 |
... |
| 219 |
} |
| 220 |
|
| 221 |
# eap authentication takes place. |
| 222 |
authenticate { |
| 223 |
... |
| 224 |
eap |
| 225 |
... |
| 226 |
} |
| 227 |
|
| 228 |
3. How can I Proxy EAP messages, with/without User-Name attribute |
| 229 |
in the Access-Request packets |
| 230 |
|
| 231 |
With User-Name attribute in Access-Request packet, |
| 232 |
EAP-proxying is just same as RADIUS-proxying. |
| 233 |
|
| 234 |
If User-Name attribute is not present in Access-Request packet, |
| 235 |
Freeradius can proxy the request with the following configuration |
| 236 |
in radiusd.conf |
| 237 |
|
| 238 |
# eap module should be configured as the First module in |
| 239 |
# the authorize stanza |
| 240 |
|
| 241 |
authorize { |
| 242 |
eap |
| 243 |
... other modules. |
| 244 |
} |
| 245 |
|
| 246 |
With this configuration, eap_authorize creates User-Name attribute |
| 247 |
from EAP-Identity response, if it is not present. |
| 248 |
Once User-Name attribute is created, RADIUS proxying takes care |
| 249 |
of EAP proxying. |
| 250 |
|
| 251 |
4. How Freeradius can handle EAP-START messages ? |
| 252 |
|
| 253 |
In most of the cases this is handled by the Authenticator. |
| 254 |
|
| 255 |
Only if it is required then, in radiusd.conf |
| 256 |
|
| 257 |
authorize { |
| 258 |
eap |
| 259 |
... other modules. |
| 260 |
} |
| 261 |
|
| 262 |
With the above configuration, RADIUS server immediately responds with |
| 263 |
EAP-Identity request. |
| 264 |
|
| 265 |
NOTE: EAP does not check for any Identity or maintains any state in case |
| 266 |
of EAP-START. It blindly responds with EAP-Identity request. |
| 267 |
Proxying is handled only after EAP-Identity response is received. |
| 268 |
|
| 269 |
5. I want to enable multiple EAP-Types, how can I configure ? |
| 270 |
|
| 271 |
In radiusd.conf |
| 272 |
|
| 273 |
modules { |
| 274 |
... |
| 275 |
eap { |
| 276 |
default_eap_type = tls |
| 277 |
md5 { |
| 278 |
} |
| 279 |
tls { |
| 280 |
... |
| 281 |
} |
| 282 |
... |
| 283 |
} |
| 284 |
... |
| 285 |
} |
| 286 |
|
| 287 |
The above configuration will let the server load all the EAP-Types, |
| 288 |
but the server can have only one default EAP-Type, as above. |
| 289 |
|
| 290 |
Once EAP-Identity response is received by the server, based on the |
| 291 |
default_eap_type, the server will send a new request (MD5-Challenge |
| 292 |
request incase of md5, TLS-START request incase of tls) to the supplicant. |
| 293 |
If the supplicant is rfc2284 compliant and does not support the |
| 294 |
EAP-Type sent by the server then it sends EAP-Acknowledge with the |
| 295 |
supported EAP-Type. If this EAP-Type is supported by the server then it |
| 296 |
will send the respective EAP-request. |
| 297 |
|
| 298 |
Example: If the supplicant supports only EAP-MD5 but the server |
| 299 |
default_eap_type is configured as EAP-TLS, as above, then the server |
| 300 |
will send TLS-START after EAP-Identity is received. Supplicant will |
| 301 |
respond with EAP-Acknowledge(EAP-MD5). Server now responds with |
| 302 |
MD5-Challenge. |
| 303 |
|
| 304 |
|
| 305 |
INSTALLATION |
| 306 |
EAP, EAP-MD5, and EAP-MSCHAPv2 do not require any additional packages. |
| 307 |
Freeradius contains all the required packages. |
| 308 |
|
| 309 |
For EAP-TLS, EAP-TTLS, and PEAP, OPENSSL, <http://www.openssl.org/>, |
| 310 |
is required to be installed. |
| 311 |
Any version from 0.9.7, should fairly work with this module. |
| 312 |
|
| 313 |
EAP-SIM should not require any additional packages. |
| 314 |
|
| 315 |
|
| 316 |
IMPLEMENTATION (For Developers) |
| 317 |
|
| 318 |
The rlm_eap module only deals with EAP specific authentication mechanism |
| 319 |
and the generic interface to interact with all the EAP-Types. |
| 320 |
|
| 321 |
Currently, these are the existing interfaces, |
| 322 |
int attach(CONF_SECTION *conf, void **type_arg); |
| 323 |
int initiate(void *type_arg, EAP_HANDLER *handler); |
| 324 |
int authenticate(void *type_arg, EAP_HANDLER *handler); |
| 325 |
int detach(void **type_arg); |
| 326 |
|
| 327 |
attach() and detach() functions allocate and deallocate all the |
| 328 |
required resources. |
| 329 |
|
| 330 |
initiate() function begins the conversation when EAP-Identity response |
| 331 |
is received. Incase of EAP-MD5, initiate() function sends the challenge. |
| 332 |
|
| 333 |
authenticate() function uses specific EAP-Type authentication mechanism |
| 334 |
to authenticate the user. During authentication many EAP-Requests and |
| 335 |
EAP-Responses takes place for each authentication. Hence authenticate() |
| 336 |
function may be called many times. EAP_HANDLER contains the complete |
| 337 |
state information required. |
| 338 |
|
| 339 |
|
| 340 |
HOW EAP WORKS |
| 341 |
as posted to the list, by John Lindsay <[email protected]> |
| 342 |
|
| 343 |
To make it clear for everyone, the supplicant is the software on the |
| 344 |
client (machine with the wireless card). |
| 345 |
|
| 346 |
The EAP process doesn't start until the client has associated with |
| 347 |
the Access Point using Open authentication. If this process isn't |
| 348 |
crystal clear you need to go away and gain understanding. |
| 349 |
|
| 350 |
Once the association is made the AP blocks all traffic that is not |
| 351 |
802.1x so although associated the connection only has value for EAP. |
| 352 |
Any EAP traffic is passed to the radius server and any radius traffic |
| 353 |
is passed back to the client. |
| 354 |
|
| 355 |
So, after the client has associated to the Access Point, the |
| 356 |
supplicant starts the process for using EAP over LAN by asking the |
| 357 |
user for their logon and password. |
| 358 |
|
| 359 |
Using 802.1x and EAP the supplicant sends the username and a one-way |
| 360 |
hash of the password to the AP. |
| 361 |
|
| 362 |
The AP encapsulates the request and sends it to the RADIUS server. |
| 363 |
|
| 364 |
The radius server needs a plaintext password so that it can perform |
| 365 |
the same one-way hash to determine that the password is correct. If |
| 366 |
it is, the radius server issues an access challenge which goes back |
| 367 |
via to the AP to the client. (my study guide says client but my |
| 368 |
brain says 'supplicant') |
| 369 |
|
| 370 |
The client sends the EAP response to the challenge via the AP to the |
| 371 |
RADIUS server. |
| 372 |
|
| 373 |
If the response is valid the RADIUS server sends a success message |
| 374 |
and the session WEP key (EAP over wireless) to the client via the |
| 375 |
AP. The same session WEP key is also sent to the AP in the success |
| 376 |
packet. |
| 377 |
|
| 378 |
The client and the AP then begin using session WEP keys. The WEP key |
| 379 |
used for multicasts is then sent from the AP to the client. It is |
| 380 |
encrypted using the session WEP key. |
| 381 |
|
| 382 |
ACKNOWLEDGEMENTS |
| 383 |
Primary author - Raghu <[email protected]> |
| 384 |
|
| 385 |
EAP-SIM - Michael Richardson <[email protected]> |
| 386 |
The development of the EAP/SIM support was funded by |
| 387 |
Internet Foundation Austria (http://www.nic.at/ipa). |
| 388 |
|
| 389 |
|