blob: cf9b2ceba9ca1b2a476cef85f6c7088ff25f630e [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * hostapd / Configuration helper functions
Dmitry Shmidt344abd32014-01-14 13:17:00 -08003 * Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi>
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#include "utils/includes.h"
10
11#include "utils/common.h"
12#include "crypto/sha1.h"
13#include "radius/radius_client.h"
14#include "common/ieee802_11_defs.h"
15#include "common/eapol_common.h"
16#include "eap_common/eap_wsc_common.h"
17#include "eap_server/eap.h"
18#include "wpa_auth.h"
19#include "sta_info.h"
20#include "ap_config.h"
21
22
23static void hostapd_config_free_vlan(struct hostapd_bss_config *bss)
24{
25 struct hostapd_vlan *vlan, *prev;
26
27 vlan = bss->vlan;
28 prev = NULL;
29 while (vlan) {
30 prev = vlan;
31 vlan = vlan->next;
32 os_free(prev);
33 }
34
35 bss->vlan = NULL;
36}
37
38
39void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
40{
Dmitry Shmidtd80a4012015-11-05 16:35:40 -080041 dl_list_init(&bss->anqp_elem);
42
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070043 bss->logger_syslog_level = HOSTAPD_LEVEL_INFO;
44 bss->logger_stdout_level = HOSTAPD_LEVEL_INFO;
45 bss->logger_syslog = (unsigned int) -1;
46 bss->logger_stdout = (unsigned int) -1;
47
48 bss->auth_algs = WPA_AUTH_ALG_OPEN | WPA_AUTH_ALG_SHARED;
49
50 bss->wep_rekeying_period = 300;
51 /* use key0 in individual key and key1 in broadcast key */
52 bss->broadcast_key_idx_min = 1;
53 bss->broadcast_key_idx_max = 2;
54 bss->eap_reauth_period = 3600;
55
56 bss->wpa_group_rekey = 600;
57 bss->wpa_gmk_rekey = 86400;
58 bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK;
59 bss->wpa_pairwise = WPA_CIPHER_TKIP;
60 bss->wpa_group = WPA_CIPHER_TKIP;
61 bss->rsn_pairwise = 0;
62
63 bss->max_num_sta = MAX_STA_COUNT;
64
65 bss->dtim_period = 2;
66
67 bss->radius_server_auth_port = 1812;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -080068 bss->eap_sim_db_timeout = 1;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070069 bss->ap_max_inactivity = AP_MAX_INACTIVITY;
70 bss->eapol_version = EAPOL_VERSION;
71
72 bss->max_listen_interval = 65535;
73
74 bss->pwd_group = 19; /* ECC: GF(p=256) */
75
76#ifdef CONFIG_IEEE80211W
77 bss->assoc_sa_query_max_timeout = 1000;
78 bss->assoc_sa_query_retry_timeout = 201;
Dmitry Shmidtb36ed7c2014-03-17 10:57:26 -070079 bss->group_mgmt_cipher = WPA_CIPHER_AES_128_CMAC;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070080#endif /* CONFIG_IEEE80211W */
81#ifdef EAP_SERVER_FAST
82 /* both anonymous and authenticated provisioning */
83 bss->eap_fast_prov = 3;
84 bss->pac_key_lifetime = 7 * 24 * 60 * 60;
85 bss->pac_key_refresh_time = 1 * 24 * 60 * 60;
86#endif /* EAP_SERVER_FAST */
87
88 /* Set to -1 as defaults depends on HT in setup */
89 bss->wmm_enabled = -1;
90
91#ifdef CONFIG_IEEE80211R
92 bss->ft_over_ds = 1;
93#endif /* CONFIG_IEEE80211R */
Dmitry Shmidt04949592012-07-19 12:16:46 -070094
95 bss->radius_das_time_window = 300;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -080096
97 bss->sae_anti_clogging_threshold = 5;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070098}
99
100
101struct hostapd_config * hostapd_config_defaults(void)
102{
103#define ecw2cw(ecw) ((1 << (ecw)) - 1)
104
105 struct hostapd_config *conf;
106 struct hostapd_bss_config *bss;
107 const int aCWmin = 4, aCWmax = 10;
108 const struct hostapd_wmm_ac_params ac_bk =
109 { aCWmin, aCWmax, 7, 0, 0 }; /* background traffic */
110 const struct hostapd_wmm_ac_params ac_be =
111 { aCWmin, aCWmax, 3, 0, 0 }; /* best effort traffic */
112 const struct hostapd_wmm_ac_params ac_vi = /* video traffic */
Dmitry Shmidtb36ed7c2014-03-17 10:57:26 -0700113 { aCWmin - 1, aCWmin, 2, 3008 / 32, 0 };
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700114 const struct hostapd_wmm_ac_params ac_vo = /* voice traffic */
Dmitry Shmidtb36ed7c2014-03-17 10:57:26 -0700115 { aCWmin - 2, aCWmin - 1, 2, 1504 / 32, 0 };
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700116 const struct hostapd_tx_queue_params txq_bk =
117 { 7, ecw2cw(aCWmin), ecw2cw(aCWmax), 0 };
118 const struct hostapd_tx_queue_params txq_be =
119 { 3, ecw2cw(aCWmin), 4 * (ecw2cw(aCWmin) + 1) - 1, 0};
120 const struct hostapd_tx_queue_params txq_vi =
121 { 1, (ecw2cw(aCWmin) + 1) / 2 - 1, ecw2cw(aCWmin), 30};
122 const struct hostapd_tx_queue_params txq_vo =
123 { 1, (ecw2cw(aCWmin) + 1) / 4 - 1,
124 (ecw2cw(aCWmin) + 1) / 2 - 1, 15};
125
126#undef ecw2cw
127
128 conf = os_zalloc(sizeof(*conf));
129 bss = os_zalloc(sizeof(*bss));
130 if (conf == NULL || bss == NULL) {
131 wpa_printf(MSG_ERROR, "Failed to allocate memory for "
132 "configuration data.");
133 os_free(conf);
134 os_free(bss);
135 return NULL;
136 }
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800137 conf->bss = os_calloc(1, sizeof(struct hostapd_bss_config *));
138 if (conf->bss == NULL) {
139 os_free(conf);
140 os_free(bss);
141 return NULL;
142 }
143 conf->bss[0] = bss;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700144
145 bss->radius = os_zalloc(sizeof(*bss->radius));
146 if (bss->radius == NULL) {
Dmitry Shmidt97672262014-02-03 13:02:54 -0800147 os_free(conf->bss);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700148 os_free(conf);
149 os_free(bss);
150 return NULL;
151 }
152
153 hostapd_config_defaults_bss(bss);
154
155 conf->num_bss = 1;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700156
157 conf->beacon_int = 100;
158 conf->rts_threshold = -1; /* use driver default: 2347 */
159 conf->fragm_threshold = -1; /* user driver default: 2346 */
160 conf->send_probe_response = 1;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -0800161 /* Set to invalid value means do not add Power Constraint IE */
162 conf->local_pwr_constraint = -1;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700163
164 conf->wmm_ac_params[0] = ac_be;
165 conf->wmm_ac_params[1] = ac_bk;
166 conf->wmm_ac_params[2] = ac_vi;
167 conf->wmm_ac_params[3] = ac_vo;
168
169 conf->tx_queue[0] = txq_vo;
170 conf->tx_queue[1] = txq_vi;
171 conf->tx_queue[2] = txq_be;
172 conf->tx_queue[3] = txq_bk;
173
174 conf->ht_capab = HT_CAP_INFO_SMPS_DISABLED;
175
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -0800176 conf->ap_table_max_size = 255;
177 conf->ap_table_expiration_time = 60;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -0800178 conf->track_sta_max_age = 180;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -0800179
Dmitry Shmidt8da800a2013-04-24 12:57:01 -0700180#ifdef CONFIG_TESTING_OPTIONS
Dmitry Shmidt7832adb2014-04-29 10:53:02 -0700181 conf->ignore_probe_probability = 0.0;
182 conf->ignore_auth_probability = 0.0;
183 conf->ignore_assoc_probability = 0.0;
184 conf->ignore_reassoc_probability = 0.0;
185 conf->corrupt_gtk_rekey_mic_probability = 0.0;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -0800186 conf->ecsa_ie_only = 0;
Dmitry Shmidt8da800a2013-04-24 12:57:01 -0700187#endif /* CONFIG_TESTING_OPTIONS */
188
Dmitry Shmidtdda10c22015-03-24 16:05:01 -0700189 conf->acs = 0;
190 conf->acs_ch_list.num = 0;
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700191#ifdef CONFIG_ACS
192 conf->acs_num_scans = 5;
193#endif /* CONFIG_ACS */
194
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700195 return conf;
196}
197
198
199int hostapd_mac_comp(const void *a, const void *b)
200{
201 return os_memcmp(a, b, sizeof(macaddr));
202}
203
204
205int hostapd_mac_comp_empty(const void *a)
206{
207 macaddr empty = { 0 };
208 return os_memcmp(a, empty, sizeof(macaddr));
209}
210
211
212static int hostapd_config_read_wpa_psk(const char *fname,
213 struct hostapd_ssid *ssid)
214{
215 FILE *f;
216 char buf[128], *pos;
217 int line = 0, ret = 0, len, ok;
218 u8 addr[ETH_ALEN];
219 struct hostapd_wpa_psk *psk;
220
221 if (!fname)
222 return 0;
223
224 f = fopen(fname, "r");
225 if (!f) {
226 wpa_printf(MSG_ERROR, "WPA PSK file '%s' not found.", fname);
227 return -1;
228 }
229
230 while (fgets(buf, sizeof(buf), f)) {
231 line++;
232
233 if (buf[0] == '#')
234 continue;
235 pos = buf;
236 while (*pos != '\0') {
237 if (*pos == '\n') {
238 *pos = '\0';
239 break;
240 }
241 pos++;
242 }
243 if (buf[0] == '\0')
244 continue;
245
246 if (hwaddr_aton(buf, addr)) {
247 wpa_printf(MSG_ERROR, "Invalid MAC address '%s' on "
248 "line %d in '%s'", buf, line, fname);
249 ret = -1;
250 break;
251 }
252
253 psk = os_zalloc(sizeof(*psk));
254 if (psk == NULL) {
255 wpa_printf(MSG_ERROR, "WPA PSK allocation failed");
256 ret = -1;
257 break;
258 }
259 if (is_zero_ether_addr(addr))
260 psk->group = 1;
261 else
262 os_memcpy(psk->addr, addr, ETH_ALEN);
263
264 pos = buf + 17;
265 if (*pos == '\0') {
266 wpa_printf(MSG_ERROR, "No PSK on line %d in '%s'",
267 line, fname);
268 os_free(psk);
269 ret = -1;
270 break;
271 }
272 pos++;
273
274 ok = 0;
275 len = os_strlen(pos);
276 if (len == 64 && hexstr2bin(pos, psk->psk, PMK_LEN) == 0)
277 ok = 1;
278 else if (len >= 8 && len < 64) {
279 pbkdf2_sha1(pos, ssid->ssid, ssid->ssid_len,
280 4096, psk->psk, PMK_LEN);
281 ok = 1;
282 }
283 if (!ok) {
284 wpa_printf(MSG_ERROR, "Invalid PSK '%s' on line %d in "
285 "'%s'", pos, line, fname);
286 os_free(psk);
287 ret = -1;
288 break;
289 }
290
291 psk->next = ssid->wpa_psk;
292 ssid->wpa_psk = psk;
293 }
294
295 fclose(f);
296
297 return ret;
298}
299
300
301static int hostapd_derive_psk(struct hostapd_ssid *ssid)
302{
303 ssid->wpa_psk = os_zalloc(sizeof(struct hostapd_wpa_psk));
304 if (ssid->wpa_psk == NULL) {
305 wpa_printf(MSG_ERROR, "Unable to alloc space for PSK");
306 return -1;
307 }
308 wpa_hexdump_ascii(MSG_DEBUG, "SSID",
309 (u8 *) ssid->ssid, ssid->ssid_len);
310 wpa_hexdump_ascii_key(MSG_DEBUG, "PSK (ASCII passphrase)",
311 (u8 *) ssid->wpa_passphrase,
312 os_strlen(ssid->wpa_passphrase));
313 pbkdf2_sha1(ssid->wpa_passphrase,
314 ssid->ssid, ssid->ssid_len,
315 4096, ssid->wpa_psk->psk, PMK_LEN);
316 wpa_hexdump_key(MSG_DEBUG, "PSK (from passphrase)",
317 ssid->wpa_psk->psk, PMK_LEN);
318 return 0;
319}
320
321
322int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf)
323{
324 struct hostapd_ssid *ssid = &conf->ssid;
325
326 if (ssid->wpa_passphrase != NULL) {
327 if (ssid->wpa_psk != NULL) {
328 wpa_printf(MSG_DEBUG, "Using pre-configured WPA PSK "
329 "instead of passphrase");
330 } else {
331 wpa_printf(MSG_DEBUG, "Deriving WPA PSK based on "
332 "passphrase");
333 if (hostapd_derive_psk(ssid) < 0)
334 return -1;
335 }
336 ssid->wpa_psk->group = 1;
337 }
338
339 if (ssid->wpa_psk_file) {
340 if (hostapd_config_read_wpa_psk(ssid->wpa_psk_file,
341 &conf->ssid))
342 return -1;
343 }
344
345 return 0;
346}
347
348
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700349static void hostapd_config_free_radius(struct hostapd_radius_server *servers,
350 int num_servers)
351{
352 int i;
353
354 for (i = 0; i < num_servers; i++) {
355 os_free(servers[i].shared_secret);
356 }
357 os_free(servers);
358}
359
360
Dmitry Shmidt04949592012-07-19 12:16:46 -0700361struct hostapd_radius_attr *
362hostapd_config_get_radius_attr(struct hostapd_radius_attr *attr, u8 type)
363{
364 for (; attr; attr = attr->next) {
365 if (attr->type == type)
366 return attr;
367 }
368 return NULL;
369}
370
371
372static void hostapd_config_free_radius_attr(struct hostapd_radius_attr *attr)
373{
374 struct hostapd_radius_attr *prev;
375
376 while (attr) {
377 prev = attr;
378 attr = attr->next;
379 wpabuf_free(prev->val);
380 os_free(prev);
381 }
382}
383
384
Dmitry Shmidt818ea482014-03-10 13:15:21 -0700385void hostapd_config_free_eap_user(struct hostapd_eap_user *user)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700386{
Dmitry Shmidt818ea482014-03-10 13:15:21 -0700387 hostapd_config_free_radius_attr(user->accept_attr);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700388 os_free(user->identity);
Dmitry Shmidtc2817022014-07-02 10:32:10 -0700389 bin_clear_free(user->password, user->password_len);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700390 os_free(user);
391}
392
393
394static void hostapd_config_free_wep(struct hostapd_wep_keys *keys)
395{
396 int i;
397 for (i = 0; i < NUM_WEP_KEYS; i++) {
Dmitry Shmidtc2817022014-07-02 10:32:10 -0700398 bin_clear_free(keys->key[i], keys->len[i]);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700399 keys->key[i] = NULL;
400 }
401}
402
403
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800404void hostapd_config_clear_wpa_psk(struct hostapd_wpa_psk **l)
405{
406 struct hostapd_wpa_psk *psk, *tmp;
407
408 for (psk = *l; psk;) {
409 tmp = psk;
410 psk = psk->next;
411 bin_clear_free(tmp, sizeof(*tmp));
412 }
413 *l = NULL;
414}
415
416
Dmitry Shmidtd80a4012015-11-05 16:35:40 -0800417static void hostapd_config_free_anqp_elem(struct hostapd_bss_config *conf)
418{
419 struct anqp_element *elem;
420
421 while ((elem = dl_list_first(&conf->anqp_elem, struct anqp_element,
422 list))) {
423 dl_list_del(&elem->list);
424 wpabuf_free(elem->payload);
425 os_free(elem);
426 }
427}
428
429
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800430void hostapd_config_free_bss(struct hostapd_bss_config *conf)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700431{
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700432 struct hostapd_eap_user *user, *prev_user;
433
434 if (conf == NULL)
435 return;
436
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800437 hostapd_config_clear_wpa_psk(&conf->ssid.wpa_psk);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700438
Dmitry Shmidtc2817022014-07-02 10:32:10 -0700439 str_clear_free(conf->ssid.wpa_passphrase);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700440 os_free(conf->ssid.wpa_psk_file);
441 hostapd_config_free_wep(&conf->ssid.wep);
442#ifdef CONFIG_FULL_DYNAMIC_VLAN
443 os_free(conf->ssid.vlan_tagged_interface);
444#endif /* CONFIG_FULL_DYNAMIC_VLAN */
445
446 user = conf->eap_user;
447 while (user) {
448 prev_user = user;
449 user = user->next;
450 hostapd_config_free_eap_user(prev_user);
451 }
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800452 os_free(conf->eap_user_sqlite);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700453
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700454 os_free(conf->eap_req_id_text);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800455 os_free(conf->erp_domain);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700456 os_free(conf->accept_mac);
457 os_free(conf->deny_mac);
458 os_free(conf->nas_identifier);
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800459 if (conf->radius) {
460 hostapd_config_free_radius(conf->radius->auth_servers,
461 conf->radius->num_auth_servers);
462 hostapd_config_free_radius(conf->radius->acct_servers,
463 conf->radius->num_acct_servers);
464 }
Dmitry Shmidt04949592012-07-19 12:16:46 -0700465 hostapd_config_free_radius_attr(conf->radius_auth_req_attr);
466 hostapd_config_free_radius_attr(conf->radius_acct_req_attr);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700467 os_free(conf->rsn_preauth_interfaces);
468 os_free(conf->ctrl_interface);
469 os_free(conf->ca_cert);
470 os_free(conf->server_cert);
471 os_free(conf->private_key);
472 os_free(conf->private_key_passwd);
Dmitry Shmidt34af3062013-07-11 10:46:32 -0700473 os_free(conf->ocsp_stapling_response);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700474 os_free(conf->dh_file);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800475 os_free(conf->openssl_ciphers);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700476 os_free(conf->pac_opaque_encr_key);
477 os_free(conf->eap_fast_a_id);
478 os_free(conf->eap_fast_a_id_info);
479 os_free(conf->eap_sim_db);
480 os_free(conf->radius_server_clients);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700481 os_free(conf->radius);
Dmitry Shmidt04949592012-07-19 12:16:46 -0700482 os_free(conf->radius_das_shared_secret);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700483 hostapd_config_free_vlan(conf);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800484 os_free(conf->time_zone);
485
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700486#ifdef CONFIG_IEEE80211R
487 {
488 struct ft_remote_r0kh *r0kh, *r0kh_prev;
489 struct ft_remote_r1kh *r1kh, *r1kh_prev;
490
491 r0kh = conf->r0kh_list;
492 conf->r0kh_list = NULL;
493 while (r0kh) {
494 r0kh_prev = r0kh;
495 r0kh = r0kh->next;
496 os_free(r0kh_prev);
497 }
498
499 r1kh = conf->r1kh_list;
500 conf->r1kh_list = NULL;
501 while (r1kh) {
502 r1kh_prev = r1kh;
503 r1kh = r1kh->next;
504 os_free(r1kh_prev);
505 }
506 }
507#endif /* CONFIG_IEEE80211R */
508
509#ifdef CONFIG_WPS
510 os_free(conf->wps_pin_requests);
511 os_free(conf->device_name);
512 os_free(conf->manufacturer);
513 os_free(conf->model_name);
514 os_free(conf->model_number);
515 os_free(conf->serial_number);
516 os_free(conf->config_methods);
517 os_free(conf->ap_pin);
518 os_free(conf->extra_cred);
519 os_free(conf->ap_settings);
520 os_free(conf->upnp_iface);
521 os_free(conf->friendly_name);
522 os_free(conf->manufacturer_url);
523 os_free(conf->model_description);
524 os_free(conf->model_url);
525 os_free(conf->upc);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800526 {
527 unsigned int i;
528
529 for (i = 0; i < MAX_WPS_VENDOR_EXTENSIONS; i++)
530 wpabuf_free(conf->wps_vendor_ext[i]);
531 }
Dmitry Shmidt04949592012-07-19 12:16:46 -0700532 wpabuf_free(conf->wps_nfc_dh_pubkey);
533 wpabuf_free(conf->wps_nfc_dh_privkey);
534 wpabuf_free(conf->wps_nfc_dev_pw);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700535#endif /* CONFIG_WPS */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800536
537 os_free(conf->roaming_consortium);
Dmitry Shmidt04949592012-07-19 12:16:46 -0700538 os_free(conf->venue_name);
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700539 os_free(conf->nai_realm_data);
540 os_free(conf->network_auth_type);
541 os_free(conf->anqp_3gpp_cell_net);
542 os_free(conf->domain_name);
Dmitry Shmidtd80a4012015-11-05 16:35:40 -0800543 hostapd_config_free_anqp_elem(conf);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800544
545#ifdef CONFIG_RADIUS_TEST
546 os_free(conf->dump_msk_file);
547#endif /* CONFIG_RADIUS_TEST */
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700548
549#ifdef CONFIG_HS20
550 os_free(conf->hs20_oper_friendly_name);
551 os_free(conf->hs20_wan_metrics);
552 os_free(conf->hs20_connection_capability);
553 os_free(conf->hs20_operating_class);
Dmitry Shmidtf21452a2014-02-26 10:55:25 -0800554 os_free(conf->hs20_icons);
555 if (conf->hs20_osu_providers) {
556 size_t i;
557 for (i = 0; i < conf->hs20_osu_providers_count; i++) {
558 struct hs20_osu_provider *p;
559 size_t j;
560 p = &conf->hs20_osu_providers[i];
561 os_free(p->friendly_name);
562 os_free(p->server_uri);
563 os_free(p->method_list);
564 for (j = 0; j < p->icons_count; j++)
565 os_free(p->icons[j]);
566 os_free(p->icons);
567 os_free(p->osu_nai);
568 os_free(p->service_desc);
569 }
570 os_free(conf->hs20_osu_providers);
571 }
572 os_free(conf->subscr_remediation_url);
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700573#endif /* CONFIG_HS20 */
574
575 wpabuf_free(conf->vendor_elements);
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -0800576
577 os_free(conf->sae_groups);
Dmitry Shmidt34af3062013-07-11 10:46:32 -0700578
Dmitry Shmidt0207e232014-09-03 14:58:37 -0700579 os_free(conf->wowlan_triggers);
580
Dmitry Shmidt34af3062013-07-11 10:46:32 -0700581 os_free(conf->server_id);
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800582
Dmitry Shmidtd80a4012015-11-05 16:35:40 -0800583#ifdef CONFIG_TESTING_OPTIONS
584 wpabuf_free(conf->own_ie_override);
585#endif /* CONFIG_TESTING_OPTIONS */
586
587 os_free(conf->no_probe_resp_if_seen_on);
588 os_free(conf->no_auth_if_seen_on);
589
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800590 os_free(conf);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700591}
592
593
594/**
595 * hostapd_config_free - Free hostapd configuration
596 * @conf: Configuration data from hostapd_config_read().
597 */
598void hostapd_config_free(struct hostapd_config *conf)
599{
600 size_t i;
601
602 if (conf == NULL)
603 return;
604
605 for (i = 0; i < conf->num_bss; i++)
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800606 hostapd_config_free_bss(conf->bss[i]);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700607 os_free(conf->bss);
608 os_free(conf->supported_rates);
609 os_free(conf->basic_rates);
Dmitry Shmidtdda10c22015-03-24 16:05:01 -0700610 os_free(conf->acs_ch_list.range);
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800611 os_free(conf->driver_params);
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800612#ifdef CONFIG_ACS
613 os_free(conf->acs_chan_bias);
614#endif /* CONFIG_ACS */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700615
616 os_free(conf);
617}
618
619
620/**
621 * hostapd_maclist_found - Find a MAC address from a list
622 * @list: MAC address list
623 * @num_entries: Number of addresses in the list
624 * @addr: Address to search for
625 * @vlan_id: Buffer for returning VLAN ID or %NULL if not needed
626 * Returns: 1 if address is in the list or 0 if not.
627 *
628 * Perform a binary search for given MAC address from a pre-sorted list.
629 */
630int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries,
631 const u8 *addr, int *vlan_id)
632{
633 int start, end, middle, res;
634
635 start = 0;
636 end = num_entries - 1;
637
638 while (start <= end) {
639 middle = (start + end) / 2;
640 res = os_memcmp(list[middle].addr, addr, ETH_ALEN);
641 if (res == 0) {
642 if (vlan_id)
643 *vlan_id = list[middle].vlan_id;
644 return 1;
645 }
646 if (res < 0)
647 start = middle + 1;
648 else
649 end = middle - 1;
650 }
651
652 return 0;
653}
654
655
656int hostapd_rate_found(int *list, int rate)
657{
658 int i;
659
660 if (list == NULL)
661 return 0;
662
663 for (i = 0; list[i] >= 0; i++)
664 if (list[i] == rate)
665 return 1;
666
667 return 0;
668}
669
670
Dmitry Shmidt34af3062013-07-11 10:46:32 -0700671int hostapd_vlan_id_valid(struct hostapd_vlan *vlan, int vlan_id)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700672{
673 struct hostapd_vlan *v = vlan;
674 while (v) {
675 if (v->vlan_id == vlan_id || v->vlan_id == VLAN_ID_WILDCARD)
Dmitry Shmidt34af3062013-07-11 10:46:32 -0700676 return 1;
677 v = v->next;
678 }
679 return 0;
680}
681
682
683const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan, int vlan_id)
684{
685 struct hostapd_vlan *v = vlan;
686 while (v) {
687 if (v->vlan_id == vlan_id)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700688 return v->ifname;
689 v = v->next;
690 }
691 return NULL;
692}
693
694
695const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700696 const u8 *addr, const u8 *p2p_dev_addr,
697 const u8 *prev_psk)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700698{
699 struct hostapd_wpa_psk *psk;
700 int next_ok = prev_psk == NULL;
701
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700702 if (p2p_dev_addr && !is_zero_ether_addr(p2p_dev_addr)) {
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700703 wpa_printf(MSG_DEBUG, "Searching a PSK for " MACSTR
704 " p2p_dev_addr=" MACSTR " prev_psk=%p",
705 MAC2STR(addr), MAC2STR(p2p_dev_addr), prev_psk);
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700706 addr = NULL; /* Use P2P Device Address for matching */
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700707 } else {
708 wpa_printf(MSG_DEBUG, "Searching a PSK for " MACSTR
709 " prev_psk=%p",
710 MAC2STR(addr), prev_psk);
711 }
712
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700713 for (psk = conf->ssid.wpa_psk; psk != NULL; psk = psk->next) {
714 if (next_ok &&
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700715 (psk->group ||
716 (addr && os_memcmp(psk->addr, addr, ETH_ALEN) == 0) ||
717 (!addr && p2p_dev_addr &&
718 os_memcmp(psk->p2p_dev_addr, p2p_dev_addr, ETH_ALEN) ==
719 0)))
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700720 return psk->psk;
721
722 if (psk->psk == prev_psk)
723 next_ok = 1;
724 }
725
726 return NULL;
727}
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800728
729
730static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800731 struct hostapd_config *conf,
732 int full_config)
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800733{
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800734 if (full_config && bss->ieee802_1x && !bss->eap_server &&
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800735 !bss->radius->auth_servers) {
736 wpa_printf(MSG_ERROR, "Invalid IEEE 802.1X configuration (no "
737 "EAP authenticator configured).");
738 return -1;
739 }
740
741 if (bss->wpa) {
742 int wep, i;
743
744 wep = bss->default_wep_key_len > 0 ||
745 bss->individual_wep_key_len > 0;
746 for (i = 0; i < NUM_WEP_KEYS; i++) {
747 if (bss->ssid.wep.keys_set) {
748 wep = 1;
749 break;
750 }
751 }
752
753 if (wep) {
754 wpa_printf(MSG_ERROR, "WEP configuration in a WPA network is not supported");
755 return -1;
756 }
757 }
758
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800759 if (full_config && bss->wpa &&
760 bss->wpa_psk_radius != PSK_RADIUS_IGNORED &&
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800761 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) {
762 wpa_printf(MSG_ERROR, "WPA-PSK using RADIUS enabled, but no "
763 "RADIUS checking (macaddr_acl=2) enabled.");
764 return -1;
765 }
766
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800767 if (full_config && bss->wpa && (bss->wpa_key_mgmt & WPA_KEY_MGMT_PSK) &&
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800768 bss->ssid.wpa_psk == NULL && bss->ssid.wpa_passphrase == NULL &&
769 bss->ssid.wpa_psk_file == NULL &&
770 (bss->wpa_psk_radius != PSK_RADIUS_REQUIRED ||
771 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH)) {
772 wpa_printf(MSG_ERROR, "WPA-PSK enabled, but PSK or passphrase "
773 "is not configured.");
774 return -1;
775 }
776
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800777 if (full_config && hostapd_mac_comp_empty(bss->bssid) != 0) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800778 size_t i;
779
780 for (i = 0; i < conf->num_bss; i++) {
781 if (conf->bss[i] != bss &&
782 (hostapd_mac_comp(conf->bss[i]->bssid,
783 bss->bssid) == 0)) {
784 wpa_printf(MSG_ERROR, "Duplicate BSSID " MACSTR
785 " on interface '%s' and '%s'.",
786 MAC2STR(bss->bssid),
787 conf->bss[i]->iface, bss->iface);
788 return -1;
789 }
790 }
791 }
792
793#ifdef CONFIG_IEEE80211R
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800794 if (full_config && wpa_key_mgmt_ft(bss->wpa_key_mgmt) &&
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800795 (bss->nas_identifier == NULL ||
796 os_strlen(bss->nas_identifier) < 1 ||
797 os_strlen(bss->nas_identifier) > FT_R0KH_ID_MAX_LEN)) {
798 wpa_printf(MSG_ERROR, "FT (IEEE 802.11r) requires "
799 "nas_identifier to be configured as a 1..48 octet "
800 "string");
801 return -1;
802 }
803#endif /* CONFIG_IEEE80211R */
804
805#ifdef CONFIG_IEEE80211N
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800806 if (full_config && conf->ieee80211n &&
807 conf->hw_mode == HOSTAPD_MODE_IEEE80211B) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800808 bss->disable_11n = 1;
809 wpa_printf(MSG_ERROR, "HT (IEEE 802.11n) in 11b mode is not "
Dmitry Shmidt661b4f72014-09-29 14:58:27 -0700810 "allowed, disabling HT capabilities");
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800811 }
812
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800813 if (full_config && conf->ieee80211n &&
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800814 bss->ssid.security_policy == SECURITY_STATIC_WEP) {
815 bss->disable_11n = 1;
816 wpa_printf(MSG_ERROR, "HT (IEEE 802.11n) with WEP is not "
817 "allowed, disabling HT capabilities");
818 }
819
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800820 if (full_config && conf->ieee80211n && bss->wpa &&
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800821 !(bss->wpa_pairwise & WPA_CIPHER_CCMP) &&
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800822 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP |
823 WPA_CIPHER_CCMP_256 | WPA_CIPHER_GCMP_256)))
824 {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800825 bss->disable_11n = 1;
826 wpa_printf(MSG_ERROR, "HT (IEEE 802.11n) with WPA/WPA2 "
827 "requires CCMP/GCMP to be enabled, disabling HT "
828 "capabilities");
829 }
830#endif /* CONFIG_IEEE80211N */
831
Dmitry Shmidt15907092014-03-25 10:42:57 -0700832#ifdef CONFIG_WPS
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800833 if (full_config && bss->wps_state && bss->ignore_broadcast_ssid) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800834 wpa_printf(MSG_INFO, "WPS: ignore_broadcast_ssid "
835 "configuration forced WPS to be disabled");
836 bss->wps_state = 0;
837 }
838
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800839 if (full_config && bss->wps_state &&
840 bss->ssid.wep.keys_set && bss->wpa == 0) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800841 wpa_printf(MSG_INFO, "WPS: WEP configuration forced WPS to be "
842 "disabled");
843 bss->wps_state = 0;
844 }
845
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800846 if (full_config && bss->wps_state && bss->wpa &&
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800847 (!(bss->wpa & 2) ||
Dmitry Shmidt1d755d02015-04-28 10:34:29 -0700848 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)))) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800849 wpa_printf(MSG_INFO, "WPS: WPA/TKIP configuration without "
Dmitry Shmidt1d755d02015-04-28 10:34:29 -0700850 "WPA2/CCMP/GCMP forced WPS to be disabled");
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800851 bss->wps_state = 0;
852 }
Dmitry Shmidt15907092014-03-25 10:42:57 -0700853#endif /* CONFIG_WPS */
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800854
855#ifdef CONFIG_HS20
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800856 if (full_config && bss->hs20 &&
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800857 (!(bss->wpa & 2) ||
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800858 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP |
859 WPA_CIPHER_CCMP_256 |
860 WPA_CIPHER_GCMP_256)))) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800861 wpa_printf(MSG_ERROR, "HS 2.0: WPA2-Enterprise/CCMP "
862 "configuration is required for Hotspot 2.0 "
863 "functionality");
864 return -1;
865 }
866#endif /* CONFIG_HS20 */
867
868 return 0;
869}
870
871
Dmitry Shmidt05df46a2015-05-19 11:02:01 -0700872static int hostapd_config_check_cw(struct hostapd_config *conf, int queue)
873{
874 int tx_cwmin = conf->tx_queue[queue].cwmin;
875 int tx_cwmax = conf->tx_queue[queue].cwmax;
876 int ac_cwmin = conf->wmm_ac_params[queue].cwmin;
877 int ac_cwmax = conf->wmm_ac_params[queue].cwmax;
878
879 if (tx_cwmin > tx_cwmax) {
880 wpa_printf(MSG_ERROR,
881 "Invalid TX queue cwMin/cwMax values. cwMin(%d) greater than cwMax(%d)",
882 tx_cwmin, tx_cwmax);
883 return -1;
884 }
885 if (ac_cwmin > ac_cwmax) {
886 wpa_printf(MSG_ERROR,
887 "Invalid WMM AC cwMin/cwMax values. cwMin(%d) greater than cwMax(%d)",
888 ac_cwmin, ac_cwmax);
889 return -1;
890 }
891 return 0;
892}
893
894
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800895int hostapd_config_check(struct hostapd_config *conf, int full_config)
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800896{
897 size_t i;
898
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800899 if (full_config && conf->ieee80211d &&
900 (!conf->country[0] || !conf->country[1])) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800901 wpa_printf(MSG_ERROR, "Cannot enable IEEE 802.11d without "
902 "setting the country_code");
903 return -1;
904 }
905
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800906 if (full_config && conf->ieee80211h && !conf->ieee80211d) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800907 wpa_printf(MSG_ERROR, "Cannot enable IEEE 802.11h without "
908 "IEEE 802.11d enabled");
909 return -1;
910 }
911
Dmitry Shmidtf21452a2014-02-26 10:55:25 -0800912 if (full_config && conf->local_pwr_constraint != -1 &&
913 !conf->ieee80211d) {
914 wpa_printf(MSG_ERROR, "Cannot add Power Constraint element without Country element");
915 return -1;
916 }
917
918 if (full_config && conf->spectrum_mgmt_required &&
919 conf->local_pwr_constraint == -1) {
920 wpa_printf(MSG_ERROR, "Cannot set Spectrum Management bit without Country and Power Constraint elements");
921 return -1;
922 }
923
Dmitry Shmidt05df46a2015-05-19 11:02:01 -0700924 for (i = 0; i < NUM_TX_QUEUES; i++) {
925 if (hostapd_config_check_cw(conf, i))
926 return -1;
927 }
928
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800929 for (i = 0; i < conf->num_bss; i++) {
Dmitry Shmidt344abd32014-01-14 13:17:00 -0800930 if (hostapd_config_check_bss(conf->bss[i], conf, full_config))
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800931 return -1;
932 }
933
934 return 0;
935}
936
937
Dmitry Shmidt71757432014-06-02 13:50:35 -0700938void hostapd_set_security_params(struct hostapd_bss_config *bss,
939 int full_config)
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800940{
941 if (bss->individual_wep_key_len == 0) {
942 /* individual keys are not use; can use key idx0 for
943 * broadcast keys */
944 bss->broadcast_key_idx_min = 0;
945 }
946
947 if ((bss->wpa & 2) && bss->rsn_pairwise == 0)
948 bss->rsn_pairwise = bss->wpa_pairwise;
949 bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa, bss->wpa_pairwise,
950 bss->rsn_pairwise);
951
Dmitry Shmidt71757432014-06-02 13:50:35 -0700952 if (full_config) {
953 bss->radius->auth_server = bss->radius->auth_servers;
954 bss->radius->acct_server = bss->radius->acct_servers;
955 }
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800956
957 if (bss->wpa && bss->ieee802_1x) {
958 bss->ssid.security_policy = SECURITY_WPA;
959 } else if (bss->wpa) {
960 bss->ssid.security_policy = SECURITY_WPA_PSK;
961 } else if (bss->ieee802_1x) {
962 int cipher = WPA_CIPHER_NONE;
963 bss->ssid.security_policy = SECURITY_IEEE_802_1X;
964 bss->ssid.wep.default_len = bss->default_wep_key_len;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800965 if (full_config && bss->default_wep_key_len) {
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800966 cipher = bss->default_wep_key_len >= 13 ?
967 WPA_CIPHER_WEP104 : WPA_CIPHER_WEP40;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800968 } else if (full_config && bss->ssid.wep.keys_set) {
969 if (bss->ssid.wep.len[0] >= 13)
970 cipher = WPA_CIPHER_WEP104;
971 else
972 cipher = WPA_CIPHER_WEP40;
973 }
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800974 bss->wpa_group = cipher;
975 bss->wpa_pairwise = cipher;
976 bss->rsn_pairwise = cipher;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800977 if (full_config)
978 bss->wpa_key_mgmt = WPA_KEY_MGMT_IEEE8021X_NO_WPA;
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800979 } else if (bss->ssid.wep.keys_set) {
980 int cipher = WPA_CIPHER_WEP40;
981 if (bss->ssid.wep.len[0] >= 13)
982 cipher = WPA_CIPHER_WEP104;
983 bss->ssid.security_policy = SECURITY_STATIC_WEP;
984 bss->wpa_group = cipher;
985 bss->wpa_pairwise = cipher;
986 bss->rsn_pairwise = cipher;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800987 if (full_config)
988 bss->wpa_key_mgmt = WPA_KEY_MGMT_NONE;
Dmitry Shmidtf21452a2014-02-26 10:55:25 -0800989 } else if (bss->osen) {
990 bss->ssid.security_policy = SECURITY_OSEN;
991 bss->wpa_group = WPA_CIPHER_CCMP;
992 bss->wpa_pairwise = 0;
993 bss->rsn_pairwise = WPA_CIPHER_CCMP;
Dmitry Shmidtcce06662013-11-04 18:44:24 -0800994 } else {
995 bss->ssid.security_policy = SECURITY_PLAINTEXT;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -0800996 if (full_config) {
997 bss->wpa_group = WPA_CIPHER_NONE;
998 bss->wpa_pairwise = WPA_CIPHER_NONE;
999 bss->rsn_pairwise = WPA_CIPHER_NONE;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -08001000 bss->wpa_key_mgmt = WPA_KEY_MGMT_NONE;
Dmitry Shmidtd80a4012015-11-05 16:35:40 -08001001 }
Dmitry Shmidtcce06662013-11-04 18:44:24 -08001002 }
1003}