2 * hostapd / IEEE 802.1X Authenticator
3 * Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 /* draft-congdon-radius-8021x-20.txt */
20 struct ieee802_1x_eapol_key
{
23 u8 replay_counter
[8]; /* does not repeat within the life of the keying
24 * material used to encrypt the Key field;
25 * 64-bit NTP timestamp MAY be used here */
26 u8 key_iv
[16]; /* cryptographically random number */
27 u8 key_index
; /* key flag in the most significant bit:
28 * 0 = broadcast (default key),
29 * 1 = unicast (key mapping key); key index is in the
30 * 7 least significant bits */
31 u8 key_signature
[16]; /* HMAC-MD5 message integrity check computed with
32 * MS-MPPE-Send-Key as the key */
34 /* followed by key: if packet body length = 44 + key length, then the
35 * key field (of key_length bytes) contains the key in encrypted form;
36 * if packet body length = 44, key field is absent and key_length
37 * represents the number of least significant octets from
38 * MS-MPPE-Send-Key attribute to be used as the keying material;
39 * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */
40 } __attribute__ ((packed
));
43 void ieee802_1x_receive(struct hostapd_data
*hapd
, const u8
*sa
, const u8
*buf
,
45 void ieee802_1x_new_station(struct hostapd_data
*hapd
, struct sta_info
*sta
);
46 void ieee802_1x_free_station(struct sta_info
*sta
);
48 void ieee802_1x_request_identity(struct hostapd_data
*hapd
,
49 struct sta_info
*sta
);
50 void ieee802_1x_tx_canned_eap(struct hostapd_data
*hapd
, struct sta_info
*sta
,
52 void ieee802_1x_tx_req(struct hostapd_data
*hapd
, struct sta_info
*sta
);
53 void ieee802_1x_tx_key(struct hostapd_data
*hapd
, struct sta_info
*sta
);
54 void ieee802_1x_send_resp_to_server(struct hostapd_data
*hapd
,
55 struct sta_info
*sta
);
56 void ieee802_1x_abort_auth(struct hostapd_data
*hapd
, struct sta_info
*sta
);
57 void ieee802_1x_set_sta_authorized(struct hostapd_data
*hapd
,
58 struct sta_info
*sta
, int authorized
);
59 void ieee802_1x_dump_state(FILE *f
, const char *prefix
, struct sta_info
*sta
);
60 int ieee802_1x_init(struct hostapd_data
*hapd
);
61 void ieee802_1x_deinit(struct hostapd_data
*hapd
);
62 int ieee802_1x_reconfig(struct hostapd_data
*hapd
,
63 struct hostapd_config
*oldconf
,
64 struct hostapd_bss_config
*oldbss
);
65 int ieee802_1x_tx_status(struct hostapd_data
*hapd
, struct sta_info
*sta
,
66 u8
*buf
, size_t len
, int ack
);
67 u8
* ieee802_1x_get_identity(struct eapol_state_machine
*sm
, size_t *len
);
68 u8
* ieee802_1x_get_radius_class(struct eapol_state_machine
*sm
, size_t *len
,
70 u8
* ieee802_1x_get_key_crypt(struct eapol_state_machine
*sm
, size_t *len
);
71 void ieee802_1x_notify_port_enabled(struct eapol_state_machine
*sm
,
73 void ieee802_1x_notify_port_valid(struct eapol_state_machine
*sm
,
75 void ieee802_1x_notify_pre_auth(struct eapol_state_machine
*sm
, int pre_auth
);
76 int ieee802_1x_get_mib(struct hostapd_data
*hapd
, char *buf
, size_t buflen
);
77 int ieee802_1x_get_mib_sta(struct hostapd_data
*hapd
, struct sta_info
*sta
,
78 char *buf
, size_t buflen
);
79 void hostapd_get_ntp_timestamp(u8
*buf
);
80 void ieee802_1x_finished(struct hostapd_data
*hapd
, struct sta_info
*sta
,
82 char *eap_type_text(u8 type
);
84 struct radius_class_data
;
86 void ieee802_1x_free_radius_class(struct radius_class_data
*class);
87 int ieee802_1x_copy_radius_class(struct radius_class_data
*dst
,
88 struct radius_class_data
*src
);
90 #endif /* IEEE802_1X_H */