Lines Matching refs:hapd

29 static int hostapd_sim_db_cb_sta(struct hostapd_data *hapd,  in hostapd_sim_db_cb_sta()  argument
40 struct hostapd_data *hapd = ctx; in hostapd_sim_db_cb() local
41 if (ap_for_each_sta(hapd, hostapd_sim_db_cb_sta, session_ctx) == 0) { in hostapd_sim_db_cb()
43 radius_server_eap_pending_cb(hapd->radius_srv, session_ctx); in hostapd_sim_db_cb()
97 static int hostapd_setup_radius_srv(struct hostapd_data *hapd) in hostapd_setup_radius_srv() argument
100 struct hostapd_bss_config *conf = hapd->conf; in hostapd_setup_radius_srv()
105 srv.conf_ctx = hapd; in hostapd_setup_radius_srv()
106 srv.eap_sim_db_priv = hapd->eap_sim_db_priv; in hostapd_setup_radius_srv()
107 srv.ssl_ctx = hapd->ssl_ctx; in hostapd_setup_radius_srv()
108 srv.msg_ctx = hapd->msg_ctx; in hostapd_setup_radius_srv()
118 srv.wps = hapd->wps; in hostapd_setup_radius_srv()
137 hapd->radius_srv = radius_server_init(&srv); in hostapd_setup_radius_srv()
138 if (hapd->radius_srv == NULL) { in hostapd_setup_radius_srv()
149 int authsrv_init(struct hostapd_data *hapd) in authsrv_init() argument
152 if (hapd->conf->eap_server && in authsrv_init()
153 (hapd->conf->ca_cert || hapd->conf->server_cert || in authsrv_init()
154 hapd->conf->private_key || hapd->conf->dh_file)) { in authsrv_init()
159 conf.tls_session_lifetime = hapd->conf->tls_session_lifetime; in authsrv_init()
160 hapd->ssl_ctx = tls_init(&conf); in authsrv_init()
161 if (hapd->ssl_ctx == NULL) { in authsrv_init()
163 authsrv_deinit(hapd); in authsrv_init()
168 params.ca_cert = hapd->conf->ca_cert; in authsrv_init()
169 params.client_cert = hapd->conf->server_cert; in authsrv_init()
170 params.private_key = hapd->conf->private_key; in authsrv_init()
171 params.private_key_passwd = hapd->conf->private_key_passwd; in authsrv_init()
172 params.dh_file = hapd->conf->dh_file; in authsrv_init()
173 params.openssl_ciphers = hapd->conf->openssl_ciphers; in authsrv_init()
175 hapd->conf->ocsp_stapling_response; in authsrv_init()
177 hapd->conf->ocsp_stapling_response_multi; in authsrv_init()
179 if (tls_global_set_params(hapd->ssl_ctx, &params)) { in authsrv_init()
181 authsrv_deinit(hapd); in authsrv_init()
185 if (tls_global_set_verify(hapd->ssl_ctx, in authsrv_init()
186 hapd->conf->check_crl)) { in authsrv_init()
188 authsrv_deinit(hapd); in authsrv_init()
195 if (hapd->conf->eap_sim_db) { in authsrv_init()
196 hapd->eap_sim_db_priv = in authsrv_init()
197 eap_sim_db_init(hapd->conf->eap_sim_db, in authsrv_init()
198 hapd->conf->eap_sim_db_timeout, in authsrv_init()
199 hostapd_sim_db_cb, hapd); in authsrv_init()
200 if (hapd->eap_sim_db_priv == NULL) { in authsrv_init()
203 authsrv_deinit(hapd); in authsrv_init()
210 if (hapd->conf->radius_server_clients && in authsrv_init()
211 hostapd_setup_radius_srv(hapd)) in authsrv_init()
219 void authsrv_deinit(struct hostapd_data *hapd) in authsrv_deinit() argument
222 radius_server_deinit(hapd->radius_srv); in authsrv_deinit()
223 hapd->radius_srv = NULL; in authsrv_deinit()
227 if (hapd->ssl_ctx) { in authsrv_deinit()
228 tls_deinit(hapd->ssl_ctx); in authsrv_deinit()
229 hapd->ssl_ctx = NULL; in authsrv_deinit()
234 if (hapd->eap_sim_db_priv) { in authsrv_deinit()
235 eap_sim_db_deinit(hapd->eap_sim_db_priv); in authsrv_deinit()
236 hapd->eap_sim_db_priv = NULL; in authsrv_deinit()