2 * RADIUS authentication server
3 * Copyright (c) 2005-2009, 2011, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
9 #ifndef RADIUS_SERVER_H
10 #define RADIUS_SERVER_H
12 struct radius_server_data;
16 * struct radius_server_conf - RADIUS server configuration
18 struct radius_server_conf {
20 * auth_port - UDP port to listen to as an authentication server
25 * acct_port - UDP port to listen to as an accounting server
30 * client_file - RADIUS client configuration file
32 * This file contains the RADIUS clients and the shared secret to be
33 * used with them in a format where each client is on its own line. The
34 * first item on the line is the IPv4 or IPv6 address of the client
35 * with an optional address mask to allow full network to be specified
36 * (e.g., 192.168.1.2 or 192.168.1.0/24). This is followed by white
37 * space (space or tabulator) and the shared secret. Lines starting
38 * with '#' are skipped and can be used as comments.
43 * sqlite_file - SQLite database for storing debug log information
45 const char *sqlite_file;
48 * conf_ctx - Context pointer for callbacks
50 * This is used as the ctx argument in get_eap_user() calls.
55 * eap_sim_db_priv - EAP-SIM/AKA database context
57 * This is passed to the EAP-SIM/AKA server implementation as a
60 void *eap_sim_db_priv;
63 * ssl_ctx - TLS context
65 * This is passed to the EAP server implementation as a callback
66 * context for TLS operations.
71 * pac_opaque_encr_key - PAC-Opaque encryption key for EAP-FAST
73 * This parameter is used to set a key for EAP-FAST to encrypt the
74 * PAC-Opaque data. It can be set to %NULL if EAP-FAST is not used. If
75 * set, must point to a 16-octet key.
77 u8 *pac_opaque_encr_key;
80 * eap_fast_a_id - EAP-FAST authority identity (A-ID)
82 * If EAP-FAST is not used, this can be set to %NULL. In theory, this
83 * is a variable length field, but due to some existing implementations
84 * requiring A-ID to be 16 octets in length, it is recommended to use
85 * that length for the field to provide interoperability with deployed
86 * peer implementations.
91 * eap_fast_a_id_len - Length of eap_fast_a_id buffer in octets
93 size_t eap_fast_a_id_len;
96 * eap_fast_a_id_info - EAP-FAST authority identifier information
98 * This A-ID-Info contains a user-friendly name for the A-ID. For
99 * example, this could be the enterprise and server names in
100 * human-readable format. This field is encoded as UTF-8. If EAP-FAST
101 * is not used, this can be set to %NULL.
103 char *eap_fast_a_id_info;
106 * eap_fast_prov - EAP-FAST provisioning modes
108 * 0 = provisioning disabled, 1 = only anonymous provisioning allowed,
109 * 2 = only authenticated provisioning allowed, 3 = both provisioning
115 * pac_key_lifetime - EAP-FAST PAC-Key lifetime in seconds
117 * This is the hard limit on how long a provisioned PAC-Key can be
120 int pac_key_lifetime;
123 * pac_key_refresh_time - EAP-FAST PAC-Key refresh time in seconds
125 * This is a soft limit on the PAC-Key. The server will automatically
126 * generate a new PAC-Key when this number of seconds (or fewer) of the
129 int pac_key_refresh_time;
132 int eap_teap_pac_no_inner;
135 * eap_sim_aka_result_ind - EAP-SIM/AKA protected success indication
137 * This controls whether the protected success/failure indication
138 * (AT_RESULT_IND) is used with EAP-SIM and EAP-AKA.
140 int eap_sim_aka_result_ind;
145 * tnc - Trusted Network Connect (TNC)
147 * This controls whether TNC is enabled and will be required before the
148 * peer is allowed to connect. Note: This is only used with EAP-TTLS
149 * and EAP-FAST. If any other EAP method is enabled, the peer will be
150 * allowed to connect without TNC.
155 * pwd_group - EAP-pwd D-H group
157 * This is used to select which D-H group to use with EAP-pwd.
162 * server_id - Server identity
164 const char *server_id;
167 * erp - Whether EAP Re-authentication Protocol (ERP) is enabled
169 * This controls whether the authentication server derives ERP key
170 * hierarchy (rRK and rIK) from full EAP authentication and allows
171 * these keys to be used to perform ERP to derive rMSK instead of full
172 * EAP authentication to derive MSK.
176 const char *erp_domain;
178 unsigned int tls_session_lifetime;
180 unsigned int tls_flags;
183 * wps - Wi-Fi Protected Setup context
185 * If WPS is used with an external RADIUS server (which is quite
186 * unlikely configuration), this is used to provide a pointer to WPS
187 * context data. Normally, this can be set to %NULL.
189 struct wps_context *wps;
192 * ipv6 - Whether to enable IPv6 support in the RADIUS server
197 * get_eap_user - Callback for fetching EAP user information
198 * @ctx: Context data from conf_ctx
199 * @identity: User identity
200 * @identity_len: identity buffer length in octets
201 * @phase2: Whether this is for Phase 2 identity
202 * @user: Data structure for filling in the user information
203 * Returns: 0 on success, -1 on failure
205 * This is used to fetch information from user database. The callback
206 * will fill in information about allowed EAP methods and the user
207 * password. The password field will be an allocated copy of the
208 * password data and RADIUS server will free it after use.
210 int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
211 int phase2, struct eap_user *user);
214 * eap_req_id_text - Optional data for EAP-Request/Identity
216 * This can be used to configure an optional, displayable message that
217 * will be sent in EAP-Request/Identity. This string can contain an
218 * ASCII-0 character (nul) to separate network infromation per RFC
219 * 4284. The actual string length is explicit provided in
220 * eap_req_id_text_len since nul character will not be used as a string
223 const char *eap_req_id_text;
226 * eap_req_id_text_len - Length of eap_req_id_text buffer in octets
228 size_t eap_req_id_text_len;
231 * msg_ctx - Context data for wpa_msg() calls
235 #ifdef CONFIG_RADIUS_TEST
236 const char *dump_msk_file;
237 #endif /* CONFIG_RADIUS_TEST */
239 char *subscr_remediation_url;
240 u8 subscr_remediation_method;
241 char *hs20_sim_provisioning_url;
243 char *t_c_server_url;
247 struct radius_server_data *
248 radius_server_init(struct radius_server_conf *conf);
250 void radius_server_erp_flush(struct radius_server_data *data);
251 void radius_server_deinit(struct radius_server_data *data);
253 int radius_server_get_mib(struct radius_server_data *data, char *buf,
256 void radius_server_eap_pending_cb(struct radius_server_data *data, void *ctx);
257 int radius_server_dac_request(struct radius_server_data *data, const char *req);
259 #endif /* RADIUS_SERVER_H */