/** * wps_deinit - Deinitialize WPS Registration protocol data * @data: WPS Registration protocol data from wps_init() */ void wps_deinit(struct wps_data *data) { #ifdef CONFIG_WPS_NFC if (data->registrar && data->nfc_pw_token) wps_registrar_remove_nfc_pw_token(data->wps->registrar, data->nfc_pw_token); #endif /* CONFIG_WPS_NFC */ if (data->wps_pin_revealed) { wpa_printf(MSG_DEBUG, "WPS: Full PIN information revealed and " "negotiation failed"); if (data->registrar) wps_registrar_invalidate_pin(data->wps->registrar, data->uuid_e); } else if (data->registrar) wps_registrar_unlock_pin(data->wps->registrar, data->uuid_e); wpabuf_free(data->dh_privkey); wpabuf_free(data->dh_pubkey_e); wpabuf_free(data->dh_pubkey_r); wpabuf_free(data->last_msg); bin_clear_free(data->dev_password, data->dev_password_len); bin_clear_free(data->alt_dev_password, data->alt_dev_password_len); bin_clear_free(data->new_psk, data->new_psk_len); wps_device_data_free(&data->peer_dev); bin_clear_free(data->new_ap_settings, sizeof(*data->new_ap_settings)); dh5_free(data->dh_ctx); os_free(data); }
/** * wps_deinit - Deinitialize WPS Registration protocol data * @data: WPS Registration protocol data from wps_init() */ void wps_deinit(struct wps_data *data) { if (data->wps_pin_revealed) { wpa_printf(MSG_DEBUG, "WPS: Full PIN information revealed and " "negotiation failed"); if (data->registrar) wps_registrar_invalidate_pin(data->wps->registrar, data->uuid_e); } else if (data->registrar) wps_registrar_unlock_pin(data->wps->registrar, data->uuid_e); /* @@@ Free wpa key and essid pointers @@@ */ if (data->key) free(data->key); if (data->essid) free(data->essid); wpabuf_free(data->dh_privkey); wpabuf_free(data->dh_pubkey_e); wpabuf_free(data->dh_pubkey_r); wpabuf_free(data->last_msg); os_free(data->dev_password); os_free(data->new_psk); wps_device_data_free(&data->peer_dev); os_free(data->new_ap_settings); dh5_free(data->dh_ctx); os_free(data); }
void hostapd_deinit_wps(struct hostapd_data *hapd) { if (hapd->wps == NULL) return; #ifdef CONFIG_WPS_UPNP hostapd_wps_upnp_deinit(hapd); #endif /* CONFIG_WPS_UPNP */ wps_registrar_deinit(hapd->wps->registrar); os_free(hapd->wps->network_key); wps_device_data_free(&hapd->wps->dev); wps_free_pending_msgs(hapd->wps->upnp_msgs); os_free(hapd->wps); hapd->wps = NULL; hostapd_wps_clear_ies(hapd); }
void hostapd_deinit_wps(struct hostapd_data *hapd) { eloop_cancel_timeout(hostapd_wps_reenable_ap_pin, hapd, NULL); eloop_cancel_timeout(hostapd_wps_ap_pin_timeout, hapd, NULL); if (hapd->wps == NULL) return; #ifdef CONFIG_WPS_UPNP hostapd_wps_upnp_deinit(hapd); #endif /* CONFIG_WPS_UPNP */ wps_registrar_deinit(hapd->wps->registrar); os_free(hapd->wps->network_key); wps_device_data_free(&hapd->wps->dev); wpabuf_free(hapd->wps->dh_pubkey); wpabuf_free(hapd->wps->dh_privkey); wps_free_pending_msgs(hapd->wps->upnp_msgs); hostapd_wps_nfc_clear(hapd->wps); os_free(hapd->wps); hapd->wps = NULL; hostapd_wps_clear_ies(hapd); }