hostapd vendor branch: Update version from 0.6.10 => 2.1 gitea/vendor/HOSTAPD origin/vendor/HOSTAPD
authorJohn Marino <draco@marino.st>
Tue, 27 May 2014 19:42:16 +0000 (21:42 +0200)
committerJohn Marino <draco@marino.st>
Wed, 28 May 2014 14:36:08 +0000 (16:36 +0200)
618 files changed:
contrib/hostapd-0.4.9/COPYING [deleted file]
contrib/hostapd-0.4.9/README [deleted file]
contrib/hostapd-0.4.9/README.DELETE [deleted file]
contrib/hostapd-0.4.9/README.DRAGONFLY [deleted file]
contrib/hostapd-0.4.9/accounting.c [deleted file]
contrib/hostapd-0.4.9/accounting.h [deleted file]
contrib/hostapd-0.4.9/aes_wrap.c [deleted file]
contrib/hostapd-0.4.9/aes_wrap.h [deleted file]
contrib/hostapd-0.4.9/ap.h [deleted file]
contrib/hostapd-0.4.9/common.c [deleted file]
contrib/hostapd-0.4.9/common.h [deleted file]
contrib/hostapd-0.4.9/config.c [deleted file]
contrib/hostapd-0.4.9/config.h [deleted file]
contrib/hostapd-0.4.9/config_types.h [deleted file]
contrib/hostapd-0.4.9/crypto.c [deleted file]
contrib/hostapd-0.4.9/crypto.h [deleted file]
contrib/hostapd-0.4.9/ctrl_iface.c [deleted file]
contrib/hostapd-0.4.9/ctrl_iface.h [deleted file]
contrib/hostapd-0.4.9/defconfig [deleted file]
contrib/hostapd-0.4.9/defs.h [deleted file]
contrib/hostapd-0.4.9/developer.txt [deleted file]
contrib/hostapd-0.4.9/driver.h [deleted file]
contrib/hostapd-0.4.9/driver_wired.c [deleted file]
contrib/hostapd-0.4.9/eap.c [deleted file]
contrib/hostapd-0.4.9/eap.h [deleted file]
contrib/hostapd-0.4.9/eap_defs.h [deleted file]
contrib/hostapd-0.4.9/eap_gtc.c [deleted file]
contrib/hostapd-0.4.9/eap_i.h [deleted file]
contrib/hostapd-0.4.9/eap_identity.c [deleted file]
contrib/hostapd-0.4.9/eap_md5.c [deleted file]
contrib/hostapd-0.4.9/eap_mschapv2.c [deleted file]
contrib/hostapd-0.4.9/eap_pax.c [deleted file]
contrib/hostapd-0.4.9/eap_pax_common.c [deleted file]
contrib/hostapd-0.4.9/eap_pax_common.h [deleted file]
contrib/hostapd-0.4.9/eap_peap.c [deleted file]
contrib/hostapd-0.4.9/eap_psk.c [deleted file]
contrib/hostapd-0.4.9/eap_psk_common.c [deleted file]
contrib/hostapd-0.4.9/eap_psk_common.h [deleted file]
contrib/hostapd-0.4.9/eap_sim.c [deleted file]
contrib/hostapd-0.4.9/eap_sim_common.c [deleted file]
contrib/hostapd-0.4.9/eap_sim_common.h [deleted file]
contrib/hostapd-0.4.9/eap_sim_db.c [deleted file]
contrib/hostapd-0.4.9/eap_sim_db.h [deleted file]
contrib/hostapd-0.4.9/eap_tls.c [deleted file]
contrib/hostapd-0.4.9/eap_tls_common.c [deleted file]
contrib/hostapd-0.4.9/eap_tls_common.h [deleted file]
contrib/hostapd-0.4.9/eap_tlv.c [deleted file]
contrib/hostapd-0.4.9/eap_ttls.c [deleted file]
contrib/hostapd-0.4.9/eap_ttls.h [deleted file]
contrib/hostapd-0.4.9/eapol_sm.c [deleted file]
contrib/hostapd-0.4.9/eapol_sm.h [deleted file]
contrib/hostapd-0.4.9/eloop.c [deleted file]
contrib/hostapd-0.4.9/eloop.h [deleted file]
contrib/hostapd-0.4.9/hostap_common.h [deleted file]
contrib/hostapd-0.4.9/hostapd.8 [deleted file]
contrib/hostapd-0.4.9/hostapd.accept [deleted file]
contrib/hostapd-0.4.9/hostapd.c [deleted file]
contrib/hostapd-0.4.9/hostapd.conf [deleted file]
contrib/hostapd-0.4.9/hostapd.deny [deleted file]
contrib/hostapd-0.4.9/hostapd.eap_user [deleted file]
contrib/hostapd-0.4.9/hostapd.h [deleted file]
contrib/hostapd-0.4.9/hostapd.radius_clients [deleted file]
contrib/hostapd-0.4.9/hostapd.sim_db [deleted file]
contrib/hostapd-0.4.9/hostapd.wpa_psk [deleted file]
contrib/hostapd-0.4.9/hostapd_cli.1 [deleted file]
contrib/hostapd-0.4.9/hostapd_cli.c [deleted file]
contrib/hostapd-0.4.9/iapp.c [deleted file]
contrib/hostapd-0.4.9/ieee802_11.c [deleted file]
contrib/hostapd-0.4.9/ieee802_11.h [deleted file]
contrib/hostapd-0.4.9/ieee802_11_auth.c [deleted file]
contrib/hostapd-0.4.9/ieee802_11_auth.h [deleted file]
contrib/hostapd-0.4.9/ieee802_1x.c [deleted file]
contrib/hostapd-0.4.9/ieee802_1x.h [deleted file]
contrib/hostapd-0.4.9/l2_packet.h [deleted file]
contrib/hostapd-0.4.9/madwifi.conf [deleted file]
contrib/hostapd-0.4.9/md5.h [deleted file]
contrib/hostapd-0.4.9/ms_funcs.c [deleted file]
contrib/hostapd-0.4.9/ms_funcs.h [deleted file]
contrib/hostapd-0.4.9/radius.c [deleted file]
contrib/hostapd-0.4.9/radius.h [deleted file]
contrib/hostapd-0.4.9/radius_client.c [deleted file]
contrib/hostapd-0.4.9/radius_client.h [deleted file]
contrib/hostapd-0.4.9/radius_server.c [deleted file]
contrib/hostapd-0.4.9/radius_server.h [deleted file]
contrib/hostapd-0.4.9/rc4.c [deleted file]
contrib/hostapd-0.4.9/rc4.h [deleted file]
contrib/hostapd-0.4.9/sha1.c [deleted file]
contrib/hostapd-0.4.9/sha1.h [deleted file]
contrib/hostapd-0.4.9/sta_info.c [deleted file]
contrib/hostapd-0.4.9/sta_info.h [deleted file]
contrib/hostapd-0.4.9/tls.h [deleted file]
contrib/hostapd-0.4.9/tls_none.c [deleted file]
contrib/hostapd-0.4.9/tls_openssl.c [deleted file]
contrib/hostapd-0.4.9/version.h [deleted file]
contrib/hostapd-0.4.9/wired.conf [deleted file]
contrib/hostapd-0.4.9/wpa.c [deleted file]
contrib/hostapd-0.4.9/wpa.h [deleted file]
contrib/hostapd-0.4.9/wpa_ctrl.c [deleted file]
contrib/hostapd-0.4.9/wpa_ctrl.h [deleted file]
contrib/hostapd/COPYING
contrib/hostapd/README
contrib/hostapd/README.DELETED [deleted file]
contrib/hostapd/README.DRAGONFLY [deleted file]
contrib/hostapd/hostapd/ChangeLog
contrib/hostapd/hostapd/README
contrib/hostapd/hostapd/README-WPS
contrib/hostapd/hostapd/accounting.h [deleted file]
contrib/hostapd/hostapd/ap.h [deleted file]
contrib/hostapd/hostapd/ap_list.c [deleted file]
contrib/hostapd/hostapd/ap_list.h [deleted file]
contrib/hostapd/hostapd/beacon.c [deleted file]
contrib/hostapd/hostapd/beacon.h [deleted file]
contrib/hostapd/hostapd/config_file.c [moved from contrib/hostapd/hostapd/config.c with 57% similarity]
contrib/hostapd/hostapd/config_file.h [new file with mode: 0644]
contrib/hostapd/hostapd/ctrl_iface.c
contrib/hostapd/hostapd/ctrl_iface.h
contrib/hostapd/hostapd/driver.h [deleted file]
contrib/hostapd/hostapd/driver_atheros.c [deleted file]
contrib/hostapd/hostapd/driver_bsd.c [deleted file]
contrib/hostapd/hostapd/driver_hostap.c [deleted file]
contrib/hostapd/hostapd/driver_madwifi.c [deleted file]
contrib/hostapd/hostapd/driver_nl80211.c [deleted file]
contrib/hostapd/hostapd/driver_none.c [deleted file]
contrib/hostapd/hostapd/driver_prism54.c [deleted file]
contrib/hostapd/hostapd/driver_test.c [deleted file]
contrib/hostapd/hostapd/driver_wired.c [deleted file]
contrib/hostapd/hostapd/drivers.c [deleted file]
contrib/hostapd/hostapd/eap_register.c [new file with mode: 0644]
contrib/hostapd/hostapd/eap_register.h [new file with mode: 0644]
contrib/hostapd/hostapd/hlr_auc_gw.txt [new file with mode: 0644]
contrib/hostapd/hostapd/hostap_common.h [deleted file]
contrib/hostapd/hostapd/hostapd.c [deleted file]
contrib/hostapd/hostapd/hostapd.h [deleted file]
contrib/hostapd/hostapd/hostapd_cli.c
contrib/hostapd/hostapd/hw_features.c [deleted file]
contrib/hostapd/hostapd/hw_features.h [deleted file]
contrib/hostapd/hostapd/iapp.h [deleted file]
contrib/hostapd/hostapd/ieee802_11.c [deleted file]
contrib/hostapd/hostapd/ieee802_11.h [deleted file]
contrib/hostapd/hostapd/logwatch/README [deleted file]
contrib/hostapd/hostapd/main.c [new file with mode: 0644]
contrib/hostapd/hostapd/nt_password_hash.c [deleted file]
contrib/hostapd/hostapd/prism54.h [deleted file]
contrib/hostapd/hostapd/priv_netlink.h [deleted file]
contrib/hostapd/hostapd/radiotap.h [deleted file]
contrib/hostapd/hostapd/sta_info.h [deleted file]
contrib/hostapd/hostapd/vlan_init.h [deleted file]
contrib/hostapd/hostapd/wme.h [deleted file]
contrib/hostapd/hostapd/wps_hostapd.c [deleted file]
contrib/hostapd/hostapd/wps_hostapd.h [deleted file]
contrib/hostapd/patches/openssl-0.9.8x-tls-extensions.patch [new file with mode: 0644]
contrib/hostapd/src/ap/accounting.c [moved from contrib/hostapd/hostapd/accounting.c with 67% similarity]
contrib/hostapd/src/ap/accounting.h [new file with mode: 0644]
contrib/hostapd/src/ap/acs.c [new file with mode: 0644]
contrib/hostapd/src/ap/acs.h [new file with mode: 0644]
contrib/hostapd/src/ap/ap_config.c [new file with mode: 0644]
contrib/hostapd/src/ap/ap_config.h [moved from contrib/hostapd/hostapd/config.h with 54% similarity]
contrib/hostapd/src/ap/ap_drv_ops.c [new file with mode: 0644]
contrib/hostapd/src/ap/ap_drv_ops.h [new file with mode: 0644]
contrib/hostapd/src/ap/ap_list.c [new file with mode: 0644]
contrib/hostapd/src/ap/ap_list.h [new file with mode: 0644]
contrib/hostapd/src/ap/ap_mlme.c [moved from contrib/hostapd/hostapd/mlme.c with 92% similarity]
contrib/hostapd/src/ap/ap_mlme.h [moved from contrib/hostapd/hostapd/mlme.h with 73% similarity]
contrib/hostapd/src/ap/authsrv.c [new file with mode: 0644]
contrib/hostapd/src/ap/authsrv.h [new file with mode: 0644]
contrib/hostapd/src/ap/beacon.c [new file with mode: 0644]
contrib/hostapd/src/ap/beacon.h [new file with mode: 0644]
contrib/hostapd/src/ap/ctrl_iface_ap.c [new file with mode: 0644]
contrib/hostapd/src/ap/ctrl_iface_ap.h [new file with mode: 0644]
contrib/hostapd/src/ap/dfs.c [new file with mode: 0644]
contrib/hostapd/src/ap/dfs.h [new file with mode: 0644]
contrib/hostapd/src/ap/drv_callbacks.c [new file with mode: 0644]
contrib/hostapd/src/ap/eap_user_db.c [new file with mode: 0644]
contrib/hostapd/src/ap/gas_serv.c [new file with mode: 0644]
contrib/hostapd/src/ap/gas_serv.h [new file with mode: 0644]
contrib/hostapd/src/ap/hostapd.c [new file with mode: 0644]
contrib/hostapd/src/ap/hostapd.h [new file with mode: 0644]
contrib/hostapd/src/ap/hs20.c [new file with mode: 0644]
contrib/hostapd/src/ap/hs20.h [new file with mode: 0644]
contrib/hostapd/src/ap/hw_features.c [new file with mode: 0644]
contrib/hostapd/src/ap/hw_features.h [new file with mode: 0644]
contrib/hostapd/src/ap/iapp.c [moved from contrib/hostapd/hostapd/iapp.c with 85% similarity]
contrib/hostapd/src/ap/iapp.h [moved from contrib/hostapd-0.4.9/iapp.h with 72% similarity]
contrib/hostapd/src/ap/ieee802_11.c [new file with mode: 0644]
contrib/hostapd/src/ap/ieee802_11.h [new file with mode: 0644]
contrib/hostapd/src/ap/ieee802_11_auth.c [moved from contrib/hostapd/hostapd/ieee802_11_auth.c with 61% similarity]
contrib/hostapd/src/ap/ieee802_11_auth.h [moved from contrib/hostapd/hostapd/ieee802_11_auth.h with 53% similarity]
contrib/hostapd/src/ap/ieee802_11_ht.c [new file with mode: 0644]
contrib/hostapd/src/ap/ieee802_11_shared.c [new file with mode: 0644]
contrib/hostapd/src/ap/ieee802_11_vht.c [new file with mode: 0644]
contrib/hostapd/src/ap/ieee802_1x.c [moved from contrib/hostapd/hostapd/ieee802_1x.c with 70% similarity]
contrib/hostapd/src/ap/ieee802_1x.h [moved from contrib/hostapd/hostapd/ieee802_1x.h with 50% similarity]
contrib/hostapd/src/ap/p2p_hostapd.c [new file with mode: 0644]
contrib/hostapd/src/ap/p2p_hostapd.h [new file with mode: 0644]
contrib/hostapd/src/ap/peerkey_auth.c [moved from contrib/hostapd/hostapd/peerkey.c with 94% similarity]
contrib/hostapd/src/ap/pmksa_cache_auth.c [moved from contrib/hostapd/hostapd/pmksa_cache.c with 73% similarity]
contrib/hostapd/src/ap/pmksa_cache_auth.h [moved from contrib/hostapd/hostapd/pmksa_cache.h with 52% similarity]
contrib/hostapd/src/ap/preauth_auth.c [moved from contrib/hostapd/hostapd/preauth.c with 92% similarity]
contrib/hostapd/src/ap/preauth_auth.h [moved from contrib/hostapd/hostapd/preauth.h with 78% similarity]
contrib/hostapd/src/ap/sta_info.c [moved from contrib/hostapd/hostapd/sta_info.c with 51% similarity]
contrib/hostapd/src/ap/sta_info.h [new file with mode: 0644]
contrib/hostapd/src/ap/tkip_countermeasures.c [new file with mode: 0644]
contrib/hostapd/src/ap/tkip_countermeasures.h [new file with mode: 0644]
contrib/hostapd/src/ap/utils.c [new file with mode: 0644]
contrib/hostapd/src/ap/vlan_init.c [moved from contrib/hostapd/hostapd/vlan_init.c with 51% similarity]
contrib/hostapd/src/ap/vlan_init.h [new file with mode: 0644]
contrib/hostapd/src/ap/vlan_util.c [new file with mode: 0644]
contrib/hostapd/src/ap/vlan_util.h [new file with mode: 0644]
contrib/hostapd/src/ap/wmm.c [moved from contrib/hostapd/hostapd/wme.c with 80% similarity]
contrib/hostapd/src/ap/wmm.h [new file with mode: 0644]
contrib/hostapd/src/ap/wnm_ap.c [new file with mode: 0644]
contrib/hostapd/src/ap/wnm_ap.h [new file with mode: 0644]
contrib/hostapd/src/ap/wpa_auth.c [moved from contrib/hostapd/hostapd/wpa.c with 64% similarity]
contrib/hostapd/src/ap/wpa_auth.h [moved from contrib/hostapd/hostapd/wpa.h with 79% similarity]
contrib/hostapd/src/ap/wpa_auth_ft.c [moved from contrib/hostapd/hostapd/wpa_ft.c with 75% similarity]
contrib/hostapd/src/ap/wpa_auth_glue.c [new file with mode: 0644]
contrib/hostapd/src/ap/wpa_auth_glue.h [new file with mode: 0644]
contrib/hostapd/src/ap/wpa_auth_i.h [moved from contrib/hostapd/hostapd/wpa_auth_i.h with 85% similarity]
contrib/hostapd/src/ap/wpa_auth_ie.c [moved from contrib/hostapd/hostapd/wpa_auth_ie.c with 71% similarity]
contrib/hostapd/src/ap/wpa_auth_ie.h [moved from contrib/hostapd/hostapd/wpa_auth_ie.h with 76% similarity]
contrib/hostapd/src/ap/wps_hostapd.c [new file with mode: 0644]
contrib/hostapd/src/ap/wps_hostapd.h [new file with mode: 0644]
contrib/hostapd/src/common/defs.h
contrib/hostapd/src/common/eapol_common.h
contrib/hostapd/src/common/gas.c [new file with mode: 0644]
contrib/hostapd/src/common/gas.h [new file with mode: 0644]
contrib/hostapd/src/common/ieee802_11_common.c
contrib/hostapd/src/common/ieee802_11_common.h
contrib/hostapd/src/common/ieee802_11_defs.h
contrib/hostapd/src/common/nl80211_copy.h [deleted file]
contrib/hostapd/src/common/privsep_commands.h
contrib/hostapd/src/common/qca-vendor.h [new file with mode: 0644]
contrib/hostapd/src/common/sae.c [new file with mode: 0644]
contrib/hostapd/src/common/sae.h [new file with mode: 0644]
contrib/hostapd/src/common/version.h
contrib/hostapd/src/common/wireless_copy.h [deleted file]
contrib/hostapd/src/common/wpa_common.c
contrib/hostapd/src/common/wpa_common.h
contrib/hostapd/src/common/wpa_ctrl.c
contrib/hostapd/src/common/wpa_ctrl.h
contrib/hostapd/src/crypto/aes-cbc.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-ccm.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-ctr.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-eax.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-encblock.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-gcm.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-internal-dec.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-internal-enc.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-internal.c [moved from contrib/hostapd-0.4.9/aes.c with 82% similarity]
contrib/hostapd/src/crypto/aes-omac1.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-unwrap.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes-wrap.c [new file with mode: 0644]
contrib/hostapd/src/crypto/aes.c [deleted file]
contrib/hostapd/src/crypto/aes.h
contrib/hostapd/src/crypto/aes_i.h [new file with mode: 0644]
contrib/hostapd/src/crypto/aes_wrap.c [deleted file]
contrib/hostapd/src/crypto/aes_wrap.h
contrib/hostapd/src/crypto/crypto.h
contrib/hostapd/src/crypto/crypto_cryptoapi.c
contrib/hostapd/src/crypto/crypto_gnutls.c
contrib/hostapd/src/crypto/crypto_internal-cipher.c [new file with mode: 0644]
contrib/hostapd/src/crypto/crypto_internal-modexp.c [new file with mode: 0644]
contrib/hostapd/src/crypto/crypto_internal-rsa.c [new file with mode: 0644]
contrib/hostapd/src/crypto/crypto_internal.c
contrib/hostapd/src/crypto/crypto_libtomcrypt.c
contrib/hostapd/src/crypto/crypto_none.c
contrib/hostapd/src/crypto/crypto_nss.c [new file with mode: 0644]
contrib/hostapd/src/crypto/crypto_openssl.c
contrib/hostapd/src/crypto/des-internal.c [moved from contrib/hostapd/src/crypto/des.c with 95% similarity]
contrib/hostapd/src/crypto/des_i.h [new file with mode: 0644]
contrib/hostapd/src/crypto/dh_group5.c [new file with mode: 0644]
contrib/hostapd/src/crypto/dh_group5.h [new file with mode: 0644]
contrib/hostapd/src/crypto/dh_groups.c
contrib/hostapd/src/crypto/dh_groups.h
contrib/hostapd/src/crypto/fips_prf_cryptoapi.c [new file with mode: 0644]
contrib/hostapd/src/crypto/fips_prf_gnutls.c [new file with mode: 0644]
contrib/hostapd/src/crypto/fips_prf_internal.c [new file with mode: 0644]
contrib/hostapd/src/crypto/fips_prf_nss.c [new file with mode: 0644]
contrib/hostapd/src/crypto/fips_prf_openssl.c [new file with mode: 0644]
contrib/hostapd/src/crypto/md4-internal.c [moved from contrib/hostapd/src/crypto/md4.c with 94% similarity]
contrib/hostapd/src/crypto/md5-internal.c [moved from contrib/hostapd-0.4.9/md5.c with 68% similarity]
contrib/hostapd/src/crypto/md5.c
contrib/hostapd/src/crypto/md5.h
contrib/hostapd/src/crypto/md5_i.h [new file with mode: 0644]
contrib/hostapd/src/crypto/milenage.c [new file with mode: 0644]
contrib/hostapd/src/crypto/milenage.h [moved from contrib/hostapd/src/hlr_auc_gw/milenage.h with 67% similarity]
contrib/hostapd/src/crypto/ms_funcs.c
contrib/hostapd/src/crypto/ms_funcs.h
contrib/hostapd/src/crypto/random.c [new file with mode: 0644]
contrib/hostapd/src/crypto/random.h [new file with mode: 0644]
contrib/hostapd/src/crypto/rc4.c
contrib/hostapd/src/crypto/rc4.h [deleted file]
contrib/hostapd/src/crypto/sha1-internal.c [new file with mode: 0644]
contrib/hostapd/src/crypto/sha1-pbkdf2.c [new file with mode: 0644]
contrib/hostapd/src/crypto/sha1-prf.c [new file with mode: 0644]
contrib/hostapd/src/crypto/sha1-tlsprf.c [new file with mode: 0644]
contrib/hostapd/src/crypto/sha1-tprf.c [new file with mode: 0644]
contrib/hostapd/src/crypto/sha1.c
contrib/hostapd/src/crypto/sha1.h
contrib/hostapd/src/crypto/sha1_i.h [new file with mode: 0644]
contrib/hostapd/src/crypto/sha256-internal.c [copied from contrib/hostapd/src/crypto/sha256.c with 50% similarity]
contrib/hostapd/src/crypto/sha256-prf.c [new file with mode: 0644]
contrib/hostapd/src/crypto/sha256-tlsprf.c [new file with mode: 0644]
contrib/hostapd/src/crypto/sha256.c
contrib/hostapd/src/crypto/sha256.h
contrib/hostapd/src/crypto/sha256_i.h [new file with mode: 0644]
contrib/hostapd/src/crypto/tls.h
contrib/hostapd/src/crypto/tls_gnutls.c
contrib/hostapd/src/crypto/tls_internal.c
contrib/hostapd/src/crypto/tls_none.c
contrib/hostapd/src/crypto/tls_nss.c [new file with mode: 0644]
contrib/hostapd/src/crypto/tls_openssl.c
contrib/hostapd/src/crypto/tls_schannel.c
contrib/hostapd/src/drivers/Apple80211.h [deleted file]
contrib/hostapd/src/drivers/MobileApple80211.c [deleted file]
contrib/hostapd/src/drivers/MobileApple80211.h [deleted file]
contrib/hostapd/src/drivers/android_drv.h [new file with mode: 0644]
contrib/hostapd/src/drivers/driver.h
contrib/hostapd/src/drivers/driver_atheros.c [new file with mode: 0644]
contrib/hostapd/src/drivers/driver_atmel.c [deleted file]
contrib/hostapd/src/drivers/driver_broadcom.c [deleted file]
contrib/hostapd/src/drivers/driver_bsd.c
contrib/hostapd/src/drivers/driver_common.c [new file with mode: 0644]
contrib/hostapd/src/drivers/driver_hostap.c
contrib/hostapd/src/drivers/driver_hostap.h
contrib/hostapd/src/drivers/driver_ipw.c [deleted file]
contrib/hostapd/src/drivers/driver_madwifi.c
contrib/hostapd/src/drivers/driver_ndis.c
contrib/hostapd/src/drivers/driver_ndis.h
contrib/hostapd/src/drivers/driver_ndis_.c
contrib/hostapd/src/drivers/driver_ndiswrapper.c [deleted file]
contrib/hostapd/src/drivers/driver_nl80211.c
contrib/hostapd/src/drivers/driver_none.c [new file with mode: 0644]
contrib/hostapd/src/drivers/driver_openbsd.c [new file with mode: 0644]
contrib/hostapd/src/drivers/driver_prism54.c [deleted file]
contrib/hostapd/src/drivers/driver_privsep.c
contrib/hostapd/src/drivers/driver_ps3.c [deleted file]
contrib/hostapd/src/drivers/driver_ralink.c [deleted file]
contrib/hostapd/src/drivers/driver_ralink.h [deleted file]
contrib/hostapd/src/drivers/driver_roboswitch.c
contrib/hostapd/src/drivers/driver_test.c
contrib/hostapd/src/drivers/driver_wext.c
contrib/hostapd/src/drivers/driver_wext.h
contrib/hostapd/src/drivers/driver_wired.c
contrib/hostapd/src/drivers/drivers.c
contrib/hostapd/src/drivers/linux_ioctl.c [new file with mode: 0644]
contrib/hostapd/src/drivers/linux_ioctl.h [new file with mode: 0644]
contrib/hostapd/src/drivers/linux_wext.h [new file with mode: 0644]
contrib/hostapd/src/drivers/ndis_events.c
contrib/hostapd/src/drivers/netlink.c [new file with mode: 0644]
contrib/hostapd/src/drivers/netlink.h [new file with mode: 0644]
contrib/hostapd/src/drivers/nl80211_copy.h [new file with mode: 0644]
contrib/hostapd/src/drivers/priv_netlink.h
contrib/hostapd/src/drivers/radiotap.c [deleted file]
contrib/hostapd/src/drivers/radiotap_iter.h [deleted file]
contrib/hostapd/src/drivers/rfkill.c [new file with mode: 0644]
contrib/hostapd/src/drivers/rfkill.h [new file with mode: 0644]
contrib/hostapd/src/drivers/scan_helpers.c [deleted file]
contrib/hostapd/src/eap_common/chap.c
contrib/hostapd/src/eap_common/chap.h
contrib/hostapd/src/eap_common/eap_common.c
contrib/hostapd/src/eap_common/eap_common.h
contrib/hostapd/src/eap_common/eap_defs.h
contrib/hostapd/src/eap_common/eap_eke_common.c [new file with mode: 0644]
contrib/hostapd/src/eap_common/eap_eke_common.h [new file with mode: 0644]
contrib/hostapd/src/eap_common/eap_fast_common.c
contrib/hostapd/src/eap_common/eap_fast_common.h
contrib/hostapd/src/eap_common/eap_gpsk_common.c
contrib/hostapd/src/eap_common/eap_gpsk_common.h
contrib/hostapd/src/eap_common/eap_ikev2_common.c
contrib/hostapd/src/eap_common/eap_ikev2_common.h
contrib/hostapd/src/eap_common/eap_pax_common.c
contrib/hostapd/src/eap_common/eap_pax_common.h
contrib/hostapd/src/eap_common/eap_peap_common.c
contrib/hostapd/src/eap_common/eap_peap_common.h
contrib/hostapd/src/eap_common/eap_psk_common.c
contrib/hostapd/src/eap_common/eap_psk_common.h
contrib/hostapd/src/eap_common/eap_pwd_common.c [new file with mode: 0644]
contrib/hostapd/src/eap_common/eap_pwd_common.h [new file with mode: 0644]
contrib/hostapd/src/eap_common/eap_sake_common.c
contrib/hostapd/src/eap_common/eap_sake_common.h
contrib/hostapd/src/eap_common/eap_sim_common.c
contrib/hostapd/src/eap_common/eap_sim_common.h
contrib/hostapd/src/eap_common/eap_tlv_common.h
contrib/hostapd/src/eap_common/eap_ttls.h
contrib/hostapd/src/eap_common/eap_wsc_common.c
contrib/hostapd/src/eap_common/eap_wsc_common.h
contrib/hostapd/src/eap_common/ikev2_common.c
contrib/hostapd/src/eap_common/ikev2_common.h
contrib/hostapd/src/eap_peer/eap.c
contrib/hostapd/src/eap_peer/eap.h
contrib/hostapd/src/eap_peer/eap_aka.c
contrib/hostapd/src/eap_peer/eap_config.h
contrib/hostapd/src/eap_peer/eap_eke.c [new file with mode: 0644]
contrib/hostapd/src/eap_peer/eap_fast.c
contrib/hostapd/src/eap_peer/eap_fast_pac.c
contrib/hostapd/src/eap_peer/eap_fast_pac.h
contrib/hostapd/src/eap_peer/eap_gpsk.c
contrib/hostapd/src/eap_peer/eap_gtc.c
contrib/hostapd/src/eap_peer/eap_i.h
contrib/hostapd/src/eap_peer/eap_ikev2.c
contrib/hostapd/src/eap_peer/eap_leap.c
contrib/hostapd/src/eap_peer/eap_md5.c
contrib/hostapd/src/eap_peer/eap_methods.c
contrib/hostapd/src/eap_peer/eap_methods.h
contrib/hostapd/src/eap_peer/eap_mschapv2.c
contrib/hostapd/src/eap_peer/eap_otp.c
contrib/hostapd/src/eap_peer/eap_pax.c
contrib/hostapd/src/eap_peer/eap_peap.c
contrib/hostapd/src/eap_peer/eap_proxy.h [new file with mode: 0644]
contrib/hostapd/src/eap_peer/eap_proxy_dummy.c [new file with mode: 0644]
contrib/hostapd/src/eap_peer/eap_psk.c
contrib/hostapd/src/eap_peer/eap_pwd.c [new file with mode: 0644]
contrib/hostapd/src/eap_peer/eap_sake.c
contrib/hostapd/src/eap_peer/eap_sim.c
contrib/hostapd/src/eap_peer/eap_tls.c
contrib/hostapd/src/eap_peer/eap_tls_common.c
contrib/hostapd/src/eap_peer/eap_tls_common.h
contrib/hostapd/src/eap_peer/eap_tnc.c
contrib/hostapd/src/eap_peer/eap_ttls.c
contrib/hostapd/src/eap_peer/eap_vendor_test.c
contrib/hostapd/src/eap_peer/eap_wsc.c
contrib/hostapd/src/eap_peer/ikev2.c
contrib/hostapd/src/eap_peer/ikev2.h
contrib/hostapd/src/eap_peer/mschapv2.c
contrib/hostapd/src/eap_peer/mschapv2.h
contrib/hostapd/src/eap_peer/tncc.c
contrib/hostapd/src/eap_peer/tncc.h
contrib/hostapd/src/eap_server/eap.h
contrib/hostapd/src/eap_server/eap_i.h
contrib/hostapd/src/eap_server/eap_methods.h
contrib/hostapd/src/eap_server/eap_server.c [moved from contrib/hostapd/src/eap_server/eap.c with 93% similarity]
contrib/hostapd/src/eap_server/eap_server_aka.c [moved from contrib/hostapd/src/eap_server/eap_aka.c with 78% similarity]
contrib/hostapd/src/eap_server/eap_server_eke.c [new file with mode: 0644]
contrib/hostapd/src/eap_server/eap_server_fast.c [moved from contrib/hostapd/src/eap_server/eap_fast.c with 94% similarity]
contrib/hostapd/src/eap_server/eap_server_gpsk.c [moved from contrib/hostapd/src/eap_server/eap_gpsk.c with 93% similarity]
contrib/hostapd/src/eap_server/eap_server_gtc.c [moved from contrib/hostapd/src/eap_server/eap_gtc.c with 92% similarity]
contrib/hostapd/src/eap_server/eap_server_identity.c [moved from contrib/hostapd/src/eap_server/eap_identity.c with 91% similarity]
contrib/hostapd/src/eap_server/eap_server_ikev2.c [moved from contrib/hostapd/src/eap_server/eap_ikev2.c with 96% similarity]
contrib/hostapd/src/eap_server/eap_server_md5.c [moved from contrib/hostapd/src/eap_server/eap_md5.c with 87% similarity]
contrib/hostapd/src/eap_server/eap_server_methods.c [moved from contrib/hostapd/src/eap_server/eap_methods.c with 50% similarity]
contrib/hostapd/src/eap_server/eap_server_mschapv2.c [moved from contrib/hostapd/src/eap_server/eap_mschapv2.c with 93% similarity]
contrib/hostapd/src/eap_server/eap_server_pax.c [moved from contrib/hostapd/src/eap_server/eap_pax.c with 97% similarity]
contrib/hostapd/src/eap_server/eap_server_peap.c [moved from contrib/hostapd/src/eap_server/eap_peap.c with 81% similarity]
contrib/hostapd/src/eap_server/eap_server_psk.c [moved from contrib/hostapd/src/eap_server/eap_psk.c with 92% similarity]
contrib/hostapd/src/eap_server/eap_server_pwd.c [new file with mode: 0644]
contrib/hostapd/src/eap_server/eap_server_sake.c [moved from contrib/hostapd/src/eap_server/eap_sake.c with 90% similarity]
contrib/hostapd/src/eap_server/eap_server_sim.c [moved from contrib/hostapd/src/eap_server/eap_sim.c with 77% similarity]
contrib/hostapd/src/eap_server/eap_server_tls.c [moved from contrib/hostapd/src/eap_server/eap_tls.c with 73% similarity]
contrib/hostapd/src/eap_server/eap_server_tls_common.c [moved from contrib/hostapd/src/eap_server/eap_tls_common.c with 67% similarity]
contrib/hostapd/src/eap_server/eap_server_tnc.c [moved from contrib/hostapd/src/eap_server/eap_tnc.c with 84% similarity]
contrib/hostapd/src/eap_server/eap_server_ttls.c [moved from contrib/hostapd/src/eap_server/eap_ttls.c with 75% similarity]
contrib/hostapd/src/eap_server/eap_server_vendor_test.c [moved from contrib/hostapd/src/eap_server/eap_vendor_test.c with 91% similarity]
contrib/hostapd/src/eap_server/eap_server_wsc.c [moved from contrib/hostapd/src/eap_server/eap_wsc.c with 89% similarity]
contrib/hostapd/src/eap_server/eap_sim_db.c
contrib/hostapd/src/eap_server/eap_sim_db.h
contrib/hostapd/src/eap_server/eap_tls_common.h
contrib/hostapd/src/eap_server/ikev2.c
contrib/hostapd/src/eap_server/ikev2.h
contrib/hostapd/src/eap_server/tncs.c
contrib/hostapd/src/eap_server/tncs.h
contrib/hostapd/src/eapol_auth/eapol_auth_dump.c [new file with mode: 0644]
contrib/hostapd/src/eapol_auth/eapol_auth_sm.c [moved from contrib/hostapd/hostapd/eapol_sm.c with 74% similarity]
contrib/hostapd/src/eapol_auth/eapol_auth_sm.h [new file with mode: 0644]
contrib/hostapd/src/eapol_auth/eapol_auth_sm_i.h [moved from contrib/hostapd/hostapd/eapol_sm.h with 60% similarity]
contrib/hostapd/src/eapol_supp/eapol_supp_sm.c
contrib/hostapd/src/eapol_supp/eapol_supp_sm.h
contrib/hostapd/src/hlr_auc_gw/hlr_auc_gw.c [deleted file]
contrib/hostapd/src/hlr_auc_gw/milenage.c [deleted file]
contrib/hostapd/src/l2_packet/l2_packet.h
contrib/hostapd/src/l2_packet/l2_packet_freebsd.c
contrib/hostapd/src/l2_packet/l2_packet_linux.c
contrib/hostapd/src/l2_packet/l2_packet_ndis.c
contrib/hostapd/src/l2_packet/l2_packet_none.c
contrib/hostapd/src/l2_packet/l2_packet_pcap.c
contrib/hostapd/src/l2_packet/l2_packet_privsep.c
contrib/hostapd/src/l2_packet/l2_packet_winpcap.c
contrib/hostapd/src/p2p/p2p.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p.h [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_build.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_dev_disc.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_go_neg.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_group.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_i.h [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_invitation.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_parse.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_pd.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_sd.c [new file with mode: 0644]
contrib/hostapd/src/p2p/p2p_utils.c [new file with mode: 0644]
contrib/hostapd/src/radius/radius.c
contrib/hostapd/src/radius/radius.h
contrib/hostapd/src/radius/radius_client.c
contrib/hostapd/src/radius/radius_client.h
contrib/hostapd/src/radius/radius_das.c [new file with mode: 0644]
contrib/hostapd/src/radius/radius_das.h [new file with mode: 0644]
contrib/hostapd/src/radius/radius_server.c
contrib/hostapd/src/radius/radius_server.h
contrib/hostapd/src/rsn_supp/peerkey.c
contrib/hostapd/src/rsn_supp/peerkey.h
contrib/hostapd/src/rsn_supp/pmksa_cache.c
contrib/hostapd/src/rsn_supp/pmksa_cache.h
contrib/hostapd/src/rsn_supp/preauth.c
contrib/hostapd/src/rsn_supp/preauth.h
contrib/hostapd/src/rsn_supp/tdls.c [new file with mode: 0644]
contrib/hostapd/src/rsn_supp/wpa.c
contrib/hostapd/src/rsn_supp/wpa.h
contrib/hostapd/src/rsn_supp/wpa_ft.c
contrib/hostapd/src/rsn_supp/wpa_i.h
contrib/hostapd/src/rsn_supp/wpa_ie.c
contrib/hostapd/src/rsn_supp/wpa_ie.h
contrib/hostapd/src/tls/asn1.c
contrib/hostapd/src/tls/asn1.h
contrib/hostapd/src/tls/asn1_test.c [deleted file]
contrib/hostapd/src/tls/bignum.c
contrib/hostapd/src/tls/bignum.h
contrib/hostapd/src/tls/libtommath.c
contrib/hostapd/src/tls/pkcs1.c [new file with mode: 0644]
contrib/hostapd/src/tls/pkcs1.h [new file with mode: 0644]
contrib/hostapd/src/tls/pkcs5.c [new file with mode: 0644]
contrib/hostapd/src/tls/pkcs5.h [new file with mode: 0644]
contrib/hostapd/src/tls/pkcs8.c [new file with mode: 0644]
contrib/hostapd/src/tls/pkcs8.h [new file with mode: 0644]
contrib/hostapd/src/tls/rsa.c
contrib/hostapd/src/tls/rsa.h
contrib/hostapd/src/tls/tlsv1_client.c
contrib/hostapd/src/tls/tlsv1_client.h
contrib/hostapd/src/tls/tlsv1_client_i.h
contrib/hostapd/src/tls/tlsv1_client_read.c
contrib/hostapd/src/tls/tlsv1_client_write.c
contrib/hostapd/src/tls/tlsv1_common.c
contrib/hostapd/src/tls/tlsv1_common.h
contrib/hostapd/src/tls/tlsv1_cred.c
contrib/hostapd/src/tls/tlsv1_cred.h
contrib/hostapd/src/tls/tlsv1_record.c
contrib/hostapd/src/tls/tlsv1_record.h
contrib/hostapd/src/tls/tlsv1_server.c
contrib/hostapd/src/tls/tlsv1_server.h
contrib/hostapd/src/tls/tlsv1_server_i.h
contrib/hostapd/src/tls/tlsv1_server_read.c
contrib/hostapd/src/tls/tlsv1_server_write.c
contrib/hostapd/src/tls/x509v3.c
contrib/hostapd/src/tls/x509v3.h
contrib/hostapd/src/utils/base64.c
contrib/hostapd/src/utils/base64.h
contrib/hostapd/src/utils/bitfield.c [new file with mode: 0644]
contrib/hostapd/src/utils/bitfield.h [new file with mode: 0644]
contrib/hostapd/src/utils/build_config.h
contrib/hostapd/src/utils/common.c
contrib/hostapd/src/utils/common.h
contrib/hostapd/src/utils/edit.c [new file with mode: 0644]
contrib/hostapd/src/utils/edit.h [new file with mode: 0644]
contrib/hostapd/src/utils/edit_readline.c [new file with mode: 0644]
contrib/hostapd/src/utils/edit_simple.c [new file with mode: 0644]
contrib/hostapd/src/utils/eloop.c
contrib/hostapd/src/utils/eloop.h
contrib/hostapd/src/utils/eloop_none.c [deleted file]
contrib/hostapd/src/utils/eloop_win.c
contrib/hostapd/src/utils/ext_password.c [new file with mode: 0644]
contrib/hostapd/src/utils/ext_password.h [new file with mode: 0644]
contrib/hostapd/src/utils/ext_password_i.h [new file with mode: 0644]
contrib/hostapd/src/utils/ext_password_test.c [new file with mode: 0644]
contrib/hostapd/src/utils/includes.h
contrib/hostapd/src/utils/ip_addr.c
contrib/hostapd/src/utils/ip_addr.h
contrib/hostapd/src/utils/list.h [new file with mode: 0644]
contrib/hostapd/src/utils/os.h
contrib/hostapd/src/utils/os_internal.c
contrib/hostapd/src/utils/os_none.c
contrib/hostapd/src/utils/os_unix.c
contrib/hostapd/src/utils/os_win32.c
contrib/hostapd/src/utils/pcsc_funcs.c
contrib/hostapd/src/utils/pcsc_funcs.h
contrib/hostapd/src/utils/radiotap.c [moved from contrib/hostapd/hostapd/radiotap.c with 100% similarity]
contrib/hostapd/src/utils/radiotap.h [moved from contrib/hostapd/src/drivers/radiotap.h with 99% similarity]
contrib/hostapd/src/utils/radiotap_iter.h [moved from contrib/hostapd/hostapd/radiotap_iter.h with 75% similarity]
contrib/hostapd/src/utils/state_machine.h
contrib/hostapd/src/utils/trace.c [new file with mode: 0644]
contrib/hostapd/src/utils/trace.h [new file with mode: 0644]
contrib/hostapd/src/utils/uuid.c
contrib/hostapd/src/utils/uuid.h
contrib/hostapd/src/utils/wpa_debug.c
contrib/hostapd/src/utils/wpa_debug.h
contrib/hostapd/src/utils/wpabuf.c
contrib/hostapd/src/utils/wpabuf.h
contrib/hostapd/src/wps/http.h [new file with mode: 0644]
contrib/hostapd/src/wps/http_client.c [new file with mode: 0644]
contrib/hostapd/src/wps/http_client.h [new file with mode: 0644]
contrib/hostapd/src/wps/http_server.c [new file with mode: 0644]
contrib/hostapd/src/wps/http_server.h [new file with mode: 0644]
contrib/hostapd/src/wps/httpread.c
contrib/hostapd/src/wps/httpread.h
contrib/hostapd/src/wps/ndef.c [new file with mode: 0644]
contrib/hostapd/src/wps/upnp_xml.c [new file with mode: 0644]
contrib/hostapd/src/wps/upnp_xml.h [new file with mode: 0644]
contrib/hostapd/src/wps/wps.c
contrib/hostapd/src/wps/wps.h
contrib/hostapd/src/wps/wps_attr_build.c
contrib/hostapd/src/wps/wps_attr_parse.c
contrib/hostapd/src/wps/wps_attr_parse.h [new file with mode: 0644]
contrib/hostapd/src/wps/wps_attr_process.c
contrib/hostapd/src/wps/wps_common.c
contrib/hostapd/src/wps/wps_defs.h
contrib/hostapd/src/wps/wps_dev_attr.c
contrib/hostapd/src/wps/wps_dev_attr.h
contrib/hostapd/src/wps/wps_enrollee.c
contrib/hostapd/src/wps/wps_er.c [new file with mode: 0644]
contrib/hostapd/src/wps/wps_er.h [new file with mode: 0644]
contrib/hostapd/src/wps/wps_er_ssdp.c [new file with mode: 0644]
contrib/hostapd/src/wps/wps_i.h
contrib/hostapd/src/wps/wps_registrar.c
contrib/hostapd/src/wps/wps_upnp.c
contrib/hostapd/src/wps/wps_upnp.h
contrib/hostapd/src/wps/wps_upnp_ap.c [new file with mode: 0644]
contrib/hostapd/src/wps/wps_upnp_event.c
contrib/hostapd/src/wps/wps_upnp_i.h
contrib/hostapd/src/wps/wps_upnp_ssdp.c
contrib/hostapd/src/wps/wps_upnp_web.c
contrib/hostapd/src/wps/wps_validate.c [new file with mode: 0644]

diff --git a/contrib/hostapd-0.4.9/COPYING b/contrib/hostapd-0.4.9/COPYING
deleted file mode 100644 (file)
index 60549be..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-\f
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-\f
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-\f
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) 19yy  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) 19yy name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/contrib/hostapd-0.4.9/README b/contrib/hostapd-0.4.9/README
deleted file mode 100644 (file)
index 13f38ee..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
-hostapd - user space IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP
-         Authenticator and RADIUS authentication server
-================================================================
-
-Copyright (c) 2002-2006, Jouni Malinen <jkmaline@cc.hut.fi> and
-contributors
-All Rights Reserved.
-
-This program is dual-licensed under both the GPL version 2 and BSD
-license. Either license may be used at your option.
-
-
-
-License
--------
-
-GPL v2:
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 2 as
-published by the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-(this copy of the license is in COPYING file)
-
-
-Alternatively, this software may be distributed under the terms of BSD
-license:
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-
-3. Neither the name(s) of the above-listed copyright holder(s) nor the
-   names of its contributors may be used to endorse or promote products
-   derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-Introduction
-============
-
-Originally, hostapd was an optional user space component for Host AP
-driver. It adds more features to the basic IEEE 802.11 management
-included in the kernel driver: using external RADIUS authentication
-server for MAC address based access control, IEEE 802.1X Authenticator
-and dynamic WEP keying, RADIUS accounting, WPA/WPA2 (IEEE 802.11i/RSN)
-Authenticator and dynamic TKIP/CCMP keying.
-
-The current version includes support for other drivers, an integrated
-EAP server (i.e., allow full authentication without requiring
-an external RADIUS authentication server), and RADIUS authentication
-server for EAP authentication.
-
-
-Requirements
-------------
-
-Current hardware/software requirements:
-- drivers:
-       Host AP driver for Prism2/2.5/3.
-       (http://hostap.epitest.fi/)
-       Please note that station firmware version needs to be 1.7.0 or newer
-       to work in WPA mode.
-
-       madwifi driver for cards based on Atheros chip set (ar521x)
-       (http://sourceforge.net/projects/madwifi/)
-       Please note that you will need to add the correct path for
-       madwifi driver root directory in .config (see defconfig file for
-       an example: CFLAGS += -I<path>)
-
-       Prism54 driver for Intersil/Conexant Prism GT/Duette/Indigo
-       (http://www.prism54.org/)
-
-       Any wired Ethernet driver for wired IEEE 802.1X authentication
-       (experimental code)
-
-       FreeBSD -current (with some kernel mods that have not yet been
-       committed when hostapd v0.3.0 was released)
-       BSD net80211 layer (e.g., Atheros driver)
-
-
-Build configuration
--------------------
-
-In order to be able to build hostapd, you will need to create a build
-time configuration file, .config that selects which optional
-components are included. See defconfig file for example configuration
-and list of available options.
-
-
-
-IEEE 802.1X
-===========
-
-IEEE Std 802.1X-2001 is a standard for port-based network access
-control. In case of IEEE 802.11 networks, a "virtual port" is used
-between each associated station and the AP. IEEE 802.11 specifies
-minimal authentication mechanism for stations, whereas IEEE 802.1X
-introduces a extensible mechanism for authenticating and authorizing
-users.
-
-IEEE 802.1X uses elements called Supplicant, Authenticator, Port
-Access Entity, and Authentication Server. Supplicant is a component in
-a station and it performs the authentication with the Authentication
-Server. An access point includes an Authenticator that relays the packets
-between a Supplicant and an Authentication Server. In addition, it has a
-Port Access Entity (PAE) with Authenticator functionality for
-controlling the virtual port authorization, i.e., whether to accept
-packets from or to the station.
-
-IEEE 802.1X uses Extensible Authentication Protocol (EAP). The frames
-between a Supplicant and an Authenticator are sent using EAP over LAN
-(EAPOL) and the Authenticator relays these frames to the Authentication
-Server (and similarly, relays the messages from the Authentication
-Server to the Supplicant). The Authentication Server can be colocated with the
-Authenticator, in which case there is no need for additional protocol
-for EAP frame transmission. However, a more common configuration is to
-use an external Authentication Server and encapsulate EAP frame in the
-frames used by that server. RADIUS is suitable for this, but IEEE
-802.1X would also allow other mechanisms.
-
-Host AP driver includes PAE functionality in the kernel driver. It
-is a relatively simple mechanism for denying normal frames going to
-or coming from an unauthorized port. PAE allows IEEE 802.1X related
-frames to be passed between the Supplicant and the Authenticator even
-on an unauthorized port.
-
-User space daemon, hostapd, includes Authenticator functionality. It
-receives 802.1X (EAPOL) frames from the Supplicant using the wlan#ap
-device that is also used with IEEE 802.11 management frames. The
-frames to the Supplicant are sent using the same device.
-
-hostapd includes a minimal colocated Authentication Server for testing
-purposes. It only requests the identity of the Supplicant and
-authorizes any host that is able to send a valid EAP Response
-frame. This can be used for quick testing since it does not require an
-external Authentication Server, but it should not be used for any real
-authentication purposes since no keys are required and anyone can
-authenticate.
-
-The normal configuration of the Authenticator would use an external
-Authentication Server. hostapd supports RADIUS encapsulation of EAP
-packets, so the Authentication Server should be a RADIUS server, like
-FreeRADIUS (http://www.freeradius.org/). The Authenticator in hostapd
-relays the frames between the Supplicant and the Authentication
-Server. It also controls the PAE functionality in the kernel driver by
-controlling virtual port authorization, i.e., station-AP
-connection, based on the IEEE 802.1X state.
-
-When a station would like to use the services of an access point, it
-will first perform IEEE 802.11 authentication. This is normally done
-with open systems authentication, so there is no security. After
-this, IEEE 802.11 association is performed. If IEEE 802.1X is
-configured to be used, the virtual port for the station is set in
-Unauthorized state and only IEEE 802.1X frames are accepted at this
-point. The Authenticator will then ask the Supplicant to authenticate
-with the Authentication Server. After this is completed successfully,
-the virtual port is set to Authorized state and frames from and to the
-station are accepted.
-
-Host AP configuration for IEEE 802.1X
--------------------------------------
-
-The user space daemon has its own configuration file that can be used to
-define AP options. Distribution package contains an example
-configuration file (hostapd/hostapd.conf) that can be used as a basis
-for configuration. It includes examples of all supported configuration
-options and short description of each option. hostapd should be started
-with full path to the configuration file as the command line argument,
-e.g., './hostapd /etc/hostapd.conf'. If you have more that one wireless
-LAN card, you can use one hostapd process for multiple interfaces by
-giving a list of configuration files (one per interface) in the command
-line.
-
-hostapd includes a minimal co-located IEEE 802.1X server which can be
-used to test IEEE 802.1X authentication. However, it should not be
-used in normal use since it does not provide any security. This can be
-configured by setting ieee8021x and minimal_eap options in the
-configuration file.
-
-An external Authentication Server (RADIUS) is configured with
-auth_server_{addr,port,shared_secret} options. In addition,
-ieee8021x and own_ip_addr must be set for this mode. With such
-configuration, the co-located Authentication Server is not used and EAP
-frames will be relayed using EAPOL between the Supplicant and the
-Authenticator and RADIUS encapsulation between the Authenticator and
-the Authentication Server. Other than this, the functionality is similar
-to the case with the co-located Authentication Server.
-
-Authentication Server and Supplicant
-------------------------------------
-
-Any RADIUS server supporting EAP should be usable as an IEEE 802.1X
-Authentication Server with hostapd Authenticator. FreeRADIUS
-(http://www.freeradius.org/) has been successfully tested with hostapd
-Authenticator and both Xsupplicant (http://www.open1x.org) and Windows
-XP Supplicants. EAP/TLS was used with Xsupplicant and
-EAP/MD5-Challenge with Windows XP.
-
-http://www.missl.cs.umd.edu/wireless/eaptls/ has useful information
-about using EAP/TLS with FreeRADIUS and Xsupplicant (just replace
-Cisco access point with Host AP driver, hostapd daemon, and a Prism2
-card ;-). http://www.freeradius.org/doc/EAP-MD5.html has information
-about using EAP/MD5 with FreeRADIUS, including instructions for WinXP
-configuration. http://www.denobula.com/EAPTLS.pdf has a HOWTO on
-EAP/TLS use with WinXP Supplicant.
-
-Automatic WEP key configuration
--------------------------------
-
-EAP/TLS generates a session key that can be used to send WEP keys from
-an AP to authenticated stations. The Authenticator in hostapd can be
-configured to automatically select a random default/broadcast key
-(shared by all authenticated stations) with wep_key_len_broadcast
-option (5 for 40-bit WEP or 13 for 104-bit WEP). In addition,
-wep_key_len_unicast option can be used to configure individual unicast
-keys for stations. This requires support for individual keys in the
-station driver.
-
-WEP keys can be automatically updated by configuring rekeying. This
-will improve security of the network since same WEP key will only be
-used for a limited period of time. wep_rekey_period option sets the
-interval for rekeying in seconds.
-
-
-WPA/WPA2
-========
-
-Features
---------
-
-Supported WPA/IEEE 802.11i features:
-- WPA-PSK ("WPA-Personal")
-- WPA with EAP (e.g., with RADIUS authentication server) ("WPA-Enterprise")
-- key management for CCMP, TKIP, WEP104, WEP40
-- RSN/WPA2 (IEEE 802.11i), including PMKSA caching and pre-authentication
-
-WPA
----
-
-The original security mechanism of IEEE 802.11 standard was not
-designed to be strong and has proved to be insufficient for most
-networks that require some kind of security. Task group I (Security)
-of IEEE 802.11 working group (http://www.ieee802.org/11/) has worked
-to address the flaws of the base standard and has in practice
-completed its work in May 2004. The IEEE 802.11i amendment to the IEEE
-802.11 standard was approved in June 2004 and this amendment is likely
-to be published in July 2004.
-
-Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the
-IEEE 802.11i work (draft 3.0) to define a subset of the security
-enhancements that can be implemented with existing wlan hardware. This
-is called Wi-Fi Protected Access<TM> (WPA). This has now become a
-mandatory component of interoperability testing and certification done
-by Wi-Fi Alliance. Wi-Fi provides information about WPA at its web
-site (http://www.wi-fi.org/OpenSection/protected_access.asp).
-
-IEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm
-for protecting wireless networks. WEP uses RC4 with 40-bit keys,
-24-bit initialization vector (IV), and CRC32 to protect against packet
-forgery. All these choices have proven to be insufficient: key space is
-too small against current attacks, RC4 key scheduling is insufficient
-(beginning of the pseudorandom stream should be skipped), IV space is
-too small and IV reuse makes attacks easier, there is no replay
-protection, and non-keyed authentication does not protect against bit
-flipping packet data.
-
-WPA is an intermediate solution for the security issues. It uses
-Temporal Key Integrity Protocol (TKIP) to replace WEP. TKIP is a
-compromise on strong security and possibility to use existing
-hardware. It still uses RC4 for the encryption like WEP, but with
-per-packet RC4 keys. In addition, it implements replay protection,
-keyed packet authentication mechanism (Michael MIC).
-
-Keys can be managed using two different mechanisms. WPA can either use
-an external authentication server (e.g., RADIUS) and EAP just like
-IEEE 802.1X is using or pre-shared keys without need for additional
-servers. Wi-Fi calls these "WPA-Enterprise" and "WPA-Personal",
-respectively. Both mechanisms will generate a master session key for
-the Authenticator (AP) and Supplicant (client station).
-
-WPA implements a new key handshake (4-Way Handshake and Group Key
-Handshake) for generating and exchanging data encryption keys between
-the Authenticator and Supplicant. This handshake is also used to
-verify that both Authenticator and Supplicant know the master session
-key. These handshakes are identical regardless of the selected key
-management mechanism (only the method for generating master session
-key changes).
-
-
-IEEE 802.11i / WPA2
--------------------
-
-The design for parts of IEEE 802.11i that were not included in WPA has
-finished (May 2004) and this amendment to IEEE 802.11 was approved in
-June 2004. Wi-Fi Alliance is using the final IEEE 802.11i as a new
-version of WPA called WPA2. This includes, e.g., support for more
-robust encryption algorithm (CCMP: AES in Counter mode with CBC-MAC)
-to replace TKIP and optimizations for handoff (reduced number of
-messages in initial key handshake, pre-authentication, and PMKSA caching).
-
-Some wireless LAN vendors are already providing support for CCMP in
-their WPA products. There is no "official" interoperability
-certification for CCMP and/or mixed modes using both TKIP and CCMP, so
-some interoperability issues can be expected even though many
-combinations seem to be working with equipment from different vendors.
-Testing for WPA2 is likely to start during the second half of 2004.
-
-hostapd configuration for WPA/WPA2
-----------------------------------
-
-TODO
-
-# Enable WPA. Setting this variable configures the AP to require WPA (either
-# WPA-PSK or WPA-RADIUS/EAP based on other configuration). For WPA-PSK, either
-# wpa_psk or wpa_passphrase must be set and wpa_key_mgmt must include WPA-PSK.
-# For WPA-RADIUS/EAP, ieee8021x must be set (but without dynamic WEP keys),
-# RADIUS authentication server must be configured, and WPA-EAP must be included
-# in wpa_key_mgmt.
-# This field is a bit field that can be used to enable WPA (IEEE 802.11i/D3.0)
-# and/or WPA2 (full IEEE 802.11i/RSN):
-# bit0 = WPA
-# bit1 = IEEE 802.11i/RSN (WPA2)
-#wpa=1
-
-# WPA pre-shared keys for WPA-PSK. This can be either entered as a 256-bit
-# secret in hex format (64 hex digits), wpa_psk, or as an ASCII passphrase
-# (8..63 characters) that will be converted to PSK. This conversion uses SSID
-# so the PSK changes when ASCII passphrase is used and the SSID is changed.
-#wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
-#wpa_passphrase=secret passphrase
-
-# Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The
-# entries are separated with a space.
-#wpa_key_mgmt=WPA-PSK WPA-EAP
-
-# Set of accepted cipher suites (encryption algorithms) for pairwise keys
-# (unicast packets). This is a space separated list of algorithms:
-# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i]
-# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i]
-# Group cipher suite (encryption algorithm for broadcast and multicast frames)
-# is automatically selected based on this configuration. If only CCMP is
-# allowed as the pairwise cipher, group cipher will also be CCMP. Otherwise,
-# TKIP will be used as the group cipher.
-#wpa_pairwise=TKIP CCMP
-
-# Time interval for rekeying GTK (broadcast/multicast encryption keys) in
-# seconds.
-#wpa_group_rekey=600
-
-# Time interval for rekeying GMK (master key used internally to generate GTKs
-# (in seconds).
-#wpa_gmk_rekey=86400
-
-# Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up
-# roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN
-# authentication and key handshake before actually associating with a new AP.
-#rsn_preauth=1
-#
-# Space separated list of interfaces from which pre-authentication frames are
-# accepted (e.g., 'eth0' or 'eth0 wlan0wds0'. This list should include all
-# interface that are used for connections to other APs. This could include
-# wired interfaces and WDS links. The normal wireless data interface towards
-# associated stations (e.g., wlan0) should not be added, since
-# pre-authentication is only used with APs other than the currently associated
-# one.
-#rsn_preauth_interfaces=eth0
diff --git a/contrib/hostapd-0.4.9/README.DELETE b/contrib/hostapd-0.4.9/README.DELETE
deleted file mode 100644 (file)
index 7c7b59d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-.cvsignore
-ChangeLog
-Makefile
-README.DELETE
-driver.c
-driver_bsd.c
-driver_madwifi.c
-driver_prism54.c
-driver_test.c
-l2_packet_freebsd.c
-l2_packet_linux.c
-l2_packet_pcap.c
-logwatch/README
-logwatch/hostapd
-logwatch/hostapd.conf
-prism54.h
-priv_netlink.h
-wireless_copy.h
diff --git a/contrib/hostapd-0.4.9/README.DRAGONFLY b/contrib/hostapd-0.4.9/README.DRAGONFLY
deleted file mode 100644 (file)
index 219b8d7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Original source can be downloaded at:
-<http://hostap.epitest.fi/releases/hostapd-0.4.9.tar.gz>
-
-A list of deleted files is in README.DELETED.
diff --git a/contrib/hostapd-0.4.9/accounting.c b/contrib/hostapd-0.4.9/accounting.c
deleted file mode 100644 (file)
index 5ee3d75..0000000
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * Host AP (software wireless LAN access point) user space daemon for
- * Host AP kernel driver / Accounting
- * Copyright (c) 2002-2005, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <signal.h>
-#include <assert.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-
-
-#include "hostapd.h"
-#include "radius.h"
-#include "radius_client.h"
-#include "eloop.h"
-#include "accounting.h"
-#include "ieee802_1x.h"
-#include "driver.h"
-
-
-/* Default interval in seconds for polling TX/RX octets from the driver if
- * STA is not using interim accounting. This detects wrap arounds for
- * input/output octets and updates Acct-{Input,Output}-Gigawords. */
-#define ACCT_DEFAULT_UPDATE_INTERVAL 300
-
-static struct radius_msg * accounting_msg(hostapd *hapd, struct sta_info *sta,
-                                         int status_type)
-{
-       struct radius_msg *msg;
-       char buf[128];
-       u8 *val;
-       size_t len;
-       int i;
-
-       msg = radius_msg_new(RADIUS_CODE_ACCOUNTING_REQUEST,
-                            radius_client_get_id(hapd->radius));
-       if (msg == NULL) {
-               printf("Could not create net RADIUS packet\n");
-               return NULL;
-       }
-
-       if (sta) {
-               radius_msg_make_authenticator(msg, (u8 *) sta, sizeof(*sta));
-
-               snprintf(buf, sizeof(buf), "%08X-%08X",
-                        sta->acct_session_id_hi, sta->acct_session_id_lo);
-               if (!radius_msg_add_attr(msg, RADIUS_ATTR_ACCT_SESSION_ID,
-                                        (u8 *) buf, strlen(buf))) {
-                       printf("Could not add Acct-Session-Id\n");
-                       goto fail;
-               }
-       } else {
-               radius_msg_make_authenticator(msg, (u8 *) hapd, sizeof(*hapd));
-       }
-
-       if (!radius_msg_add_attr_int32(msg, RADIUS_ATTR_ACCT_STATUS_TYPE,
-                                      status_type)) {
-               printf("Could not add Acct-Status-Type\n");
-               goto fail;
-       }
-
-       if (!radius_msg_add_attr_int32(msg, RADIUS_ATTR_ACCT_AUTHENTIC,
-                                      hapd->conf->ieee802_1x ?
-                                      RADIUS_ACCT_AUTHENTIC_RADIUS :
-                                      RADIUS_ACCT_AUTHENTIC_LOCAL)) {
-               printf("Could not add Acct-Authentic\n");
-               goto fail;
-       }
-
-       if (sta) {
-               val = ieee802_1x_get_identity(sta->eapol_sm, &len);
-               if (!val) {
-                       snprintf(buf, sizeof(buf), RADIUS_ADDR_FORMAT,
-                                MAC2STR(sta->addr));
-                       val = (u8 *) buf;
-                       len = strlen(buf);
-               }
-
-               if (!radius_msg_add_attr(msg, RADIUS_ATTR_USER_NAME, val,
-                                        len)) {
-                       printf("Could not add User-Name\n");
-                       goto fail;
-               }
-       }
-
-       if (hapd->conf->own_ip_addr.af == AF_INET &&
-           !radius_msg_add_attr(msg, RADIUS_ATTR_NAS_IP_ADDRESS,
-                                (u8 *) &hapd->conf->own_ip_addr.u.v4, 4)) {
-               printf("Could not add NAS-IP-Address\n");
-               goto fail;
-       }
-
-#ifdef CONFIG_IPV6
-       if (hapd->conf->own_ip_addr.af == AF_INET6 &&
-           !radius_msg_add_attr(msg, RADIUS_ATTR_NAS_IPV6_ADDRESS,
-                                (u8 *) &hapd->conf->own_ip_addr.u.v6, 16)) {
-               printf("Could not add NAS-IPv6-Address\n");
-               goto fail;
-       }
-#endif /* CONFIG_IPV6 */
-
-       if (hapd->conf->nas_identifier &&
-           !radius_msg_add_attr(msg, RADIUS_ATTR_NAS_IDENTIFIER,
-                                (u8 *) hapd->conf->nas_identifier,
-                                strlen(hapd->conf->nas_identifier))) {
-               printf("Could not add NAS-Identifier\n");
-               goto fail;
-       }
-
-       if (sta &&
-           !radius_msg_add_attr_int32(msg, RADIUS_ATTR_NAS_PORT, sta->aid)) {
-               printf("Could not add NAS-Port\n");
-               goto fail;
-       }
-
-       snprintf(buf, sizeof(buf), RADIUS_802_1X_ADDR_FORMAT ":%s",
-                MAC2STR(hapd->own_addr), hapd->conf->ssid);
-       if (!radius_msg_add_attr(msg, RADIUS_ATTR_CALLED_STATION_ID,
-                                (u8 *) buf, strlen(buf))) {
-               printf("Could not add Called-Station-Id\n");
-               goto fail;
-       }
-
-       if (sta) {
-               snprintf(buf, sizeof(buf), RADIUS_802_1X_ADDR_FORMAT,
-                        MAC2STR(sta->addr));
-               if (!radius_msg_add_attr(msg, RADIUS_ATTR_CALLING_STATION_ID,
-                                        (u8 *) buf, strlen(buf))) {
-                       printf("Could not add Calling-Station-Id\n");
-                       goto fail;
-               }
-
-               if (!radius_msg_add_attr_int32(
-                           msg, RADIUS_ATTR_NAS_PORT_TYPE,
-                           RADIUS_NAS_PORT_TYPE_IEEE_802_11)) {
-                       printf("Could not add NAS-Port-Type\n");
-                       goto fail;
-               }
-
-               snprintf(buf, sizeof(buf), "CONNECT 11Mbps 802.11b");
-               if (!radius_msg_add_attr(msg, RADIUS_ATTR_CONNECT_INFO,
-                                        (u8 *) buf, strlen(buf))) {
-                       printf("Could not add Connect-Info\n");
-                       goto fail;
-               }
-
-               for (i = 0; ; i++) {
-                       val = ieee802_1x_get_radius_class(sta->eapol_sm, &len,
-                                                         i);
-                       if (val == NULL)
-                               break;
-
-                       if (!radius_msg_add_attr(msg, RADIUS_ATTR_CLASS,
-                                                val, len)) {
-                               printf("Could not add Class\n");
-                               goto fail;
-                       }
-               }
-       }
-
-       return msg;
-
- fail:
-       radius_msg_free(msg);
-       free(msg);
-       return NULL;
-}
-
-
-static int accounting_sta_update_stats(struct hostapd_data *hapd,
-                                      struct sta_info *sta,
-                                      struct hostap_sta_driver_data *data)
-{
-       if (hostapd_read_sta_data(hapd, data, sta->addr))
-               return -1;
-
-       if (sta->last_rx_bytes > data->rx_bytes)
-               sta->acct_input_gigawords++;
-       if (sta->last_tx_bytes > data->tx_bytes)
-               sta->acct_output_gigawords++;
-       sta->last_rx_bytes = data->rx_bytes;
-       sta->last_tx_bytes = data->tx_bytes;
-
-       hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
-                      HOSTAPD_LEVEL_DEBUG, "updated TX/RX stats: "
-                      "Acct-Input-Octets=%lu Acct-Input-Gigawords=%u "
-                      "Acct-Output-Octets=%lu Acct-Output-Gigawords=%u",
-                      sta->last_rx_bytes, sta->acct_input_gigawords,
-                      sta->last_tx_bytes, sta->acct_output_gigawords);
-
-       return 0;
-}
-
-
-static void accounting_interim_update(void *eloop_ctx, void *timeout_ctx)
-{
-       hostapd *hapd = eloop_ctx;
-       struct sta_info *sta = timeout_ctx;
-       int interval;
-
-       if (sta->acct_interim_interval) {
-               accounting_sta_interim(hapd, sta);
-               interval = sta->acct_interim_interval;
-       } else {
-               struct hostap_sta_driver_data data;
-               accounting_sta_update_stats(hapd, sta, &data);
-               interval = ACCT_DEFAULT_UPDATE_INTERVAL;
-       }
-
-       eloop_register_timeout(interval, 0, accounting_interim_update,
-                              hapd, sta);
-}
-
-
-void accounting_sta_start(hostapd *hapd, struct sta_info *sta)
-{
-       struct radius_msg *msg;
-       int interval;
-       
-       if (sta->acct_session_started)
-               return;
-
-       time(&sta->acct_session_start);
-       sta->last_rx_bytes = sta->last_tx_bytes = 0;
-       sta->acct_input_gigawords = sta->acct_output_gigawords = 0;
-       hostapd_sta_clear_stats(hapd, sta->addr);
-
-       if (!hapd->conf->radius->acct_server)
-               return;
-
-       if (sta->acct_interim_interval)
-               interval = sta->acct_interim_interval;
-       else
-               interval = ACCT_DEFAULT_UPDATE_INTERVAL;
-       eloop_register_timeout(interval, 0, accounting_interim_update,
-                              hapd, sta);
-
-       msg = accounting_msg(hapd, sta, RADIUS_ACCT_STATUS_TYPE_START);
-       if (msg)
-               radius_client_send(hapd->radius, msg, RADIUS_ACCT, sta->addr);
-
-       sta->acct_session_started = 1;
-}
-
-
-void accounting_sta_report(hostapd *hapd, struct sta_info *sta, int stop)
-{
-       struct radius_msg *msg;
-       int cause = sta->acct_terminate_cause;
-       struct hostap_sta_driver_data data;
-       u32 gigawords;
-
-       if (!hapd->conf->radius->acct_server)
-               return;
-
-       msg = accounting_msg(hapd, sta,
-                            stop ? RADIUS_ACCT_STATUS_TYPE_STOP :
-                            RADIUS_ACCT_STATUS_TYPE_INTERIM_UPDATE);
-       if (!msg) {
-               printf("Could not create RADIUS Accounting message\n");
-               return;
-       }
-
-       if (!radius_msg_add_attr_int32(msg, RADIUS_ATTR_ACCT_SESSION_TIME,
-                                      time(NULL) - sta->acct_session_start)) {
-               printf("Could not add Acct-Session-Time\n");
-               goto fail;
-       }
-
-       if (accounting_sta_update_stats(hapd, sta, &data) == 0) {
-               if (!radius_msg_add_attr_int32(msg,
-                                              RADIUS_ATTR_ACCT_INPUT_PACKETS,
-                                              data.rx_packets)) {
-                       printf("Could not add Acct-Input-Packets\n");
-                       goto fail;
-               }
-               if (!radius_msg_add_attr_int32(msg,
-                                              RADIUS_ATTR_ACCT_OUTPUT_PACKETS,
-                                              data.tx_packets)) {
-                       printf("Could not add Acct-Output-Packets\n");
-                       goto fail;
-               }
-               if (!radius_msg_add_attr_int32(msg,
-                                              RADIUS_ATTR_ACCT_INPUT_OCTETS,
-                                              data.rx_bytes)) {
-                       printf("Could not add Acct-Input-Octets\n");
-                       goto fail;
-               }
-               gigawords = sta->acct_input_gigawords;
-#if __WORDSIZE == 64
-               gigawords += data.rx_bytes >> 32;
-#endif
-               if (gigawords &&
-                   !radius_msg_add_attr_int32(
-                           msg, RADIUS_ATTR_ACCT_INPUT_GIGAWORDS,
-                           gigawords)) {
-                       printf("Could not add Acct-Input-Gigawords\n");
-                       goto fail;
-               }
-               if (!radius_msg_add_attr_int32(msg,
-                                              RADIUS_ATTR_ACCT_OUTPUT_OCTETS,
-                                              data.tx_bytes)) {
-                       printf("Could not add Acct-Output-Octets\n");
-                       goto fail;
-               }
-               gigawords = sta->acct_output_gigawords;
-#if __WORDSIZE == 64
-               gigawords += data.tx_bytes >> 32;
-#endif
-               if (gigawords &&
-                   !radius_msg_add_attr_int32(
-                           msg, RADIUS_ATTR_ACCT_OUTPUT_GIGAWORDS,
-                           gigawords)) {
-                       printf("Could not add Acct-Output-Gigawords\n");
-                       goto fail;
-               }
-       }
-
-       if (!radius_msg_add_attr_int32(msg, RADIUS_ATTR_EVENT_TIMESTAMP,
-                                      time(NULL))) {
-               printf("Could not add Event-Timestamp\n");
-               goto fail;
-       }
-
-       if (eloop_terminated())
-               cause = RADIUS_ACCT_TERMINATE_CAUSE_ADMIN_REBOOT;
-
-       if (stop && cause &&
-           !radius_msg_add_attr_int32(msg, RADIUS_ATTR_ACCT_TERMINATE_CAUSE,
-                                      cause)) {
-               printf("Could not add Acct-Terminate-Cause\n");
-               goto fail;
-       }
-
-       radius_client_send(hapd->radius, msg,
-                          stop ? RADIUS_ACCT : RADIUS_ACCT_INTERIM,
-                          sta->addr);
-       return;
-
- fail:
-       radius_msg_free(msg);
-       free(msg);
-}
-
-
-void accounting_sta_interim(hostapd *hapd, struct sta_info *sta)
-{
-       if (sta->acct_session_started)
-               accounting_sta_report(hapd, sta, 0);
-}
-
-
-void accounting_sta_stop(hostapd *hapd, struct sta_info *sta)
-{
-       if (sta->acct_session_started) {
-               accounting_sta_report(hapd, sta, 1);
-               eloop_cancel_timeout(accounting_interim_update, hapd, sta);
-               sta->acct_session_started = 0;
-       }
-}
-
-
-void accounting_sta_get_id(struct hostapd_data *hapd, struct sta_info *sta)
-{
-       sta->acct_session_id_lo = hapd->acct_session_id_lo++;
-       if (hapd->acct_session_id_lo == 0) {
-               hapd->acct_session_id_hi++;
-       }
-       sta->acct_session_id_hi = hapd->acct_session_id_hi;
-}
-
-
-/* Process the RADIUS frames from Accounting Server */
-static RadiusRxResult
-accounting_receive(struct radius_msg *msg, struct radius_msg *req,
-                  u8 *shared_secret, size_t shared_secret_len, void *data)
-{
-       if (msg->hdr->code != RADIUS_CODE_ACCOUNTING_RESPONSE) {
-               printf("Unknown RADIUS message code\n");
-               return RADIUS_RX_UNKNOWN;
-       }
-
-       if (radius_msg_verify(msg, shared_secret, shared_secret_len, req, 0)) {
-               printf("Incoming RADIUS packet did not have correct "
-                      "Authenticator - dropped\n");
-               return RADIUS_RX_INVALID_AUTHENTICATOR;
-       }
-
-       return RADIUS_RX_PROCESSED;
-}
-
-
-static void accounting_report_state(struct hostapd_data *hapd, int on)
-{
-       struct radius_msg *msg;
-
-       if (!hapd->conf->radius->acct_server || hapd->radius == NULL)
-               return;
-
-       /* Inform RADIUS server that accounting will start/stop so that the
-        * server can close old accounting sessions. */
-       msg = accounting_msg(hapd, NULL,
-                            on ? RADIUS_ACCT_STATUS_TYPE_ACCOUNTING_ON :
-                            RADIUS_ACCT_STATUS_TYPE_ACCOUNTING_OFF);
-       if (!msg)
-               return;
-
-       if (!radius_msg_add_attr_int32(msg, RADIUS_ATTR_ACCT_TERMINATE_CAUSE,
-                                      RADIUS_ACCT_TERMINATE_CAUSE_NAS_REBOOT))
-       {
-               printf("Could not add Acct-Terminate-Cause\n");
-               radius_msg_free(msg);
-               free(msg);
-               return;
-       }
-
-       radius_client_send(hapd->radius, msg, RADIUS_ACCT, NULL);
-}
-
-
-int accounting_init(hostapd *hapd)
-{
-       /* Acct-Session-Id should be unique over reboots. If reliable clock is
-        * not available, this could be replaced with reboot counter, etc. */
-       hapd->acct_session_id_hi = time(NULL);
-
-       if (radius_client_register(hapd->radius, RADIUS_ACCT,
-                                  accounting_receive, hapd))
-               return -1;
-
-       accounting_report_state(hapd, 1);
-
-       return 0;
-}
-
-
-void accounting_deinit(hostapd *hapd)
-{
-       accounting_report_state(hapd, 0);
-}
diff --git a/contrib/hostapd-0.4.9/accounting.h b/contrib/hostapd-0.4.9/accounting.h
deleted file mode 100644 (file)
index 8af3eac..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef ACCOUNTING_H
-#define ACCOUNTING_H
-
-
-void accounting_sta_start(hostapd *hapd, struct sta_info *sta);
-void accounting_sta_interim(hostapd *hapd, struct sta_info *sta);
-void accounting_sta_stop(hostapd *hapd, struct sta_info *sta);
-void accounting_sta_get_id(struct hostapd_data *hapd, struct sta_info *sta);
-int accounting_init(hostapd *hapd);
-void accounting_deinit(hostapd *hapd);
-
-
-#endif /* ACCOUNTING_H */
diff --git a/contrib/hostapd-0.4.9/aes_wrap.c b/contrib/hostapd-0.4.9/aes_wrap.c
deleted file mode 100644 (file)
index a5925ca..0000000
+++ /dev/null
@@ -1,725 +0,0 @@
-/*
- * AES-based functions
- *
- * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394)
- * - One-Key CBC MAC (OMAC1) hash with AES-128
- * - AES-128 CTR mode encryption
- * - AES-128 EAX mode encryption/decryption
- * - AES-128 CBC
- *
- * Copyright (c) 2003-2005, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "common.h"
-#include "aes_wrap.h"
-#include "crypto.h"
-
-#ifndef EAP_TLS_FUNCS
-#include "aes.c"
-#endif /* EAP_TLS_FUNCS */
-
-
-/**
- * aes_wrap - Wrap keys with AES Key Wrap Algorithm (128-bit KEK) (RFC3394)
- * @kek: Key encryption key (KEK)
- * @n: Length of the wrapped key in 64-bit units; e.g., 2 = 128-bit = 16 bytes
- * @plain: Plaintext key to be wrapped, n * 64 bit
- * @cipher: Wrapped key, (n + 1) * 64 bit
- * Returns: 0 on success, -1 on failure
- */
-int aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher)
-{
-       u8 *a, *r, b[16];
-       int i, j;
-       void *ctx;
-
-       a = cipher;
-       r = cipher + 8;
-
-       /* 1) Initialize variables. */
-       memset(a, 0xa6, 8);
-       memcpy(r, plain, 8 * n);
-
-       ctx = aes_encrypt_init(kek, 16);
-       if (ctx == NULL)
-               return -1;
-
-       /* 2) Calculate intermediate values.
-        * For j = 0 to 5
-        *     For i=1 to n
-        *         B = AES(K, A | R[i])
-        *         A = MSB(64, B) ^ t where t = (n*j)+i
-        *         R[i] = LSB(64, B)
-        */
-       for (j = 0; j <= 5; j++) {
-               r = cipher + 8;
-               for (i = 1; i <= n; i++) {
-                       memcpy(b, a, 8);
-                       memcpy(b + 8, r, 8);
-                       aes_encrypt(ctx, b, b);
-                       memcpy(a, b, 8);
-                       a[7] ^= n * j + i;
-                       memcpy(r, b + 8, 8);
-                       r += 8;
-               }
-       }
-       aes_encrypt_deinit(ctx);
-
-       /* 3) Output the results.
-        *
-        * These are already in @cipher due to the location of temporary
-        * variables.
-        */
-
-       return 0;
-}
-
-
-/**
- * aes_unwrap - Unwrap key with AES Key Wrap Algorithm (128-bit KEK) (RFC3394)
- * @kek: Key encryption key (KEK)
- * @n: Length of the wrapped key in 64-bit units; e.g., 2 = 128-bit = 16 bytes
- * @cipher: Wrapped key to be unwrapped, (n + 1) * 64 bit
- * @plain: Plaintext key, n * 64 bit
- * Returns: 0 on success, -1 on failure (e.g., integrity verification failed)
- */
-int aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain)
-{
-       u8 a[8], *r, b[16];
-       int i, j;
-       void *ctx;
-
-       /* 1) Initialize variables. */
-       memcpy(a, cipher, 8);
-       r = plain;
-       memcpy(r, cipher + 8, 8 * n);
-
-       ctx = aes_decrypt_init(kek, 16);
-       if (ctx == NULL)
-               return -1;
-
-       /* 2) Compute intermediate values.
-        * For j = 5 to 0
-        *     For i = n to 1
-        *         B = AES-1(K, (A ^ t) | R[i]) where t = n*j+i
-        *         A = MSB(64, B)
-        *         R[i] = LSB(64, B)
-        */
-       for (j = 5; j >= 0; j--) {
-               r = plain + (n - 1) * 8;
-               for (i = n; i >= 1; i--) {
-                       memcpy(b, a, 8);
-                       b[7] ^= n * j + i;
-
-                       memcpy(b + 8, r, 8);
-                       aes_decrypt(ctx, b, b);
-                       memcpy(a, b, 8);
-                       memcpy(r, b + 8, 8);
-                       r -= 8;
-               }
-       }
-       aes_decrypt_deinit(ctx);
-
-       /* 3) Output results.
-        *
-        * These are already in @plain due to the location of temporary
-        * variables. Just verify that the IV matches with the expected value.
-        */
-       for (i = 0; i < 8; i++) {
-               if (a[i] != 0xa6)
-                       return -1;
-       }
-
-       return 0;
-}
-
-
-#define BLOCK_SIZE 16
-
-static void gf_mulx(u8 *pad)
-{
-       int i, carry;
-
-       carry = pad[0] & 0x80;
-       for (i = 0; i < BLOCK_SIZE - 1; i++)
-               pad[i] = (pad[i] << 1) | (pad[i + 1] >> 7);
-       pad[BLOCK_SIZE - 1] <<= 1;
-       if (carry)
-               pad[BLOCK_SIZE - 1] ^= 0x87;
-}
-
-
-/**
- * omac1_aes_128 - One-Key CBC MAC (OMAC1) hash with AES-128
- * @key: Key for the hash operation
- * @data: Data buffer for which a MAC is determined
- * @data: Length of data buffer in bytes
- * @mac: Buffer for MAC (128 bits, i.e., 16 bytes)
- * Returns: 0 on success, -1 on failure
- */
-int omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, u8 *mac)
-{
-       void *ctx;
-       u8 cbc[BLOCK_SIZE], pad[BLOCK_SIZE];
-       const u8 *pos = data;
-       int i;
-       size_t left = data_len;
-
-       ctx = aes_encrypt_init(key, 16);
-       if (ctx == NULL)
-               return -1;
-       memset(cbc, 0, BLOCK_SIZE);
-
-       while (left >= BLOCK_SIZE) {
-               for (i = 0; i < BLOCK_SIZE; i++)
-                       cbc[i] ^= *pos++;
-               if (left > BLOCK_SIZE)
-                       aes_encrypt(ctx, cbc, cbc);
-               left -= BLOCK_SIZE;
-       }
-
-       memset(pad, 0, BLOCK_SIZE);
-       aes_encrypt(ctx, pad, pad);
-       gf_mulx(pad);
-
-       if (left || data_len == 0) {
-               for (i = 0; i < left; i++)
-                       cbc[i] ^= *pos++;
-               cbc[left] ^= 0x80;
-               gf_mulx(pad);
-       }
-
-       for (i = 0; i < BLOCK_SIZE; i++)
-               pad[i] ^= cbc[i];
-       aes_encrypt(ctx, pad, mac);
-       aes_encrypt_deinit(ctx);
-       return 0;
-}
-
-
-/**
- * aes_128_encrypt_block - Perform one AES 128-bit block operation
- * @key: Key for AES
- * @in: Input data (16 bytes)
- * @out: Output of the AES block operation (16 bytes)
- * Returns: 0 on success, -1 on failure
- */
-int aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out)
-{
-       void *ctx;
-       ctx = aes_encrypt_init(key, 16);
-       if (ctx == NULL)
-               return -1;
-       aes_encrypt(ctx, in, out);
-       aes_encrypt_deinit(ctx);
-       return 0;
-}
-
-
-/**
- * aes_128_ctr_encrypt - AES-128 CTR mode encryption
- * @key: Key for encryption (16 bytes)
- * @nonce: Nonce for counter mode (16 bytes)
- * @data: Data to encrypt in-place
- * @data_len: Length of data in bytes
- * Returns: 0 on success, -1 on failure
- */
-int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce,
-                       u8 *data, size_t data_len)
-{
-       void *ctx;
-       size_t len, left = data_len;
-       int i;
-       u8 *pos = data;
-       u8 counter[BLOCK_SIZE], buf[BLOCK_SIZE];
-
-       ctx = aes_encrypt_init(key, 16);
-       if (ctx == NULL)
-               return -1;
-       memcpy(counter, nonce, BLOCK_SIZE);
-
-       while (left > 0) {
-               aes_encrypt(ctx, counter, buf);
-
-               len = (left < BLOCK_SIZE) ? left : BLOCK_SIZE;
-               for (i = 0; i < len; i++)
-                       pos[i] ^= buf[i];
-               pos += len;
-               left -= len;
-
-               for (i = BLOCK_SIZE - 1; i >= 0; i--) {
-                       counter[i]++;
-                       if (counter[i])
-                               break;
-               }
-       }
-       aes_encrypt_deinit(ctx);
-       return 0;
-}
-
-
-/**
- * aes_128_eax_encrypt - AES-128 EAX mode encryption
- * @key: Key for encryption (16 bytes)
- * @nonce: Nonce for counter mode
- * @nonce_len: Nonce length in bytes
- * @hdr: Header data to be authenticity protected
- * @hdr_len: Length of the header data bytes
- * @data: Data to encrypt in-place
- * @data_len: Length of data in bytes
- * @tag: 16-byte tag value
- * Returns: 0 on success, -1 on failure
- */
-int aes_128_eax_encrypt(const u8 *key, const u8 *nonce, size_t nonce_len,
-                       const u8 *hdr, size_t hdr_len,
-                       u8 *data, size_t data_len, u8 *tag)
-{
-       u8 *buf;
-       size_t buf_len;
-       u8 nonce_mac[BLOCK_SIZE], hdr_mac[BLOCK_SIZE], data_mac[BLOCK_SIZE];
-       int i;
-
-       if (nonce_len > data_len)
-               buf_len = nonce_len;
-       else
-               buf_len = data_len;
-       if (hdr_len > buf_len)
-               buf_len = hdr_len;
-       buf_len += 16;
-
-       buf = malloc(buf_len);
-       if (buf == NULL)
-               return -1;
-
-       memset(buf, 0, 15);
-
-       buf[15] = 0;
-       memcpy(buf + 16, nonce, nonce_len);
-       omac1_aes_128(key, buf, 16 + nonce_len, nonce_mac);
-
-       buf[15] = 1;
-       memcpy(buf + 16, hdr, hdr_len);
-       omac1_aes_128(key, buf, 16 + hdr_len, hdr_mac);
-
-       aes_128_ctr_encrypt(key, nonce_mac, data, data_len);
-       buf[15] = 2;
-       memcpy(buf + 16, data, data_len);
-       omac1_aes_128(key, buf, 16 + data_len, data_mac);
-
-       free(buf);
-
-       for (i = 0; i < BLOCK_SIZE; i++)
-               tag[i] = nonce_mac[i] ^ data_mac[i] ^ hdr_mac[i];
-
-       return 0;
-}
-
-
-/**
- * aes_128_eax_decrypt - AES-128 EAX mode decryption
- * @key: Key for decryption (16 bytes)
- * @nonce: Nonce for counter mode
- * @nonce_len: Nonce length in bytes
- * @hdr: Header data to be authenticity protected
- * @hdr_len: Length of the header data bytes
- * @data: Data to encrypt in-place
- * @data_len: Length of data in bytes
- * @tag: 16-byte tag value
- * Returns: 0 on success, -1 on failure, -2 if tag does not match
- */
-int aes_128_eax_decrypt(const u8 *key, const u8 *nonce, size_t nonce_len,
-                       const u8 *hdr, size_t hdr_len,
-                       u8 *data, size_t data_len, const u8 *tag)
-{
-       u8 *buf;
-       size_t buf_len;
-       u8 nonce_mac[BLOCK_SIZE], hdr_mac[BLOCK_SIZE], data_mac[BLOCK_SIZE];
-       int i;
-
-       if (nonce_len > data_len)
-               buf_len = nonce_len;
-       else
-               buf_len = data_len;
-       if (hdr_len > buf_len)
-               buf_len = hdr_len;
-       buf_len += 16;
-
-       buf = malloc(buf_len);
-       if (buf == NULL)
-               return -1;
-
-       memset(buf, 0, 15);
-
-       buf[15] = 0;
-       memcpy(buf + 16, nonce, nonce_len);
-       omac1_aes_128(key, buf, 16 + nonce_len, nonce_mac);
-
-       buf[15] = 1;
-       memcpy(buf + 16, hdr, hdr_len);
-       omac1_aes_128(key, buf, 16 + hdr_len, hdr_mac);
-
-       buf[15] = 2;
-       memcpy(buf + 16, data, data_len);
-       omac1_aes_128(key, buf, 16 + data_len, data_mac);
-
-       free(buf);
-
-       for (i = 0; i < BLOCK_SIZE; i++) {
-               if (tag[i] != (nonce_mac[i] ^ data_mac[i] ^ hdr_mac[i]))
-                       return -2;
-       }
-
-       aes_128_ctr_encrypt(key, nonce_mac, data, data_len);
-
-       return 0;
-}
-
-
-/**
- * aes_128_cbc_encrypt - AES-128 CBC encryption
- * @key: Encryption key
- * @iv: Encryption IV for CBC mode (16 bytes)
- * @data: Data to encrypt in-place
- * @data_len: Length of data in bytes (must be divisible by 16)
- * Returns: 0 on success, -1 on failure
- */
-int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len)
-{
-       void *ctx;
-       u8 cbc[BLOCK_SIZE];
-       u8 *pos = data;
-       int i, j, blocks;
-
-       ctx = aes_encrypt_init(key, 16);
-       if (ctx == NULL)
-               return -1;
-       memcpy(cbc, iv, BLOCK_SIZE);
-
-       blocks = data_len / BLOCK_SIZE;
-       for (i = 0; i < blocks; i++) {
-               for (j = 0; j < BLOCK_SIZE; j++)
-                       cbc[j] ^= pos[j];
-               aes_encrypt(ctx, cbc, cbc);
-               memcpy(pos, cbc, BLOCK_SIZE);
-               pos += BLOCK_SIZE;
-       }
-       aes_encrypt_deinit(ctx);
-       return 0;
-}
-
-
-/**
- * aes_128_cbc_decrypt - AES-128 CBC decryption
- * @key: Decryption key
- * @iv: Decryption IV for CBC mode (16 bytes)
- * @data: Data to decrypt in-place
- * @data_len: Length of data in bytes (must be divisible by 16)
- * Returns: 0 on success, -1 on failure
- */
-int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len)
-{
-       void *ctx;
-       u8 cbc[BLOCK_SIZE], tmp[BLOCK_SIZE];
-       u8 *pos = data;
-       int i, j, blocks;
-
-       ctx = aes_decrypt_init(key, 16);
-       if (ctx == NULL)
-               return -1;
-       memcpy(cbc, iv, BLOCK_SIZE);
-
-       blocks = data_len / BLOCK_SIZE;
-       for (i = 0; i < blocks; i++) {
-               memcpy(tmp, pos, BLOCK_SIZE);
-               aes_decrypt(ctx, pos, pos);
-               for (j = 0; j < BLOCK_SIZE; j++)
-                       pos[j] ^= cbc[j];
-               memcpy(cbc, tmp, BLOCK_SIZE);
-               pos += BLOCK_SIZE;
-       }
-       aes_decrypt_deinit(ctx);
-       return 0;
-}
-
-
-#ifdef TEST_MAIN
-
-#ifdef __i386__
-#define rdtscll(val) \
-     __asm__ __volatile__("rdtsc" : "=A" (val))
-
-static void test_aes_perf(void)
-{
-       const int num_iters = 10;
-       int i;
-       unsigned int start, end;
-       u8 key[16], pt[16], ct[16];
-       void *ctx;
-
-       printf("keySetupEnc:");
-       for (i = 0; i < num_iters; i++) {
-               rdtscll(start);
-               ctx = aes_encrypt_init(key, 16);
-               rdtscll(end);
-               aes_encrypt_deinit(ctx);
-               printf(" %d", end - start);
-       }
-       printf("\n");
-
-       printf("Encrypt:");
-       ctx = aes_encrypt_init(key, 16);
-       for (i = 0; i < num_iters; i++) {
-               rdtscll(start);
-               aes_encrypt(ctx, pt, ct);
-               rdtscll(end);
-               printf(" %d", end - start);
-       }
-       aes_encrypt_deinit(ctx);
-       printf("\n");
-}
-#endif /* __i386__ */
-
-
-static int test_eax(void)
-{
-       u8 msg[] = { 0xF7, 0xFB };
-       u8 key[] = { 0x91, 0x94, 0x5D, 0x3F, 0x4D, 0xCB, 0xEE, 0x0B,
-                    0xF4, 0x5E, 0xF5, 0x22, 0x55, 0xF0, 0x95, 0xA4 };
-       u8 nonce[] = { 0xBE, 0xCA, 0xF0, 0x43, 0xB0, 0xA2, 0x3D, 0x84,
-                      0x31, 0x94, 0xBA, 0x97, 0x2C, 0x66, 0xDE, 0xBD };
-       u8 hdr[] = { 0xFA, 0x3B, 0xFD, 0x48, 0x06, 0xEB, 0x53, 0xFA };
-       u8 cipher[] = { 0x19, 0xDD, 0x5C, 0x4C, 0x93, 0x31, 0x04, 0x9D,
-                       0x0B, 0xDA, 0xB0, 0x27, 0x74, 0x08, 0xF6, 0x79,
-                       0x67, 0xE5 };
-       u8 data[sizeof(msg)], tag[BLOCK_SIZE];
-
-       memcpy(data, msg, sizeof(msg));
-       if (aes_128_eax_encrypt(key, nonce, sizeof(nonce), hdr, sizeof(hdr),
-                               data, sizeof(data), tag)) {
-               printf("AES-128 EAX mode encryption failed\n");
-               return 1;
-       }
-       if (memcmp(data, cipher, sizeof(data)) != 0) {
-               printf("AES-128 EAX mode encryption returned invalid cipher "
-                      "text\n");
-               return 1;
-       }
-       if (memcmp(tag, cipher + sizeof(data), BLOCK_SIZE) != 0) {
-               printf("AES-128 EAX mode encryption returned invalid tag\n");
-               return 1;
-       }
-
-       if (aes_128_eax_decrypt(key, nonce, sizeof(nonce), hdr, sizeof(hdr),
-                               data, sizeof(data), tag)) {
-               printf("AES-128 EAX mode decryption failed\n");
-               return 1;
-       }
-       if (memcmp(data, msg, sizeof(data)) != 0) {
-               printf("AES-128 EAX mode decryption returned invalid plain "
-                      "text\n");
-               return 1;
-       }
-
-       return 0;
-}
-
-
-static int test_cbc(void)
-{
-       struct cbc_test_vector {
-               u8 key[16];
-               u8 iv[16];
-               u8 plain[32];
-               u8 cipher[32];
-               size_t len;
-       } vectors[] = {
-               {
-                       { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b,
-                         0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06 },
-                       { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30,
-                         0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 },
-                       "Single block msg",
-                       { 0xe3, 0x53, 0x77, 0x9c, 0x10, 0x79, 0xae, 0xb8,
-                         0x27, 0x08, 0x94, 0x2d, 0xbe, 0x77, 0x18, 0x1a },
-                       16
-               },
-               {
-                       { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0,
-                         0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a },
-                       { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28,
-                         0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 },
-                       { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                         0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                         0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
-                         0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
-                       { 0xd2, 0x96, 0xcd, 0x94, 0xc2, 0xcc, 0xcf, 0x8a,
-                         0x3a, 0x86, 0x30, 0x28, 0xb5, 0xe1, 0xdc, 0x0a,
-                         0x75, 0x86, 0x60, 0x2d, 0x25, 0x3c, 0xff, 0xf9,
-                         0x1b, 0x82, 0x66, 0xbe, 0xa6, 0xd6, 0x1a, 0xb1 },
-                       32
-               }
-       };
-       int i, ret = 0;
-       u8 *buf;
-
-       for (i = 0; i < sizeof(vectors) / sizeof(vectors[0]); i++) {
-               struct cbc_test_vector *tv = &vectors[i];
-               buf = malloc(tv->len);
-               if (buf == NULL) {
-                       ret++;
-                       break;
-               }
-               memcpy(buf, tv->plain, tv->len);
-               aes_128_cbc_encrypt(tv->key, tv->iv, buf, tv->len);
-               if (memcmp(buf, tv->cipher, tv->len) != 0) {
-                       printf("AES-CBC encrypt %d failed\n", i);
-                       ret++;
-               }
-               memcpy(buf, tv->cipher, tv->len);
-               aes_128_cbc_decrypt(tv->key, tv->iv, buf, tv->len);
-               if (memcmp(buf, tv->plain, tv->len) != 0) {
-                       printf("AES-CBC decrypt %d failed\n", i);
-                       ret++;
-               }
-               free(buf);
-       }
-
-       return ret;
-}
-
-
-/* OMAC1 AES-128 test vectors from
- * http://csrc.nist.gov/CryptoToolkit/modes/proposedmodes/omac/omac-ad.pdf
- */
-
-struct omac1_test_vector {
-       u8 k[16];
-       u8 msg[64];
-       int msg_len;
-       u8 tag[16];
-};
-
-static struct omac1_test_vector test_vectors[] =
-{
-       {
-               { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
-                 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c },
-               { },
-               0,
-               { 0xbb, 0x1d, 0x69, 0x29, 0xe9, 0x59, 0x37, 0x28,
-                 0x7f, 0xa3, 0x7d, 0x12, 0x9b, 0x75, 0x67, 0x46 }
-       },
-       {
-               { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
-                 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c },
-               { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
-                 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a},
-               16,
-               { 0x07, 0x0a, 0x16, 0xb4, 0x6b, 0x4d, 0x41, 0x44,
-                 0xf7, 0x9b, 0xdd, 0x9d, 0xd0, 0x4a, 0x28, 0x7c }
-       },
-       {
-               { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
-                 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c },
-               { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
-                 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
-                 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
-                 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
-                 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11 },
-               40,
-               { 0xdf, 0xa6, 0x67, 0x47, 0xde, 0x9a, 0xe6, 0x30,
-                 0x30, 0xca, 0x32, 0x61, 0x14, 0x97, 0xc8, 0x27 }
-       },
-       {
-               { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
-                 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c },
-               { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
-                 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
-                 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
-                 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
-                 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
-                 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
-                 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
-                 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 },
-               64,
-               { 0x51, 0xf0, 0xbe, 0xbf, 0x7e, 0x3b, 0x9d, 0x92,
-                 0xfc, 0x49, 0x74, 0x17, 0x79, 0x36, 0x3c, 0xfe }
-       },
-};
-
-
-int main(int argc, char *argv[])
-{
-       u8 kek[] = {
-               0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-               0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
-       };
-       u8 plain[] = {
-               0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
-               0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
-       };
-       u8 crypt[] = {
-               0x1F, 0xA6, 0x8B, 0x0A, 0x81, 0x12, 0xB4, 0x47,
-               0xAE, 0xF3, 0x4B, 0xD8, 0xFB, 0x5A, 0x7B, 0x82,
-               0x9D, 0x3E, 0x86, 0x23, 0x71, 0xD2, 0xCF, 0xE5
-       };
-       u8 result[24];
-       int ret = 0, i;
-       struct omac1_test_vector *tv;
-
-       if (aes_wrap(kek, 2, plain, result)) {
-               printf("AES-WRAP-128-128 reported failure\n");
-               ret++;
-       }
-       if (memcmp(result, crypt, 24) != 0) {
-               printf("AES-WRAP-128-128 failed\n");
-               ret++;
-       }
-       if (aes_unwrap(kek, 2, crypt, result)) {
-               printf("AES-UNWRAP-128-128 reported failure\n");
-               ret++;
-       }
-       if (memcmp(result, plain, 16) != 0) {
-               int i;
-               printf("AES-UNWRAP-128-128 failed\n");
-               ret++;
-               for (i = 0; i < 16; i++)
-                       printf(" %02x", result[i]);
-               printf("\n");
-       }
-
-#ifdef __i386__
-       test_aes_perf();
-#endif /* __i386__ */
-
-       for (i = 0; i < sizeof(test_vectors) / sizeof(test_vectors[0]); i++) {
-               tv = &test_vectors[i];
-               omac1_aes_128(tv->k, tv->msg, tv->msg_len, result);
-               if (memcmp(result, tv->tag, 16) != 0) {
-                       printf("OMAC1-AES-128 test vector %d failed\n", i);
-                       ret++;
-               }
-       }
-
-       ret += test_eax();
-
-       ret += test_cbc();
-
-       if (ret)
-               printf("FAILED!\n");
-
-       return ret;
-}
-#endif /* TEST_MAIN */
diff --git a/contrib/hostapd-0.4.9/aes_wrap.h b/contrib/hostapd-0.4.9/aes_wrap.h
deleted file mode 100644 (file)
index cb1a539..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * AES-based functions
- *
- * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394)
- * - One-Key CBC MAC (OMAC1) hash with AES-128
- * - AES-128 CTR mode encryption
- * - AES-128 EAX mode encryption/decryption
- * - AES-128 CBC
- *
- * Copyright (c) 2003-2005, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#ifndef AES_WRAP_H
-#define AES_WRAP_H
-
-int aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher);
-int aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain);
-int omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, u8 *mac);
-int aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out);
-int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce,
-                       u8 *data, size_t data_len);
-int aes_128_eax_encrypt(const u8 *key, const u8 *nonce, size_t nonce_len,
-                       const u8 *hdr, size_t hdr_len,
-                       u8 *data, size_t data_len, u8 *tag);
-int aes_128_eax_decrypt(const u8 *key, const u8 *nonce, size_t nonce_len,
-                       const u8 *hdr, size_t hdr_len,
-                       u8 *data, size_t data_len, const u8 *tag);
-int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data,
-                       size_t data_len);
-int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data,
-                       size_t data_len);
-
-#endif /* AES_WRAP_H */
diff --git a/contrib/hostapd-0.4.9/ap.h b/contrib/hostapd-0.4.9/ap.h
deleted file mode 100644 (file)
index e874ffd..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef AP_H
-#define AP_H
-
-/* STA flags */
-#define WLAN_STA_AUTH BIT(0)
-#define WLAN_STA_ASSOC BIT(1)
-#define WLAN_STA_PS BIT(2)
-#define WLAN_STA_TIM BIT(3)
-#define WLAN_STA_PERM BIT(4)
-#define WLAN_STA_AUTHORIZED BIT(5)
-#define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */
-#define WLAN_STA_PREAUTH BIT(7)
-
-#define WLAN_RATE_1M BIT(0)
-#define WLAN_RATE_2M BIT(1)
-#define WLAN_RATE_5M5 BIT(2)
-#define WLAN_RATE_11M BIT(3)
-#define WLAN_RATE_COUNT 4
-
-/* Maximum size of Supported Rates info element. IEEE 802.11 has a limit of 8,
- * but some pre-standard IEEE 802.11g products use longer elements. */
-#define WLAN_SUPP_RATES_MAX 32
-
-
-struct sta_info {
-       struct sta_info *next; /* next entry in sta list */
-       struct sta_info *hnext; /* next entry in hash table list */
-       u8 addr[6];
-       u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
-       u32 flags;
-       u16 capability;
-       u16 listen_interval; /* or beacon_int for APs */
-       u8 supported_rates[WLAN_SUPP_RATES_MAX];
-       u8 tx_supp_rates;
-
-       enum {
-               STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE
-       } timeout_next;
-
-       /* IEEE 802.1X related data */
-       struct eapol_state_machine *eapol_sm;
-
-       /* IEEE 802.11f (IAPP) related data */
-       struct ieee80211_mgmt *last_assoc_req;
-
-       u32 acct_session_id_hi;
-       u32 acct_session_id_lo;
-       time_t acct_session_start;
-       int acct_session_started;
-       int acct_terminate_cause; /* Acct-Terminate-Cause */
-       int acct_interim_interval; /* Acct-Interim-Interval */
-
-       unsigned long last_rx_bytes;
-       unsigned long last_tx_bytes;
-       u32 acct_input_gigawords; /* Acct-Input-Gigawords */
-       u32 acct_output_gigawords; /* Acct-Output-Gigawords */
-
-       u8 *challenge; /* IEEE 802.11 Shared Key Authentication Challenge */
-
-       int pairwise; /* Pairwise cipher suite, WPA_CIPHER_* */
-       u8 *wpa_ie;
-       size_t wpa_ie_len;
-       struct wpa_state_machine *wpa_sm;
-       enum {
-               WPA_VERSION_NO_WPA = 0 /* WPA not used */,
-               WPA_VERSION_WPA = 1 /* WPA / IEEE 802.11i/D3.0 */,
-               WPA_VERSION_WPA2 = 2 /* WPA2 / IEEE 802.11i */
-       } wpa;
-       int wpa_key_mgmt; /* the selected WPA_KEY_MGMT_* */
-       struct rsn_pmksa_cache *pmksa;
-       struct rsn_preauth_interface *preauth_iface;
-       u8 req_replay_counter[8 /* WPA_REPLAY_COUNTER_LEN */];
-       int req_replay_counter_used;
-       u32 dot11RSNAStatsTKIPLocalMICFailures;
-       u32 dot11RSNAStatsTKIPRemoteMICFailures;
-};
-
-
-#define MAX_STA_COUNT 1024
-
-/* Maximum number of AIDs to use for STAs; must be 2007 or lower
- * (8802.11 limitation) */
-#define MAX_AID_TABLE_SIZE 128
-
-#define STA_HASH_SIZE 256
-#define STA_HASH(sta) (sta[5])
-
-
-/* Default value for maximum station inactivity. After AP_MAX_INACTIVITY has
- * passed since last received frame from the station, a nullfunc data frame is
- * sent to the station. If this frame is not acknowledged and no other frames
- * have been received, the station will be disassociated after
- * AP_DISASSOC_DELAY seconds. Similarily, the station will be deauthenticated
- * after AP_DEAUTH_DELAY seconds has passed after disassociation. */
-#define AP_MAX_INACTIVITY (5 * 60)
-#define AP_DISASSOC_DELAY (1)
-#define AP_DEAUTH_DELAY (1)
-
-#endif /* AP_H */
diff --git a/contrib/hostapd-0.4.9/common.c b/contrib/hostapd-0.4.9/common.c
deleted file mode 100644 (file)
index 4b756d8..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * wpa_supplicant/hostapd / common helper functions, etc.
- * Copyright (c) 2002-2005, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <time.h>
-#include <sys/time.h>
-#ifdef CONFIG_NATIVE_WINDOWS
-#include <winsock2.h>
-#include <wincrypt.h>
-#endif /* CONFIG_NATIVE_WINDOWS */
-
-#include "common.h"
-
-
-int wpa_debug_level = MSG_INFO;
-int wpa_debug_show_keys = 0;
-int wpa_debug_timestamp = 0;
-
-
-int hostapd_get_rand(u8 *buf, size_t len)
-{
-#ifdef CONFIG_NATIVE_WINDOWS
-       HCRYPTPROV prov;
-       BOOL ret;
-
-       if (!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL,
-                                CRYPT_VERIFYCONTEXT))
-               return -1;
-
-       ret = CryptGenRandom(prov, len, buf);
-       CryptReleaseContext(prov, 0);
-
-       return ret ? 0 : -1;
-#else /* CONFIG_NATIVE_WINDOWS */
-       FILE *f;
-       size_t rc;
-
-       f = fopen("/dev/urandom", "r");
-       if (f == NULL) {
-               printf("Could not open /dev/urandom.\n");
-               return -1;
-       }
-
-       rc = fread(buf, 1, len, f);
-       fclose(f);
-
-       return rc != len ? -1 : 0;
-#endif /* CONFIG_NATIVE_WINDOWS */
-}
-
-
-void hostapd_hexdump(const char *title, const u8 *buf, size_t len)
-{
-       size_t i;
-       printf("%s - hexdump(len=%lu):", title, (unsigned long) len);
-       for (i = 0; i < len; i++)
-               printf(" %02x", buf[i]);
-       printf("\n");
-}
-
-
-static int hex2num(char c)
-{
-       if (c >= '0' && c <= '9')
-               return c - '0';
-       if (c >= 'a' && c <= 'f')
-               return c - 'a' + 10;
-       if (c >= 'A' && c <= 'F')
-               return c - 'A' + 10;
-       return -1;
-}
-
-
-static int hex2byte(const char *hex)
-{
-       int a, b;
-       a = hex2num(*hex++);
-       if (a < 0)
-               return -1;
-       b = hex2num(*hex++);
-       if (b < 0)
-               return -1;
-       return (a << 4) | b;
-}
-
-
-/**
- * hwaddr_aton - Convert ASCII string to MAC address
- * @txt: MAC address as a string (e.g., "00:11:22:33:44:55")
- * @addr: Buffer for the MAC address (ETH_ALEN = 6 bytes)
- * Returns: 0 on success, -1 on failure (e.g., string not a MAC address)
- */
-int hwaddr_aton(const char *txt, u8 *addr)
-{
-       int i;
-
-       for (i = 0; i < 6; i++) {
-               int a, b;
-
-               a = hex2num(*txt++);
-               if (a < 0)
-                       return -1;
-               b = hex2num(*txt++);
-               if (b < 0)
-                       return -1;
-               *addr++ = (a << 4) | b;
-               if (i < 5 && *txt++ != ':')
-                       return -1;
-       }
-
-       return 0;
-}
-
-
-/**
- * hexstr2bin - Convert ASCII hex string into binary data
- * @hex: ASCII hex string (e.g., "01ab")
- * @buf: Buffer for the binary data
- * @len: Length of the text to convert in bytes (of buf); hex will be double
- * this size
- * Returns: 0 on success, -1 on failure (invalid hex string)
- */
-int hexstr2bin(const char *hex, u8 *buf, size_t len)
-{
-       int i, a;
-       const char *ipos = hex;
-       u8 *opos = buf;
-
-       for (i = 0; i < len; i++) {
-               a = hex2byte(ipos);
-               if (a < 0)
-                       return -1;
-               *opos++ = a;
-               ipos += 2;
-       }
-       return 0;
-}
-
-
-char * rel2abs_path(const char *rel_path)
-{
-       char *buf = NULL, *cwd, *ret;
-       size_t len = 128, cwd_len, rel_len, ret_len;
-
-       if (rel_path[0] == '/')
-               return strdup(rel_path);
-
-       for (;;) {
-               buf = malloc(len);
-               if (buf == NULL)
-                       return NULL;
-               cwd = getcwd(buf, len);
-               if (cwd == NULL) {
-                       free(buf);
-                       if (errno != ERANGE) {
-                               return NULL;
-                       }
-                       len *= 2;
-               } else {
-                       break;
-               }
-       }
-
-       cwd_len = strlen(cwd);
-       rel_len = strlen(rel_path);
-       ret_len = cwd_len + 1 + rel_len + 1;
-       ret = malloc(ret_len);
-       if (ret) {
-               memcpy(ret, cwd, cwd_len);
-               ret[cwd_len] = '/';
-               memcpy(ret + cwd_len + 1, rel_path, rel_len);
-               ret[ret_len - 1] = '\0';
-       }
-       free(buf);
-       return ret;
-}
-
-
-/**
- * inc_byte_array - Increment arbitrary length byte array by one
- * @counter: Pointer to byte array
- * @len: Length of the counter in bytes
- *
- * This function increments the last byte of the counter by one and continues
- * rolling over to more significant bytes if the byte was incremented from
- * 0xff to 0x00.
- */
-void inc_byte_array(u8 *counter, size_t len)
-{
-       int pos = len - 1;
-       while (pos >= 0) {
-               counter[pos]++;
-               if (counter[pos] != 0)
-                       break;
-               pos--;
-       }
-}
-
-
-void print_char(char c)
-{
-       if (c >= 32 && c < 127)
-               printf("%c", c);
-       else
-               printf("<%02x>", c);
-}
-
-
-void fprint_char(FILE *f, char c)
-{
-       if (c >= 32 && c < 127)
-               fprintf(f, "%c", c);
-       else
-               fprintf(f, "<%02x>", c);
-}
-
-
-#ifndef CONFIG_NO_STDOUT_DEBUG
-
-void wpa_debug_print_timestamp(void)
-{
-       struct timeval tv;
-       char buf[16];
-
-       if (!wpa_debug_timestamp)
-               return;
-
-       gettimeofday(&tv, NULL);
-       if (strftime(buf, sizeof(buf), "%b %d %H:%M:%S",
-                    localtime((const time_t *) &tv.tv_sec)) <= 0) {
-               snprintf(buf, sizeof(buf), "%u", (int) tv.tv_sec);
-       }
-       printf("%s.%06u: ", buf, (unsigned int) tv.tv_usec);
-}
-
-
-/**
- * wpa_printf - conditional printf
- * @level: priority level (MSG_*) of the message
- * @fmt: printf format string, followed by optional arguments
- *
- * This function is used to print conditional debugging and error messages. The
- * output may be directed to stdout, stderr, and/or syslog based on
- * configuration.
- *
- * Note: New line '\n' is added to the end of the text when printing to stdout.
- */
-void wpa_printf(int level, char *fmt, ...)
-{
-       va_list ap;
-
-       va_start(ap, fmt);
-       if (level >= wpa_debug_level) {
-               wpa_debug_print_timestamp();
-               vprintf(fmt, ap);
-               printf("\n");
-       }
-       va_end(ap);
-}
-
-
-static void _wpa_hexdump(int level, const char *title, const u8 *buf,
-                        size_t len, int show)
-{
-       size_t i;
-       if (level < wpa_debug_level)
-               return;
-       wpa_debug_print_timestamp();
-       printf("%s - hexdump(len=%lu):", title, (unsigned long) len);
-       if (buf == NULL) {
-               printf(" [NULL]");
-       } else if (show) {
-               for (i = 0; i < len; i++)
-                       printf(" %02x", buf[i]);
-       } else {
-               printf(" [REMOVED]");
-       }
-       printf("\n");
-}
-
-void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
-{
-       _wpa_hexdump(level, title, buf, len, 1);
-}
-
-
-void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
-{
-       _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
-}
-
-
-static void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
-                              size_t len, int show)
-{
-       int i, llen;
-       const u8 *pos = buf;
-       const int line_len = 16;
-
-       if (level < wpa_debug_level)
-               return;
-       wpa_debug_print_timestamp();
-       if (!show) {
-               printf("%s - hexdump_ascii(len=%lu): [REMOVED]\n",
-                      title, (unsigned long) len);
-               return;
-       }
-       if (buf == NULL) {
-               printf("%s - hexdump_ascii(len=%lu): [NULL]\n",
-                      title, (unsigned long) len);
-               return;
-       }
-       printf("%s - hexdump_ascii(len=%lu):\n", title, (unsigned long) len);
-       while (len) {
-               llen = len > line_len ? line_len : len;
-               printf("    ");
-               for (i = 0; i < llen; i++)
-                       printf(" %02x", pos[i]);
-               for (i = llen; i < line_len; i++)
-                       printf("   ");
-               printf("   ");
-               for (i = 0; i < llen; i++) {
-                       if (isprint(pos[i]))
-                               printf("%c", pos[i]);
-                       else
-                               printf("_");
-               }
-               for (i = llen; i < line_len; i++)
-                       printf(" ");
-               printf("\n");
-               pos += llen;
-               len -= llen;
-       }
-}
-
-
-void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
-{
-       _wpa_hexdump_ascii(level, title, buf, len, 1);
-}
-
-
-void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
-                          size_t len)
-{
-       _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
-}
-
-#endif /* CONFIG_NO_STDOUT_DEBUG */
-
-
-#ifdef CONFIG_NATIVE_WINDOWS
-
-#define EPOCHFILETIME (116444736000000000ULL)
-
-int gettimeofday(struct timeval *tv, struct timezone *tz)
-{
-       FILETIME ft;
-       LARGE_INTEGER li;
-       ULONGLONG t;
-
-       GetSystemTimeAsFileTime(&ft);
-       li.LowPart = ft.dwLowDateTime;
-       li.HighPart = ft.dwHighDateTime;
-       t = (li.QuadPart - EPOCHFILETIME) / 10;
-       tv->tv_sec = (long) (t / 1000000);
-       tv->tv_usec = (long) (t % 1000000);
-
-       return 0;
-}
-#endif /* CONFIG_NATIVE_WINDOWS */
diff --git a/contrib/hostapd-0.4.9/common.h b/contrib/hostapd-0.4.9/common.h
deleted file mode 100644 (file)
index 2ce8a5a..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * wpa_supplicant/hostapd / common helper functions, etc.
- * Copyright (c) 2002-2005, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#ifndef COMMON_H
-#define COMMON_H
-
-#ifdef __linux__
-#include <endian.h>
-#include <byteswap.h>
-#endif /* __linux__ */
-
-#if defined(__FreeBSD__) || defined(__NetBSD__)
-#include <sys/types.h>
-#include <sys/endian.h>
-#define __BYTE_ORDER   _BYTE_ORDER
-#define        __LITTLE_ENDIAN _LITTLE_ENDIAN
-#define        __BIG_ENDIAN    _BIG_ENDIAN
-#define bswap_16 bswap16
-#define bswap_32 bswap32
-#define bswap_64 bswap64
-#endif /* defined(__FreeBSD__) || defined(__NetBSD__) */
-
-#ifdef CONFIG_NATIVE_WINDOWS
-#include <winsock2.h>
-
-static inline int daemon(int nochdir, int noclose)
-{
-       printf("Windows - daemon() not supported yet\n");
-       return -1;
-}
-
-static inline void sleep(int seconds)
-{
-       Sleep(seconds * 1000);
-}
-
-static inline void usleep(unsigned long usec)
-{
-       Sleep(usec / 1000);
-}
-
-#ifndef timersub
-#define timersub(a, b, res) do { \
-       (res)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
-       (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
-       if ((res)->tv_usec < 0) { \
-               (res)->tv_sec--; \
-               (res)->tv_usec += 1000000; \
-       } \
-} while (0)
-#endif
-
-struct timezone {
-       int  tz_minuteswest;
-       int  tz_dsttime;
-};
-
-int gettimeofday(struct timeval *tv, struct timezone *tz);
-
-static inline long int random(void)
-{
-       return rand();
-}
-
-typedef int gid_t;
-typedef int socklen_t;
-
-#ifndef MSG_DONTWAIT
-#define MSG_DONTWAIT 0 /* not supported */
-#endif
-
-#endif /* CONFIG_NATIVE_WINDOWS */
-
-#if defined(__CYGWIN__) || defined(CONFIG_NATIVE_WINDOWS)
-
-static inline unsigned short wpa_swap_16(unsigned short v)
-{
-       return ((v & 0xff) << 8) | (v >> 8);
-}
-
-static inline unsigned int wpa_swap_32(unsigned int v)
-{
-       return ((v & 0xff) << 24) | ((v & 0xff00) << 8) |
-               ((v & 0xff0000) >> 8) | (v >> 24);
-}
-
-#define le_to_host16(n) (n)
-#define host_to_le16(n) (n)
-#define be_to_host16(n) wpa_swap_16(n)
-#define host_to_be16(n) wpa_swap_16(n)
-#define le_to_host32(n) (n)
-#define be_to_host32(n) wpa_swap_32(n)
-#define host_to_be32(n) wpa_swap_32(n)
-
-#else /* __CYGWIN__ */
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define le_to_host16(n) (n)
-#define host_to_le16(n) (n)
-#define be_to_host16(n) bswap_16(n)
-#define host_to_be16(n) bswap_16(n)
-#define le_to_host32(n) (n)
-#define be_to_host32(n) bswap_32(n)
-#define host_to_be32(n) bswap_32(n)
-#elif __BYTE_ORDER == __BIG_ENDIAN
-#define le_to_host16(n) bswap_16(n)
-#define host_to_le16(n) bswap_16(n)
-#define be_to_host16(n) (n)
-#define host_to_be16(n) (n)
-#define le_to_host32(n) bswap_32(n)
-#define be_to_host32(n) (n)
-#define host_to_be32(n) (n)
-#ifndef WORDS_BIGENDIAN
-#define WORDS_BIGENDIAN
-#endif
-#else
-#error Could not determine CPU byte order
-#endif
-
-#endif /* __CYGWIN__ */
-
-/* Macros for handling unaligned 16-bit variables */
-#define WPA_GET_BE16(a) ((u16) (((a)[0] << 8) | (a)[1]))
-#define WPA_PUT_BE16(a, val)                   \
-       do {                                    \
-               (a)[0] = ((u16) (val)) >> 8;    \
-               (a)[1] = ((u16) (val)) & 0xff;  \
-       } while (0)
-
-#define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0]))
-#define WPA_PUT_LE16(a, val)                   \
-       do {                                    \
-               (a)[1] = ((u16) (val)) >> 8;    \
-               (a)[0] = ((u16) (val)) & 0xff;  \
-       } while (0)
-
-#define WPA_GET_BE32(a) ((((u32) (a)[0]) << 24) | (((u32) (a)[1]) << 16) | \
-                        (((u32) (a)[2]) << 8) | ((u32) (a)[3]))
-
-
-#ifndef ETH_ALEN
-#define ETH_ALEN 6
-#endif
-
-#include <stdint.h>
-typedef uint64_t u64;
-typedef uint32_t u32;
-typedef uint16_t u16;
-typedef uint8_t u8;
-typedef int64_t s64;
-typedef int32_t s32;
-typedef int16_t s16;
-typedef int8_t s8;
-
-int hostapd_get_rand(u8 *buf, size_t len);
-void hostapd_hexdump(const char *title, const u8 *buf, size_t len);
-int hwaddr_aton(const char *txt, u8 *addr);
-int hexstr2bin(const char *hex, u8 *buf, size_t len);
-char * rel2abs_path(const char *rel_path);
-void inc_byte_array(u8 *counter, size_t len);
-void print_char(char c);
-void fprint_char(FILE *f, char c);
-
-
-/* Debugging function - conditional printf and hex dump. Driver wrappers can
- *  use these for debugging purposes. */
-
-enum { MSG_MSGDUMP, MSG_DEBUG, MSG_INFO, MSG_WARNING, MSG_ERROR };
-
-#ifdef CONFIG_NO_STDOUT_DEBUG
-
-#define wpa_debug_print_timestamp() do { } while (0)
-#define wpa_printf(args...) do { } while (0)
-#define wpa_hexdump(args...) do { } while (0)
-#define wpa_hexdump_key(args...) do { } while (0)
-#define wpa_hexdump_ascii(args...) do { } while (0)
-#define wpa_hexdump_ascii_key(args...) do { } while (0)
-
-#else /* CONFIG_NO_STDOUT_DEBUG */
-
-/**
- * wpa_debug_printf_timestamp - Print timestamp for debug output
- *
- * This function prints a timestamp in <seconds from 1970>.<microsoconds>
- * format if debug output has been configured to include timestamps in debug
- * messages.
- */
-void wpa_debug_print_timestamp(void);
-
-/**
- * wpa_printf - conditional printf
- * @level: priority level (MSG_*) of the message
- * @fmt: printf format string, followed by optional arguments
- *
- * This function is used to print conditional debugging and error messages. The
- * output may be directed to stdout, stderr, and/or syslog based on
- * configuration.
- *
- * Note: New line '\n' is added to the end of the text when printing to stdout.
- */
-void wpa_printf(int level, char *fmt, ...)
-__attribute__ ((format (printf, 2, 3)));
-
-/**
- * wpa_hexdump - conditional hex dump
- * @level: priority level (MSG_*) of the message
- * @title: title of for the message
- * @buf: data buffer to be dumped
- * @len: length of the buf
- *
- * This function is used to print conditional debugging and error messages. The
- * output may be directed to stdout, stderr, and/or syslog based on
- * configuration. The contents of buf is printed out has hex dump.
- */
-void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
-
-/**
- * wpa_hexdump_key - conditional hex dump, hide keys
- * @level: priority level (MSG_*) of the message
- * @title: title of for the message
- * @buf: data buffer to be dumped
- * @len: length of the buf
- *
- * This function is used to print conditional debugging and error messages. The
- * output may be directed to stdout, stderr, and/or syslog based on
- * configuration. The contents of buf is printed out has hex dump. This works
- * like wpa_hexdump(), but by default, does not include secret keys (passwords,
- * etc.) in debug output.
- */
-void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len);
-
-/**
- * wpa_hexdump_ascii - conditional hex dump
- * @level: priority level (MSG_*) of the message
- * @title: title of for the message
- * @buf: data buffer to be dumped
- * @len: length of the buf
- *
- * This function is used to print conditional debugging and error messages. The
- * output may be directed to stdout, stderr, and/or syslog based on
- * configuration. The contents of buf is printed out has hex dump with both
- * the hex numbers and ASCII characters (for printable range) are shown. 16
- * bytes per line will be shown.
- */
-void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
-                      size_t len);
-
-/**
- * wpa_hexdump_ascii_key - conditional hex dump, hide keys
- * @level: priority level (MSG_*) of the message
- * @title: title of for the message
- * @buf: data buffer to be dumped
- * @len: length of the buf
- *
- * This function is used to print conditional debugging and error messages. The
- * output may be directed to stdout, stderr, and/or syslog based on
- * configuration. The contents of buf is printed out has hex dump with both
- * the hex numbers and ASCII characters (for printable range) are shown. 16
- * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
- * default, does not include secret keys (passwords, etc.) in debug output.
- */
-void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
-                          size_t len);
-
-#endif /* CONFIG_NO_STDOUT_DEBUG */
-
-
-#ifdef EAPOL_TEST
-#define WPA_ASSERT(a)                                                 \
-       do {                                                           \
-               if (!(a)) {                                            \
-                       printf("WPA_ASSERT FAILED '" #a "' "           \
-                              "%s %s:%d\n",                           \
-                              __FUNCTION__, __FILE__, __LINE__);      \
-                       exit(1);                                       \
-               }                                                      \
-       } while (0)
-#else
-#define WPA_ASSERT(a) do { } while (0)
-#endif
-
-#endif /* COMMON_H */
diff --git a/contrib/hostapd-0.4.9/config.c b/contrib/hostapd-0.4.9/config.c
deleted file mode 100644 (file)
index 1c4f84e..0000000
+++ /dev/null
@@ -1,1230 +0,0 @@
-/*
- * Host AP (software wireless LAN access point) user space daemon for
- * Host AP kernel driver / Configuration file
- * Copyright (c) 2003-2006, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <grp.h>
-
-#include "hostapd.h"
-#include "driver.h"
-#include "sha1.h"
-#include "eap.h"
-#include "radius_client.h"
-#include "ieee802_1x.h"
-
-
-static struct hostapd_config *hostapd_config_defaults(void)
-{
-       struct hostapd_config *conf;
-
-       conf = malloc(sizeof(*conf) + sizeof(struct hostapd_radius_servers));
-       if (conf == NULL) {
-               printf("Failed to allocate memory for configuration data.\n");
-               return NULL;
-       }
-       memset(conf, 0, sizeof(*conf) + sizeof(struct hostapd_radius_servers));
-       conf->radius = (struct hostapd_radius_servers *) (conf + 1);
-
-       /* set default driver based on configuration */
-       conf->driver = driver_lookup("default");
-       if (conf->driver == NULL) {
-               printf("No default driver registered!\n");
-               free(conf);
-               return NULL;
-       }
-
-       conf->wep_rekeying_period = 300;
-       conf->eap_reauth_period = 3600;
-
-       conf->logger_syslog_level = HOSTAPD_LEVEL_INFO;
-       conf->logger_stdout_level = HOSTAPD_LEVEL_INFO;
-       conf->logger_syslog = (unsigned int) -1;
-       conf->logger_stdout = (unsigned int) -1;
-
-       conf->auth_algs = HOSTAPD_AUTH_OPEN | HOSTAPD_AUTH_SHARED_KEY;
-       conf->eapol_version = EAPOL_VERSION;
-
-       conf->wpa_group_rekey = 600;
-       conf->wpa_gmk_rekey = 86400;
-       conf->wpa_key_mgmt = WPA_KEY_MGMT_PSK;
-       conf->wpa_pairwise = WPA_CIPHER_TKIP;
-       conf->wpa_group = WPA_CIPHER_TKIP;
-
-       conf->radius_server_auth_port = 1812;
-
-       return conf;
-}
-
-
-static int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr)
-{
-       if (inet_aton(txt, &addr->u.v4)) {
-               addr->af = AF_INET;
-               return 0;
-       }
-
-#ifdef CONFIG_IPV6
-       if (inet_pton(AF_INET6, txt, &addr->u.v6) > 0) {
-               addr->af = AF_INET6;
-               return 0;
-       }
-#endif /* CONFIG_IPV6 */
-
-       return -1;
-}
-
-
-static int mac_comp(const void *a, const void *b)
-{
-       return memcmp(a, b, sizeof(macaddr));
-}
-
-
-static int hostapd_config_read_maclist(const char *fname, macaddr **acl,
-                                      int *num)
-{
-       FILE *f;
-       char buf[128], *pos;
-       int line = 0;
-       u8 addr[ETH_ALEN];
-       macaddr *newacl;
-
-       if (!fname)
-               return 0;
-
-       f = fopen(fname, "r");
-       if (!f) {
-               printf("MAC list file '%s' not found.\n", fname);
-               return -1;
-       }
-
-       while (fgets(buf, sizeof(buf), f)) {
-               line++;
-
-               if (buf[0] == '#')
-                       continue;
-               pos = buf;
-               while (*pos != '\0') {
-                       if (*pos == '\n') {
-                               *pos = '\0';
-                               break;
-                       }
-                       pos++;
-               }
-               if (buf[0] == '\0')
-                       continue;
-
-               if (hwaddr_aton(buf, addr)) {
-                       printf("Invalid MAC address '%s' at line %d in '%s'\n",
-                              buf, line, fname);
-                       fclose(f);
-                       return -1;
-               }
-
-               newacl = (macaddr *) realloc(*acl, (*num + 1) * ETH_ALEN);
-               if (newacl == NULL) {
-                       printf("MAC list reallocation failed\n");
-                       fclose(f);
-                       return -1;
-               }
-
-               *acl = newacl;
-               memcpy((*acl)[*num], addr, ETH_ALEN);
-               (*num)++;
-       }
-
-       fclose(f);
-
-       qsort(*acl, *num, sizeof(macaddr), mac_comp);
-
-       return 0;
-}
-
-
-static int hostapd_config_read_wpa_psk(const char *fname,
-                                      struct hostapd_config *conf)
-{
-       FILE *f;
-       char buf[128], *pos;
-       int line = 0, ret = 0, len, ok;
-       u8 addr[ETH_ALEN];
-       struct hostapd_wpa_psk *psk;
-
-       if (!fname)
-               return 0;
-
-       f = fopen(fname, "r");
-       if (!f) {
-               printf("WPA PSK file '%s' not found.\n", fname);
-               return -1;
-       }
-
-       while (fgets(buf, sizeof(buf), f)) {
-               line++;
-
-               if (buf[0] == '#')
-                       continue;
-               pos = buf;
-               while (*pos != '\0') {
-                       if (*pos == '\n') {
-                               *pos = '\0';
-                               break;
-                       }
-                       pos++;
-               }
-               if (buf[0] == '\0')
-                       continue;
-
-               if (hwaddr_aton(buf, addr)) {
-                       printf("Invalid MAC address '%s' on line %d in '%s'\n",
-                              buf, line, fname);
-                       ret = -1;
-                       break;
-               }
-
-               psk = malloc(sizeof(*psk));
-               if (psk == NULL) {
-                       printf("WPA PSK allocation failed\n");
-                       ret = -1;
-                       break;
-               }
-               memset(psk, 0, sizeof(*psk));
-               if (memcmp(addr, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0)
-                       psk->group = 1;
-               else
-                       memcpy(psk->addr, addr, ETH_ALEN);
-
-               pos = buf + 17;
-               if (pos == '\0') {
-                       printf("No PSK on line %d in '%s'\n", line, fname);
-                       free(psk);
-                       ret = -1;
-                       break;
-               }
-               pos++;
-
-               ok = 0;
-               len = strlen(pos);
-               if (len == 64 && hexstr2bin(pos, psk->psk, PMK_LEN) == 0)
-                       ok = 1;
-               else if (len >= 8 && len < 64) {
-                       pbkdf2_sha1(pos, conf->ssid, conf->ssid_len,
-                                   4096, psk->psk, PMK_LEN);
-                       ok = 1;
-               }
-               if (!ok) {
-                       printf("Invalid PSK '%s' on line %d in '%s'\n",
-                              pos, line, fname);
-                       free(psk);
-                       ret = -1;
-                       break;
-               }
-
-               psk->next = conf->wpa_psk;
-               conf->wpa_psk = psk;
-       }
-
-       fclose(f);
-
-       return ret;
-}
-
-
-int hostapd_setup_wpa_psk(struct hostapd_config *conf)
-{
-       if (conf->wpa_passphrase != NULL) {
-               if (conf->wpa_psk != NULL) {
-                       printf("Warning: both WPA PSK and passphrase set. "
-                              "Using passphrase.\n");
-                       free(conf->wpa_psk);
-               }
-               conf->wpa_psk = malloc(sizeof(struct hostapd_wpa_psk));
-               if (conf->wpa_psk == NULL) {
-                       printf("Unable to alloc space for PSK\n");
-                       return -1;
-               }
-               wpa_hexdump_ascii(MSG_DEBUG, "SSID",
-                                 (u8 *) conf->ssid, conf->ssid_len);
-               wpa_hexdump_ascii(MSG_DEBUG, "PSK (ASCII passphrase)",
-                                 (u8 *) conf->wpa_passphrase,
-                                 strlen(conf->wpa_passphrase));
-               memset(conf->wpa_psk, 0, sizeof(struct hostapd_wpa_psk));
-               pbkdf2_sha1(conf->wpa_passphrase,
-                           conf->ssid, conf->ssid_len,
-                           4096, conf->wpa_psk->psk, PMK_LEN);
-               wpa_hexdump(MSG_DEBUG, "PSK (from passphrase)",
-                           conf->wpa_psk->psk, PMK_LEN);
-               conf->wpa_psk->group = 1;
-
-               memset(conf->wpa_passphrase, 0, strlen(conf->wpa_passphrase));
-               free(conf->wpa_passphrase);
-               conf->wpa_passphrase = 0;
-       }
-
-       if (conf->wpa_psk_file) {
-               if (hostapd_config_read_wpa_psk(conf->wpa_psk_file, conf))
-                       return -1;
-               free(conf->wpa_psk_file);
-               conf->wpa_psk_file = NULL;
-       }
-
-       return 0;
-}
-
-
-#ifdef EAP_SERVER
-static int hostapd_config_read_eap_user(const char *fname,
-                                       struct hostapd_config *conf)
-{
-       FILE *f;
-       char buf[512], *pos, *start, *pos2;
-       int line = 0, ret = 0, num_methods;
-       struct hostapd_eap_user *user, *tail = NULL;
-
-       if (!fname)
-               return 0;
-
-       f = fopen(fname, "r");
-       if (!f) {
-               printf("EAP user file '%s' not found.\n", fname);
-               return -1;
-       }
-
-       /* Lines: "user" METHOD,METHOD2 "password" (password optional) */
-       while (fgets(buf, sizeof(buf), f)) {
-               line++;
-
-               if (buf[0] == '#')
-                       continue;
-               pos = buf;
-               while (*pos != '\0') {
-                       if (*pos == '\n') {
-                               *pos = '\0';
-                               break;
-                       }
-                       pos++;
-               }
-               if (buf[0] == '\0')
-                       continue;
-
-               user = NULL;
-
-               if (buf[0] != '"' && buf[0] != '*') {
-                       printf("Invalid EAP identity (no \" in start) on "
-                              "line %d in '%s'\n", line, fname);
-                       goto failed;
-               }
-
-               user = malloc(sizeof(*user));
-               if (user == NULL) {
-                       printf("EAP user allocation failed\n");
-                       goto failed;
-               }
-               memset(user, 0, sizeof(*user));
-               user->force_version = -1;
-
-               if (buf[0] == '*') {
-                       pos = buf;
-               } else {
-                       pos = buf + 1;
-                       start = pos;
-                       while (*pos != '"' && *pos != '\0')
-                               pos++;
-                       if (*pos == '\0') {
-                               printf("Invalid EAP identity (no \" in end) on"
-                                      " line %d in '%s'\n", line, fname);
-                               goto failed;
-                       }
-
-                       user->identity = malloc(pos - start);
-                       if (user->identity == NULL) {
-                               printf("Failed to allocate memory for EAP "
-                                      "identity\n");
-                               goto failed;
-                       }
-                       memcpy(user->identity, start, pos - start);
-                       user->identity_len = pos - start;
-               }
-               pos++;
-               while (*pos == ' ' || *pos == '\t')
-                       pos++;
-
-               if (*pos == '\0') {
-                       printf("No EAP method on line %d in '%s'\n",
-                              line, fname);
-                       goto failed;
-               }
-
-               start = pos;
-               while (*pos != ' ' && *pos != '\t' && *pos != '\0')
-                       pos++;
-               if (*pos == '\0') {
-                       pos = NULL;
-               } else {
-                       *pos = '\0';
-                       pos++;
-               }
-               num_methods = 0;
-               while (*start) {
-                       char *pos2 = strchr(start, ',');
-                       if (pos2) {
-                               *pos2++ = '\0';
-                       }
-                       user->methods[num_methods] = eap_get_type(start);
-                       if (user->methods[num_methods] == EAP_TYPE_NONE) {
-                               printf("Unsupported EAP type '%s' on line %d "
-                                      "in '%s'\n", start, line, fname);
-                               goto failed;
-                       }
-
-                       num_methods++;
-                       if (num_methods >= EAP_USER_MAX_METHODS)
-                               break;
-                       if (pos2 == NULL)
-                               break;
-                       start = pos2;
-               }
-               if (num_methods == 0) {
-                       printf("No EAP types configured on line %d in '%s'\n",
-                              line, fname);
-                       goto failed;
-               }
-
-               if (pos == NULL)
-                       goto done;
-
-               while (*pos == ' ' || *pos == '\t')
-                       pos++;
-               if (*pos == '\0')
-                       goto done;
-
-               if (strncmp(pos, "[ver=0]", 7) == 0) {
-                       user->force_version = 0;
-                       goto done;
-               }
-
-               if (strncmp(pos, "[ver=1]", 7) == 0) {
-                       user->force_version = 1;
-                       goto done;
-               }
-
-               if (strncmp(pos, "[2]", 3) == 0) {
-                       user->phase2 = 1;
-                       goto done;
-               }
-
-               if (*pos == '"') {
-                       pos++;
-                       start = pos;
-                       while (*pos != '"' && *pos != '\0')
-                               pos++;
-                       if (*pos == '\0') {
-                               printf("Invalid EAP password (no \" in end) "
-                                      "on line %d in '%s'\n", line, fname);
-                               goto failed;
-                       }
-
-                       user->password = malloc(pos - start);
-                       if (user->password == NULL) {
-                               printf("Failed to allocate memory for EAP "
-                                      "password\n");
-                               goto failed;
-                       }
-                       memcpy(user->password, start, pos - start);
-                       user->password_len = pos - start;
-
-                       pos++;
-               } else {
-                       pos2 = pos;
-                       while (*pos2 != '\0' && *pos2 != ' ' &&
-                              *pos2 != '\t' && *pos2 != '#')
-                               pos2++;
-                       if ((pos2 - pos) & 1) {
-                               printf("Invalid hex password on line %d in "
-                                      "'%s'\n", line, fname);
-                               goto failed;
-                       }
-                       user->password = malloc((pos2 - pos) / 2);
-                       if (user->password == NULL) {
-                               printf("Failed to allocate memory for EAP "
-                                      "password\n");
-                               goto failed;
-                       }
-                       if (hexstr2bin(pos, user->password,
-                                      (pos2 - pos) / 2) < 0) {
-                               printf("Invalid hex password on line %d in "
-                                      "'%s'\n", line, fname);
-                               goto failed;
-                       }
-                       user->password_len = (pos2 - pos) / 2;
-                       pos = pos2;
-               }
-
-               while (*pos == ' ' || *pos == '\t')
-                       pos++;
-               if (strncmp(pos, "[2]", 3) == 0) {
-                       user->phase2 = 1;
-               }
-
-       done:
-               if (tail == NULL) {
-                       tail = conf->eap_user = user;
-               } else {
-                       tail->next = user;
-                       tail = user;
-               }
-               continue;
-
-       failed:
-               if (user) {
-                       free(user->identity);
-                       free(user);
-               }
-               ret = -1;
-               break;
-       }
-
-       fclose(f);
-
-       return ret;
-}
-#endif /* EAP_SERVER */
-
-
-static int
-hostapd_config_read_radius_addr(struct hostapd_radius_server **server,
-                               int *num_server, const char *val, int def_port,
-                               struct hostapd_radius_server **curr_serv)
-{
-       struct hostapd_radius_server *nserv;
-       int ret;
-       static int server_index = 1;
-
-       nserv = realloc(*server, (*num_server + 1) * sizeof(*nserv));
-       if (nserv == NULL)
-               return -1;
-
-       *server = nserv;
-       nserv = &nserv[*num_server];
-       (*num_server)++;
-       (*curr_serv) = nserv;
-
-       memset(nserv, 0, sizeof(*nserv));
-       nserv->port = def_port;
-       ret = hostapd_parse_ip_addr(val, &nserv->addr);
-       nserv->index = server_index++;
-
-       return ret;
-}
-
-
-static int hostapd_config_parse_key_mgmt(int line, const char *value)
-{
-       int val = 0, last;
-       char *start, *end, *buf;
-
-       buf = strdup(value);
-       if (buf == NULL)
-               return -1;
-       start = buf;
-
-       while (start != '\0') {
-               while (*start == ' ' || *start == '\t')
-                       start++;
-               if (*start == '\0')
-                       break;
-               end = start;
-               while (*end != ' ' && *end != '\t' && *end != '\0')
-                       end++;
-               last = *end == '\0';
-               *end = '\0';
-               if (strcmp(start, "WPA-PSK") == 0)
-                       val |= WPA_KEY_MGMT_PSK;
-               else if (strcmp(start, "WPA-EAP") == 0)
-                       val |= WPA_KEY_MGMT_IEEE8021X;
-               else {
-                       printf("Line %d: invalid key_mgmt '%s'", line, start);
-                       free(buf);
-                       return -1;
-               }
-
-               if (last)
-                       break;
-               start = end + 1;
-       }
-
-       free(buf);
-       if (val == 0) {
-               printf("Line %d: no key_mgmt values configured.", line);
-               return -1;
-       }
-
-       return val;
-}
-
-
-static int hostapd_config_parse_cipher(int line, const char *value)
-{
-       int val = 0, last;
-       char *start, *end, *buf;
-
-       buf = strdup(value);
-       if (buf == NULL)
-               return -1;
-       start = buf;
-
-       while (start != '\0') {
-               while (*start == ' ' || *start == '\t')
-                       start++;
-               if (*start == '\0')
-                       break;
-               end = start;
-               while (*end != ' ' && *end != '\t' && *end != '\0')
-                       end++;
-               last = *end == '\0';
-               *end = '\0';
-               if (strcmp(start, "CCMP") == 0)
-                       val |= WPA_CIPHER_CCMP;
-               else if (strcmp(start, "TKIP") == 0)
-                       val |= WPA_CIPHER_TKIP;
-               else if (strcmp(start, "WEP104") == 0)
-                       val |= WPA_CIPHER_WEP104;
-               else if (strcmp(start, "WEP40") == 0)
-                       val |= WPA_CIPHER_WEP40;
-               else if (strcmp(start, "NONE") == 0)
-                       val |= WPA_CIPHER_NONE;
-               else {
-                       printf("Line %d: invalid cipher '%s'.", line, start);
-                       free(buf);
-                       return -1;
-               }
-
-               if (last)
-                       break;
-               start = end + 1;
-       }
-       free(buf);
-
-       if (val == 0) {
-               printf("Line %d: no cipher values configured.", line);
-               return -1;
-       }
-       return val;
-}
-
-
-static int hostapd_config_check(struct hostapd_config *conf)
-{
-       if (conf->ieee802_1x && !conf->eap_server &&
-           !conf->radius->auth_servers) {
-               printf("Invalid IEEE 802.1X configuration (no EAP "
-                      "authenticator configured).\n");
-               return -1;
-       }
-
-       if (conf->wpa && (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK) &&
-           conf->wpa_psk == NULL && conf->wpa_passphrase == NULL &&
-           conf->wpa_psk_file == NULL) {
-               printf("WPA-PSK enabled, but PSK or passphrase is not "
-                      "configured.\n");
-               return -1;
-       }
-
-       return 0;
-}
-
-
-struct hostapd_config * hostapd_config_read(const char *fname)
-{
-       struct hostapd_config *conf;
-       FILE *f;
-       char buf[256], *pos;
-       int line = 0;
-       int errors = 0;
-       char *accept_mac_file = NULL, *deny_mac_file = NULL;
-#ifdef EAP_SERVER
-       char *eap_user_file = NULL;
-#endif /* EAP_SERVER */
-
-       f = fopen(fname, "r");
-       if (f == NULL) {
-               printf("Could not open configuration file '%s' for reading.\n",
-                      fname);
-               return NULL;
-       }
-
-       conf = hostapd_config_defaults();
-       if (conf == NULL) {
-               fclose(f);
-               return NULL;
-       }
-
-       while (fgets(buf, sizeof(buf), f)) {
-               line++;
-
-               if (buf[0] == '#')
-                       continue;
-               pos = buf;
-               while (*pos != '\0') {
-                       if (*pos == '\n') {
-                               *pos = '\0';
-                               break;
-                       }
-                       pos++;
-               }
-               if (buf[0] == '\0')
-                       continue;
-
-               pos = strchr(buf, '=');
-               if (pos == NULL) {
-                       printf("Line %d: invalid line '%s'\n", line, buf);
-                       errors++;
-                       continue;
-               }
-               *pos = '\0';
-               pos++;
-
-               if (strcmp(buf, "interface") == 0) {
-                       snprintf(conf->iface, sizeof(conf->iface), "%s", pos);
-               } else if (strcmp(buf, "bridge") == 0) {
-                       snprintf(conf->bridge, sizeof(conf->bridge), "%s",
-                                pos);
-               } else if (strcmp(buf, "driver") == 0) {
-                       conf->driver = driver_lookup(pos);
-                       if (conf->driver == NULL) {
-                               printf("Line %d: invalid/unknown driver "
-                                      "'%s'\n", line, pos);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "debug") == 0) {
-                       conf->debug = atoi(pos);
-               } else if (strcmp(buf, "logger_syslog_level") == 0) {
-                       conf->logger_syslog_level = atoi(pos);
-               } else if (strcmp(buf, "logger_stdout_level") == 0) {
-                       conf->logger_stdout_level = atoi(pos);
-               } else if (strcmp(buf, "logger_syslog") == 0) {
-                       conf->logger_syslog = atoi(pos);
-               } else if (strcmp(buf, "logger_stdout") == 0) {
-                       conf->logger_stdout = atoi(pos);
-               } else if (strcmp(buf, "dump_file") == 0) {
-                       conf->dump_log_name = strdup(pos);
-               } else if (strcmp(buf, "ssid") == 0) {
-                       conf->ssid_len = strlen(pos);
-                       if (conf->ssid_len >= HOSTAPD_SSID_LEN ||
-                           conf->ssid_len < 1) {
-                               printf("Line %d: invalid SSID '%s'\n", line,
-                                      pos);
-                               errors++;
-                       }
-                       memcpy(conf->ssid, pos, conf->ssid_len);
-                       conf->ssid[conf->ssid_len] = '\0';
-                       conf->ssid_set = 1;
-               } else if (strcmp(buf, "macaddr_acl") == 0) {
-                       conf->macaddr_acl = atoi(pos);
-                       if (conf->macaddr_acl != ACCEPT_UNLESS_DENIED &&
-                           conf->macaddr_acl != DENY_UNLESS_ACCEPTED &&
-                           conf->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) {
-                               printf("Line %d: unknown macaddr_acl %d\n",
-                                      line, conf->macaddr_acl);
-                       }
-               } else if (strcmp(buf, "accept_mac_file") == 0) {
-                       accept_mac_file = strdup(pos);
-                       if (!accept_mac_file) {
-                               printf("Line %d: allocation failed\n", line);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "deny_mac_file") == 0) {
-                       deny_mac_file = strdup(pos);
-                       if (!deny_mac_file) {
-                               printf("Line %d: allocation failed\n", line);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "assoc_ap_addr") == 0) {
-                       if (hwaddr_aton(pos, conf->assoc_ap_addr)) {
-                               printf("Line %d: invalid MAC address '%s'\n",
-                                      line, pos);
-                               errors++;
-                       }
-                       conf->assoc_ap = 1;
-               } else if (strcmp(buf, "ieee8021x") == 0) {
-                       conf->ieee802_1x = atoi(pos);
-               } else if (strcmp(buf, "eapol_version") == 0) {
-                       conf->eapol_version = atoi(pos);
-                       if (conf->eapol_version < 1 ||
-                           conf->eapol_version > 2) {
-                               printf("Line %d: invalid EAPOL "
-                                      "version (%d): '%s'.\n",
-                                      line, conf->eapol_version, pos);
-                               errors++;
-                       } else
-                               wpa_printf(MSG_DEBUG, "eapol_version=%d",
-                                          conf->eapol_version);
-#ifdef EAP_SERVER
-               } else if (strcmp(buf, "eap_authenticator") == 0) {
-                       conf->eap_server = atoi(pos);
-                       printf("Line %d: obsolete eap_authenticator used; "
-                              "this has been renamed to eap_server\n", line);
-               } else if (strcmp(buf, "eap_server") == 0) {
-                       conf->eap_server = atoi(pos);
-               } else if (strcmp(buf, "eap_user_file") == 0) {
-                       free(eap_user_file);
-                       eap_user_file = strdup(pos);
-                       if (!eap_user_file) {
-                               printf("Line %d: allocation failed\n", line);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "ca_cert") == 0) {
-                       free(conf->ca_cert);
-                       conf->ca_cert = strdup(pos);
-               } else if (strcmp(buf, "server_cert") == 0) {
-                       free(conf->server_cert);
-                       conf->server_cert = strdup(pos);
-               } else if (strcmp(buf, "private_key") == 0) {
-                       free(conf->private_key);
-                       conf->private_key = strdup(pos);
-               } else if (strcmp(buf, "private_key_passwd") == 0) {
-                       free(conf->private_key_passwd);
-                       conf->private_key_passwd = strdup(pos);
-               } else if (strcmp(buf, "check_crl") == 0) {
-                       conf->check_crl = atoi(pos);
-#ifdef EAP_SIM
-               } else if (strcmp(buf, "eap_sim_db") == 0) {
-                       free(conf->eap_sim_db);
-                       conf->eap_sim_db = strdup(pos);
-#endif /* EAP_SIM */
-#endif /* EAP_SERVER */
-               } else if (strcmp(buf, "eap_message") == 0) {
-                       char *term;
-                       conf->eap_req_id_text = strdup(pos);
-                       if (conf->eap_req_id_text == NULL) {
-                               printf("Line %d: Failed to allocate memory "
-                                      "for eap_req_id_text\n", line);
-                               errors++;
-                               continue;
-                       }
-                       conf->eap_req_id_text_len =
-                               strlen(conf->eap_req_id_text);
-                       term = strstr(conf->eap_req_id_text, "\\0");
-                       if (term) {
-                               *term++ = '\0';
-                               memmove(term, term + 1,
-                                       conf->eap_req_id_text_len -
-                                       (term - conf->eap_req_id_text) - 1);
-                               conf->eap_req_id_text_len--;
-                       }
-               } else if (strcmp(buf, "wep_key_len_broadcast") == 0) {
-                       conf->default_wep_key_len = atoi(pos);
-                       if (conf->default_wep_key_len > 13) {
-                               printf("Line %d: invalid WEP key len %lu "
-                                      "(= %lu bits)\n", line,
-                                      (unsigned long)
-                                      conf->default_wep_key_len,
-                                      (unsigned long)
-                                      conf->default_wep_key_len * 8);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "wep_key_len_unicast") == 0) {
-                       conf->individual_wep_key_len = atoi(pos);
-                       if (conf->individual_wep_key_len < 0 ||
-                           conf->individual_wep_key_len > 13) {
-                               printf("Line %d: invalid WEP key len %d "
-                                      "(= %d bits)\n", line,
-                                      conf->individual_wep_key_len,
-                                      conf->individual_wep_key_len * 8);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "wep_rekey_period") == 0) {
-                       conf->wep_rekeying_period = atoi(pos);
-                       if (conf->wep_rekeying_period < 0) {
-                               printf("Line %d: invalid period %d\n",
-                                      line, conf->wep_rekeying_period);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "eap_reauth_period") == 0) {
-                       conf->eap_reauth_period = atoi(pos);
-                       if (conf->eap_reauth_period < 0) {
-                               printf("Line %d: invalid period %d\n",
-                                      line, conf->eap_reauth_period);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "eapol_key_index_workaround") == 0) {
-                       conf->eapol_key_index_workaround = atoi(pos);
-#ifdef CONFIG_IAPP
-               } else if (strcmp(buf, "iapp_interface") == 0) {
-                       conf->ieee802_11f = 1;
-                       snprintf(conf->iapp_iface, sizeof(conf->iapp_iface),
-                                "%s", pos);
-#endif /* CONFIG_IAPP */
-               } else if (strcmp(buf, "own_ip_addr") == 0) {
-                       if (hostapd_parse_ip_addr(pos, &conf->own_ip_addr)) {
-                               printf("Line %d: invalid IP address '%s'\n",
-                                      line, pos);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "nas_identifier") == 0) {
-                       conf->nas_identifier = strdup(pos);
-               } else if (strcmp(buf, "auth_server_addr") == 0) {
-                       if (hostapd_config_read_radius_addr(
-                                   &conf->radius->auth_servers,
-                                   &conf->radius->num_auth_servers, pos, 1812,
-                                   &conf->radius->auth_server)) {
-                               printf("Line %d: invalid IP address '%s'\n",
-                                      line, pos);
-                               errors++;
-                       }
-               } else if (conf->radius->auth_server &&
-                          strcmp(buf, "auth_server_port") == 0) {
-                       conf->radius->auth_server->port = atoi(pos);
-               } else if (conf->radius->auth_server &&
-                          strcmp(buf, "auth_server_shared_secret") == 0) {
-                       int len = strlen(pos);
-                       if (len == 0) {
-                               /* RFC 2865, Ch. 3 */
-                               printf("Line %d: empty shared secret is not "
-                                      "allowed.\n", line);
-                               errors++;
-                       }
-                       conf->radius->auth_server->shared_secret =
-                               (u8 *) strdup(pos);
-                       conf->radius->auth_server->shared_secret_len = len;
-               } else if (strcmp(buf, "acct_server_addr") == 0) {
-                       if (hostapd_config_read_radius_addr(
-                                   &conf->radius->acct_servers,
-                                   &conf->radius->num_acct_servers, pos, 1813,
-                                   &conf->radius->acct_server)) {
-                               printf("Line %d: invalid IP address '%s'\n",
-                                      line, pos);
-                               errors++;
-                       }
-               } else if (conf->radius->acct_server &&
-                          strcmp(buf, "acct_server_port") == 0) {
-                       conf->radius->acct_server->port = atoi(pos);
-               } else if (conf->radius->acct_server &&
-                          strcmp(buf, "acct_server_shared_secret") == 0) {
-                       int len = strlen(pos);
-                       if (len == 0) {
-                               /* RFC 2865, Ch. 3 */
-                               printf("Line %d: empty shared secret is not "
-                                      "allowed.\n", line);
-                               errors++;
-                       }
-                       conf->radius->acct_server->shared_secret =
-                               (u8 *) strdup(pos);
-                       conf->radius->acct_server->shared_secret_len = len;
-               } else if (strcmp(buf, "radius_retry_primary_interval") == 0) {
-                       conf->radius->retry_primary_interval = atoi(pos);
-               } else if (strcmp(buf, "radius_acct_interim_interval") == 0) {
-                       conf->radius->acct_interim_interval = atoi(pos);
-               } else if (strcmp(buf, "auth_algs") == 0) {
-                       conf->auth_algs = atoi(pos);
-                       if (conf->auth_algs == 0) {
-                               printf("Line %d: no authentication algorithms "
-                                      "allowed\n",
-                                      line);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "wpa") == 0) {
-                       conf->wpa = atoi(pos);
-               } else if (strcmp(buf, "wpa_group_rekey") == 0) {
-                       conf->wpa_group_rekey = atoi(pos);
-               } else if (strcmp(buf, "wpa_strict_rekey") == 0) {
-                       conf->wpa_strict_rekey = atoi(pos);
-               } else if (strcmp(buf, "wpa_gmk_rekey") == 0) {
-                       conf->wpa_gmk_rekey = atoi(pos);
-               } else if (strcmp(buf, "wpa_passphrase") == 0) {
-                       int len = strlen(pos);
-                       if (len < 8 || len > 63) {
-                               printf("Line %d: invalid WPA passphrase length"
-                                      " %d (expected 8..63)\n", line, len);
-                               errors++;
-                       } else {
-                               free(conf->wpa_passphrase);
-                               conf->wpa_passphrase = strdup(pos);
-                       }
-               } else if (strcmp(buf, "wpa_psk") == 0) {
-                       free(conf->wpa_psk);
-                       conf->wpa_psk = malloc(sizeof(struct hostapd_wpa_psk));
-                       if (conf->wpa_psk) {
-                               memset(conf->wpa_psk, 0,
-                                      sizeof(struct hostapd_wpa_psk));
-                       }
-                       if (conf->wpa_psk == NULL)
-                               errors++;
-                       else if (hexstr2bin(pos, conf->wpa_psk->psk, PMK_LEN)
-                                || pos[PMK_LEN * 2] != '\0') {
-                               printf("Line %d: Invalid PSK '%s'.\n", line,
-                                      pos);
-                               errors++;
-                       } else {
-                               conf->wpa_psk->group = 1;
-                       }
-               } else if (strcmp(buf, "wpa_psk_file") == 0) {
-                       free(conf->wpa_psk_file);
-                       conf->wpa_psk_file = strdup(pos);
-                       if (!conf->wpa_psk_file) {
-                               printf("Line %d: allocation failed\n", line);
-                               errors++;
-                       }
-               } else if (strcmp(buf, "wpa_key_mgmt") == 0) {
-                       conf->wpa_key_mgmt =
-                               hostapd_config_parse_key_mgmt(line, pos);
-                       if (conf->wpa_key_mgmt == -1)
-                               errors++;
-               } else if (strcmp(buf, "wpa_pairwise") == 0) {
-                       conf->wpa_pairwise =
-                               hostapd_config_parse_cipher(line, pos);
-                       if (conf->wpa_pairwise == -1 ||
-                           conf->wpa_pairwise == 0)
-                               errors++;
-                       else if (conf->wpa_pairwise &
-                                (WPA_CIPHER_NONE | WPA_CIPHER_WEP40 |
-                                 WPA_CIPHER_WEP104)) {
-                               printf("Line %d: unsupported pairwise "
-                                      "cipher suite '%s'\n",
-                                      conf->wpa_pairwise, pos);
-                               errors++;
-                       } else {
-                               if (conf->wpa_pairwise & WPA_CIPHER_TKIP)
-                                       conf->wpa_group = WPA_CIPHER_TKIP;
-                               else
-                                       conf->wpa_group = WPA_CIPHER_CCMP;
-                       }
-#ifdef CONFIG_RSN_PREAUTH
-               } else if (strcmp(buf, "rsn_preauth") == 0) {
-                       conf->rsn_preauth = atoi(pos);
-               } else if (strcmp(buf, "rsn_preauth_interfaces") == 0) {
-                       conf->rsn_preauth_interfaces = strdup(pos);
-#endif /* CONFIG_RSN_PREAUTH */
-               } else if (strcmp(buf, "ctrl_interface") == 0) {
-                       free(conf->ctrl_interface);
-                       conf->ctrl_interface = strdup(pos);
-               } else if (strcmp(buf, "ctrl_interface_group") == 0) {
-                       struct group *grp;
-                       char *endp;
-                       const char *group = pos;
-
-                       grp = getgrnam(group);
-                       if (grp) {
-                               conf->ctrl_interface_gid = grp->gr_gid;
-                               conf->ctrl_interface_gid_set = 1;
-                               wpa_printf(MSG_DEBUG, "ctrl_interface_group=%d"
-                                          " (from group name '%s')",
-                                          conf->ctrl_interface_gid, group);
-                               continue;
-                       }
-
-                       /* Group name not found - try to parse this as gid */
-                       conf->ctrl_interface_gid = strtol(group, &endp, 10);
-                       if (*group == '\0' || *endp != '\0') {
-                               wpa_printf(MSG_DEBUG, "Line %d: Invalid group "
-                                          "'%s'", line, group);
-                               errors++;
-                               continue;
-                       }
-                       conf->ctrl_interface_gid_set = 1;
-                       wpa_printf(MSG_DEBUG, "ctrl_interface_group=%d",
-                                  conf->ctrl_interface_gid);
-#ifdef RADIUS_SERVER
-               } else if (strcmp(buf, "radius_server_clients") == 0) {
-                       free(conf->radius_server_clients);
-                       conf->radius_server_clients = strdup(pos);
-               } else if (strcmp(buf, "radius_server_auth_port") == 0) {
-                       conf->radius_server_auth_port = atoi(pos);
-               } else if (strcmp(buf, "radius_server_ipv6") == 0) {
-                       conf->radius_server_ipv6 = atoi(pos);
-#endif /* RADIUS_SERVER */
-               } else if (strcmp(buf, "test_socket") == 0) {
-                       free(conf->test_socket);
-                       conf->test_socket = strdup(pos);
-               } else if (strcmp(buf, "use_pae_group_addr") == 0) {
-                       conf->use_pae_group_addr = atoi(pos);
-               } else {
-                       printf("Line %d: unknown configuration item '%s'\n",
-                              line, buf);
-                       errors++;
-               }
-       }
-
-       fclose(f);
-
-       if (hostapd_config_read_maclist(accept_mac_file, &conf->accept_mac,
-                                       &conf->num_accept_mac))
-               errors++;
-       free(accept_mac_file);
-       if (hostapd_config_read_maclist(deny_mac_file, &conf->deny_mac,
-                                       &conf->num_deny_mac))
-               errors++;
-       free(deny_mac_file);
-
-#ifdef EAP_SERVER
-       if (hostapd_config_read_eap_user(eap_user_file, conf))
-               errors++;
-       free(eap_user_file);
-#endif /* EAP_SERVER */
-
-       conf->radius->auth_server = conf->radius->auth_servers;
-       conf->radius->acct_server = conf->radius->acct_servers;
-
-       if (hostapd_config_check(conf))
-               errors++;
-
-       if (errors) {
-               printf("%d errors found in configuration file '%s'\n",
-                      errors, fname);
-               hostapd_config_free(conf);
-               conf = NULL;
-       }
-
-       return conf;
-}
-
-
-static void hostapd_config_free_radius(struct hostapd_radius_server *servers,
-                                      int num_servers)
-{
-       int i;
-
-       for (i = 0; i < num_servers; i++) {
-               free(servers[i].shared_secret);
-       }
-       free(servers);
-}
-
-
-static void hostapd_config_free_eap_user(struct hostapd_eap_user *user)
-{
-       free(user->identity);
-       free(user->password);
-       free(user);
-}
-
-
-void hostapd_config_free(struct hostapd_config *conf)
-{
-       struct hostapd_wpa_psk *psk, *prev;
-       struct hostapd_eap_user *user, *prev_user;
-
-       if (conf == NULL)
-               return;
-
-       psk = conf->wpa_psk;
-       while (psk) {
-               prev = psk;
-               psk = psk->next;
-               free(prev);
-       }
-
-       free(conf->wpa_passphrase);
-       free(conf->wpa_psk_file);
-
-       user = conf->eap_user;
-       while (user) {
-               prev_user = user;
-               user = user->next;
-               hostapd_config_free_eap_user(prev_user);
-       }
-
-       free(conf->dump_log_name);
-       free(conf->eap_req_id_text);
-       free(conf->accept_mac);
-       free(conf->deny_mac);
-       free(conf->nas_identifier);
-       hostapd_config_free_radius(conf->radius->auth_servers,
-                                  conf->radius->num_auth_servers);
-       hostapd_config_free_radius(conf->radius->acct_servers,
-                                  conf->radius->num_acct_servers);
-       free(conf->rsn_preauth_interfaces);
-       free(conf->ctrl_interface);
-       free(conf->ca_cert);
-       free(conf->server_cert);
-       free(conf->private_key);
-       free(conf->private_key_passwd);
-       free(conf->eap_sim_db);
-       free(conf->radius_server_clients);
-       free(conf->test_socket);
-       free(conf);
-}
-
-
-/* Perform a binary search for given MAC address from a pre-sorted list.
- * Returns 1 if address is in the list or 0 if not. */
-int hostapd_maclist_found(macaddr *list, int num_entries, u8 *addr)
-{
-       int start, end, middle, res;
-
-       start = 0;
-       end = num_entries - 1;
-
-       while (start <= end) {
-               middle = (start + end) / 2;
-               res = memcmp(list[middle], addr, ETH_ALEN);
-               if (res == 0)
-                       return 1;
-               if (res < 0)
-                       start = middle + 1;
-               else
-                       end = middle - 1;
-       }
-
-       return 0;
-}
-
-
-const u8 * hostapd_get_psk(const struct hostapd_config *conf, const u8 *addr,
-                          const u8 *prev_psk)
-{
-       struct hostapd_wpa_psk *psk;
-       int next_ok = prev_psk == NULL;
-
-       for (psk = conf->wpa_psk; psk != NULL; psk = psk->next) {
-               if (next_ok &&
-                   (psk->group || memcmp(psk->addr, addr, ETH_ALEN) == 0))
-                       return psk->psk;
-
-               if (psk->psk == prev_psk)
-                       next_ok = 1;
-       }
-
-       return NULL;
-}
-
-
-const struct hostapd_eap_user *
-hostapd_get_eap_user(const struct hostapd_config *conf, const u8 *identity,
-                    size_t identity_len, int phase2)
-{
-       struct hostapd_eap_user *user = conf->eap_user;
-
-       while (user) {
-               if (!phase2 && user->identity == NULL) {
-                       /* Wildcard match */
-                       break;
-               }
-               if (user->phase2 == !!phase2 &&
-                   user->identity_len == identity_len &&
-                   memcmp(user->identity, identity, identity_len) == 0)
-                       break;
-               user = user->next;
-       }
-
-       return user;
-}
diff --git a/contrib/hostapd-0.4.9/config.h b/contrib/hostapd-0.4.9/config.h
deleted file mode 100644 (file)
index df411a5..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include "config_types.h"
-
-typedef u8 macaddr[ETH_ALEN];
-
-struct hostapd_radius_servers;
-
-#define PMK_LEN 32
-struct hostapd_wpa_psk {
-       struct hostapd_wpa_psk *next;
-       int group;
-       u8 psk[PMK_LEN];
-       u8 addr[ETH_ALEN];
-};
-
-#define EAP_USER_MAX_METHODS 8
-struct hostapd_eap_user {
-       struct hostapd_eap_user *next;
-       u8 *identity;
-       size_t identity_len;
-       u8 methods[EAP_USER_MAX_METHODS];
-       u8 *password;
-       size_t password_len;
-       int phase2;
-       int force_version;
-};
-
-struct hostapd_config {
-       char iface[IFNAMSIZ + 1];
-       char bridge[IFNAMSIZ + 1];
-
-       const struct driver_ops *driver;
-
-       enum {
-               HOSTAPD_LEVEL_DEBUG_VERBOSE = 0,
-               HOSTAPD_LEVEL_DEBUG = 1,
-               HOSTAPD_LEVEL_INFO = 2,
-               HOSTAPD_LEVEL_NOTICE = 3,
-               HOSTAPD_LEVEL_WARNING = 4
-       } logger_syslog_level, logger_stdout_level;
-
-#define HOSTAPD_MODULE_IEEE80211 BIT(0)
-#define HOSTAPD_MODULE_IEEE8021X BIT(1)
-#define HOSTAPD_MODULE_RADIUS BIT(2)
-#define HOSTAPD_MODULE_WPA BIT(3)
-#define HOSTAPD_MODULE_DRIVER BIT(4)
-#define HOSTAPD_MODULE_IAPP BIT(5)
-       unsigned int logger_syslog; /* module bitfield */
-       unsigned int logger_stdout; /* module bitfield */
-
-       enum { HOSTAPD_DEBUG_NO = 0, HOSTAPD_DEBUG_MINIMAL = 1,
-              HOSTAPD_DEBUG_VERBOSE = 2,
-              HOSTAPD_DEBUG_MSGDUMPS = 3,
-              HOSTAPD_DEBUG_EXCESSIVE = 4 } debug; /* debug verbosity level */
-       char *dump_log_name; /* file name for state dump (SIGUSR1) */
-
-       int ieee802_1x; /* use IEEE 802.1X */
-       int eapol_version;
-       int eap_server; /* Use internal EAP server instead of external
-                        * RADIUS server */
-       struct hostapd_eap_user *eap_user;
-       char *eap_sim_db;
-       struct hostapd_ip_addr own_ip_addr;
-       char *nas_identifier;
-       struct hostapd_radius_servers *radius;
-
-#define HOSTAPD_SSID_LEN 32
-       char ssid[HOSTAPD_SSID_LEN + 1];
-       size_t ssid_len;
-       int ssid_set;
-       char *eap_req_id_text; /* optional displayable message sent with
-                               * EAP Request-Identity */
-       size_t eap_req_id_text_len;
-       int eapol_key_index_workaround;
-
-       size_t default_wep_key_len;
-       int individual_wep_key_len;
-       int wep_rekeying_period;
-       int eap_reauth_period;
-
-       int ieee802_11f; /* use IEEE 802.11f (IAPP) */
-       char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
-                                       * frames */
-
-       u8 assoc_ap_addr[ETH_ALEN];
-       int assoc_ap; /* whether assoc_ap_addr is set */
-
-       enum {
-               ACCEPT_UNLESS_DENIED = 0,
-               DENY_UNLESS_ACCEPTED = 1,
-               USE_EXTERNAL_RADIUS_AUTH = 2
-       } macaddr_acl;
-       macaddr *accept_mac;
-       int num_accept_mac;
-       macaddr *deny_mac;
-       int num_deny_mac;
-
-#define HOSTAPD_AUTH_OPEN BIT(0)
-#define HOSTAPD_AUTH_SHARED_KEY BIT(1)
-       int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
-                       * algorithms */
-
-#define HOSTAPD_WPA_VERSION_WPA BIT(0)
-#define HOSTAPD_WPA_VERSION_WPA2 BIT(1)
-       int wpa;
-       struct hostapd_wpa_psk *wpa_psk;
-       char *wpa_passphrase;
-       char *wpa_psk_file;
-#define WPA_KEY_MGMT_IEEE8021X BIT(0)
-#define WPA_KEY_MGMT_PSK BIT(1)
-       int wpa_key_mgmt;
-#define WPA_CIPHER_NONE BIT(0)
-#define WPA_CIPHER_WEP40 BIT(1)
-#define WPA_CIPHER_WEP104 BIT(2)
-#define WPA_CIPHER_TKIP BIT(3)
-#define WPA_CIPHER_CCMP BIT(4)
-       int wpa_pairwise;
-       int wpa_group;
-       int wpa_group_rekey;
-       int wpa_strict_rekey;
-       int wpa_gmk_rekey;
-       int rsn_preauth;
-       char *rsn_preauth_interfaces;
-
-       char *ctrl_interface; /* directory for UNIX domain sockets */
-       gid_t ctrl_interface_gid;
-       int ctrl_interface_gid_set;
-
-       char *ca_cert;
-       char *server_cert;
-       char *private_key;
-       char *private_key_passwd;
-       int check_crl;
-
-       char *radius_server_clients;
-       int radius_server_auth_port;
-       int radius_server_ipv6;
-
-       char *test_socket; /* UNIX domain socket path for driver_test */
-
-       int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
-                                * address instead of individual address
-                                * (for driver_wired.c).
-                                */
-};
-
-
-struct hostapd_config * hostapd_config_read(const char *fname);
-void hostapd_config_free(struct hostapd_config *conf);
-int hostapd_maclist_found(macaddr *list, int num_entries, u8 *addr);
-const u8 * hostapd_get_psk(const struct hostapd_config *conf, const u8 *addr,
-                          const u8 *prev_psk);
-int hostapd_setup_wpa_psk(struct hostapd_config *conf);
-const struct hostapd_eap_user *
-hostapd_get_eap_user(const struct hostapd_config *conf, const u8 *identity,
-                    size_t identity_len, int phase2);
-
-#endif /* CONFIG_H */
diff --git a/contrib/hostapd-0.4.9/config_types.h b/contrib/hostapd-0.4.9/config_types.h
deleted file mode 100644 (file)
index 12b57cb..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef CONFIG_TYPES_H
-#define CONFIG_TYPES_H
-
-struct hostapd_ip_addr {
-       union {
-               struct in_addr v4;
-#ifdef CONFIG_IPV6
-               struct in6_addr v6;
-#endif /* CONFIG_IPV6 */
-       } u;
-       int af; /* AF_INET / AF_INET6 */
-};
-
-#endif /* CONFIG_TYPES_H */
diff --git a/contrib/hostapd-0.4.9/crypto.c b/contrib/hostapd-0.4.9/crypto.c
deleted file mode 100644 (file)
index 1b13671..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * WPA Supplicant / wrapper functions for libcrypto
- * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include <openssl/opensslv.h>
-#include <openssl/md4.h>
-#include <openssl/md5.h>
-#include <openssl/sha.h>
-#include <openssl/des.h>
-#include <openssl/aes.h>
-
-#include "common.h"
-#include "crypto.h"
-
-#if OPENSSL_VERSION_NUMBER < 0x00907000
-#define DES_key_schedule des_key_schedule
-#define DES_cblock des_cblock
-#define DES_set_key(key, schedule) des_set_key((key), *(schedule))
-#define DES_ecb_encrypt(input, output, ks, enc) \
-       des_ecb_encrypt((input), (output), *(ks), (enc))
-#endif /* openssl < 0.9.7 */
-
-
-void md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
-{
-       MD4_CTX ctx;
-       int i;
-
-       MD4_Init(&ctx);
-       for (i = 0; i < num_elem; i++)
-               MD4_Update(&ctx, addr[i], len[i]);
-       MD4_Final(mac, &ctx);
-}
-
-
-void des_encrypt(const u8 *clear, const u8 *key, u8 *cypher)
-{
-       u8 pkey[8], next, tmp;
-       int i;
-       DES_key_schedule ks;
-
-       /* Add parity bits to the key */
-       next = 0;
-       for (i = 0; i < 7; i++) {
-               tmp = key[i];
-               pkey[i] = (tmp >> i) | next | 1;
-               next = tmp << (7 - i);
-       }
-       pkey[i] = next | 1;
-
-       DES_set_key(&pkey, &ks);
-       DES_ecb_encrypt((DES_cblock *) clear, (DES_cblock *) cypher, &ks,
-                       DES_ENCRYPT);
-}
-
-
-#ifdef EAP_TLS_FUNCS
-void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
-{
-       MD5_CTX ctx;
-       int i;
-
-       MD5_Init(&ctx);
-       for (i = 0; i < num_elem; i++)
-               MD5_Update(&ctx, addr[i], len[i]);
-       MD5_Final(mac, &ctx);
-}
-
-
-void sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
-{
-       SHA_CTX ctx;
-       int i;
-
-       SHA1_Init(&ctx);
-       for (i = 0; i < num_elem; i++)
-               SHA1_Update(&ctx, addr[i], len[i]);
-       SHA1_Final(mac, &ctx);
-}
-
-
-void sha1_transform(u8 *state, const u8 data[64])
-{
-       SHA_CTX context;
-       memset(&context, 0, sizeof(context));
-       memcpy(&context.h0, state, 5 * 4);
-       SHA1_Transform(&context, data);
-       memcpy(state, &context.h0, 5 * 4);
-}
-
-
-void * aes_encrypt_init(const u8 *key, size_t len)
-{
-       AES_KEY *ak;
-       ak = malloc(sizeof(*ak));
-       if (ak == NULL)
-               return NULL;
-       if (AES_set_encrypt_key(key, 8 * len, ak) < 0) {
-               free(ak);
-               return NULL;
-       }
-       return ak;
-}
-
-
-void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt)
-{
-       AES_encrypt(plain, crypt, ctx);
-}
-
-
-void aes_encrypt_deinit(void *ctx)
-{
-       free(ctx);
-}
-
-
-void * aes_decrypt_init(const u8 *key, size_t len)
-{
-       AES_KEY *ak;
-       ak = malloc(sizeof(*ak));
-       if (ak == NULL)
-               return NULL;
-       if (AES_set_decrypt_key(key, 8 * len, ak) < 0) {
-               free(ak);
-               return NULL;
-       }
-       return ak;
-}
-
-
-void aes_decrypt(void *ctx, const u8 *crypt, u8 *plain)
-{
-       AES_decrypt(crypt, plain, ctx);
-}
-
-
-void aes_decrypt_deinit(void *ctx)
-{
-       free(ctx);
-}
-#endif /* EAP_TLS_FUNCS */
diff --git a/contrib/hostapd-0.4.9/crypto.h b/contrib/hostapd-0.4.9/crypto.h
deleted file mode 100644 (file)
index e664861..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * WPA Supplicant / wrapper functions for crypto libraries
- * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- *
- * This file defines the cryptographic functions that need to be implemented
- * for wpa_supplicant and hostapd. When TLS is not used, internal
- * implementation of MD5, SHA1, and AES is used and no external libraries are
- * required. When TLS is enabled (e.g., by enabling EAP-TLS or EAP-PEAP), the
- * crypto library used by the TLS implementation is expected to be used for
- * non-TLS needs, too, in order to save space by not implementing these
- * functions twice.
- *
- * Wrapper code for using each crypto library is in its own file (crypto*.c)
- * and one of these files is build and linked in to provide the functions
- * defined here.
- */
-
-#ifndef CRYPTO_H
-#define CRYPTO_H
-
-/**
- * md4_vector - MD4 hash for data vector
- * @num_elem: Number of elements in the data vector
- * @addr: Pointers to the data areas
- * @len: Lengths of the data blocks
- * @mac: Buffer for the hash
- */
-void md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac);
-
-/**
- * md5_vector - MD5 hash for data vector
- * @num_elem: Number of elements in the data vector
- * @addr: Pointers to the data areas
- * @len: Lengths of the data blocks
- * @mac: Buffer for the hash
- */
-void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac);
-
-/**
- * sha1_vector - SHA-1 hash for data vector
- * @num_elem: Number of elements in the data vector
- * @addr: Pointers to the data areas
- * @len: Lengths of the data blocks
- * @mac: Buffer for the hash
- */
-void sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len,
-                u8 *mac);
-
-/**
- * sha1_transform - Perform one SHA-1 transform step
- * @state: SHA-1 state
- * @data: Input data for the SHA-1 transform
- *
- * This function is used to implement random number generation specified in
- * NIST FIPS Publication 186-2 for EAP-SIM. This PRF uses a function that is
- * similar to SHA-1, but has different message padding and as such, access to
- * just part of the SHA-1 is needed.
- */
-void sha1_transform(u8 *state, const u8 data[64]);
-
-/**
- * des_encrypt - Encrypt one block with DES
- * @clear: 8 octets (in)
- * @key: 7 octets (in) (no parity bits included)
- * @cypher: 8 octets (out)
- */
-void des_encrypt(const u8 *clear, const u8 *key, u8 *cypher);
-
-/**
- * aes_encrypt_init - Initialize AES for encryption
- * @key: Encryption key
- * @len: Key length in bytes (usually 16, i.e., 128 bits)
- * Returns: Pointer to context data or %NULL on failure
- */
-void * aes_encrypt_init(const u8 *key, size_t len);
-
-/**
- * aes_encrypt - Encrypt one AES block
- * @ctx: Context pointer from aes_encrypt_init()
- * @plain: Plaintext data to be encrypted (16 bytes)
- * @crypt: Buffer for the encrypted data (16 bytes)
- */
-void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt);
-
-/**
- * aes_encrypt_deinit - Deinitialize AES encryption
- * @ctx: Context pointer from aes_encrypt_init()
- */
-void aes_encrypt_deinit(void *ctx);
-
-/**
- * aes_decrypt_init - Initialize AES for decryption
- * @key: Decryption key
- * @len: Key length in bytes (usually 16, i.e., 128 bits)
- * Returns: Pointer to context data or %NULL on failure
- */
-void * aes_decrypt_init(const u8 *key, size_t len);
-
-/**
- * aes_decrypt - Decrypt one AES block
- * @ctx: Context pointer from aes_encrypt_init()
- * @crypt: Encrypted data (16 bytes)
- * @plain: Buffer for the decrypted data (16 bytes)
- */
-void aes_decrypt(void *ctx, const u8 *crypt, u8 *plain);
-
-/**
- * aes_decrypt_deinit - Deinitialize AES decryption
- * @ctx: Context pointer from aes_encrypt_init()
- */
-void aes_decrypt_deinit(void *ctx);
-
-
-#endif /* CRYPTO_H */
diff --git a/contrib/hostapd-0.4.9/ctrl_iface.c b/contrib/hostapd-0.4.9/ctrl_iface.c
deleted file mode 100644 (file)
index ff730d4..0000000
+++ /dev/null
@@ -1,456 +0,0 @@
-/*
- * Host AP (software wireless LAN access point) user space daemon for
- * Host AP kernel driver / UNIX domain socket -based control interface
- * Copyright (c) 2004, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <netinet/in.h>
-
-#include "hostapd.h"
-#include "eloop.h"
-#include "config.h"
-#include "eapol_sm.h"
-#include "ieee802_1x.h"
-#include "wpa.h"
-#include "radius_client.h"
-#include "ieee802_11.h"
-#include "ctrl_iface.h"
-#include "sta_info.h"
-
-
-struct wpa_ctrl_dst {
-       struct wpa_ctrl_dst *next;
-       struct sockaddr_un addr;
-       socklen_t addrlen;
-       int debug_level;
-       int errors;
-};
-
-
-static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
-                                    struct sockaddr_un *from,
-                                    socklen_t fromlen)
-{
-       struct wpa_ctrl_dst *dst;
-
-       dst = malloc(sizeof(*dst));
-       if (dst == NULL)
-               return -1;
-       memset(dst, 0, sizeof(*dst));
-       memcpy(&dst->addr, from, sizeof(struct sockaddr_un));
-       dst->addrlen = fromlen;
-       dst->debug_level = MSG_INFO;
-       dst->next = hapd->ctrl_dst;
-       hapd->ctrl_dst = dst;
-       wpa_hexdump(MSG_DEBUG, "CTRL_IFACE monitor attached",
-                   (u8 *) from->sun_path, fromlen);
-       return 0;
-}
-
-
-static int hostapd_ctrl_iface_detach(struct hostapd_data *hapd,
-                                    struct sockaddr_un *from,
-                                    socklen_t fromlen)
-{
-       struct wpa_ctrl_dst *dst, *prev = NULL;
-
-       dst = hapd->ctrl_dst;
-       while (dst) {
-               if (fromlen == dst->addrlen &&
-                   memcmp(from->sun_path, dst->addr.sun_path, fromlen) == 0) {
-                       if (prev == NULL)
-                               hapd->ctrl_dst = dst->next;
-                       else
-                               prev->next = dst->next;
-                       free(dst);
-                       wpa_hexdump(MSG_DEBUG, "CTRL_IFACE monitor detached",
-                                   (u8 *) from->sun_path, fromlen);
-                       return 0;
-               }
-               prev = dst;
-               dst = dst->next;
-       }
-       return -1;
-}
-
-
-static int hostapd_ctrl_iface_level(struct hostapd_data *hapd,
-                                   struct sockaddr_un *from,
-                                   socklen_t fromlen,
-                                   char *level)
-{
-       struct wpa_ctrl_dst *dst;
-
-       wpa_printf(MSG_DEBUG, "CTRL_IFACE LEVEL %s", level);
-
-       dst = hapd->ctrl_dst;
-       while (dst) {
-               if (fromlen == dst->addrlen &&
-                   memcmp(from->sun_path, dst->addr.sun_path, fromlen) == 0) {
-                       wpa_hexdump(MSG_DEBUG, "CTRL_IFACE changed monitor "
-                                   "level", (u8 *) from->sun_path, fromlen);
-                       dst->debug_level = atoi(level);
-                       return 0;
-               }
-               dst = dst->next;
-       }
-
-       return -1;
-}
-
-
-static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
-                                     struct sta_info *sta,
-                                     char *buf, size_t buflen)
-{
-       int len, res;
-
-       if (sta == NULL) {
-               return snprintf(buf, buflen, "FAIL\n");
-       }
-
-       len = 0;
-       len += snprintf(buf + len, buflen - len, MACSTR "\n",
-                       MAC2STR(sta->addr));
-
-       res = ieee802_11_get_mib_sta(hapd, sta, buf + len, buflen - len);
-       if (res >= 0)
-               len += res;
-       res = wpa_get_mib_sta(hapd, sta, buf + len, buflen - len);
-       if (res >= 0)
-               len += res;
-       res = ieee802_1x_get_mib_sta(hapd, sta, buf + len, buflen - len);
-       if (res >= 0)
-               len += res;
-
-       return len;
-}
-
-
-static int hostapd_ctrl_iface_sta_first(struct hostapd_data *hapd,
-                                       char *buf, size_t buflen)
-{
-       return hostapd_ctrl_iface_sta_mib(hapd, hapd->sta_list, buf, buflen);
-}
-
-
-static int hostapd_ctrl_iface_sta(struct hostapd_data *hapd,
-                                 const char *txtaddr,
-                                 char *buf, size_t buflen)
-{
-       u8 addr[ETH_ALEN];
-
-       if (hwaddr_aton(txtaddr, addr))
-               return snprintf(buf, buflen, "FAIL\n");
-       return hostapd_ctrl_iface_sta_mib(hapd, ap_get_sta(hapd, addr),
-                                         buf, buflen);
-}
-
-
-static int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd,
-                                      const char *txtaddr,
-                                      char *buf, size_t buflen)
-{
-       u8 addr[ETH_ALEN];
-       struct sta_info *sta;
-
-       if (hwaddr_aton(txtaddr, addr) ||
-           (sta = ap_get_sta(hapd, addr)) == NULL)
-               return snprintf(buf, buflen, "FAIL\n");
-       return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
-}
-
-
-static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
-                                      void *sock_ctx)
-{
-       struct hostapd_data *hapd = eloop_ctx;
-       char buf[256];
-       int res;
-       struct sockaddr_un from;
-       socklen_t fromlen = sizeof(from);
-       char *reply;
-       const int reply_size = 4096;
-       int reply_len;
-
-       res = recvfrom(sock, buf, sizeof(buf) - 1, 0,
-                      (struct sockaddr *) &from, &fromlen);
-       if (res < 0) {
-               perror("recvfrom(ctrl_iface)");
-               return;
-       }
-       buf[res] = '\0';
-       wpa_hexdump_ascii(MSG_DEBUG, "RX ctrl_iface", (u8 *) buf, res);
-
-       reply = malloc(reply_size);
-       if (reply == NULL) {
-               sendto(sock, "FAIL\n", 5, 0, (struct sockaddr *) &from,
-                      fromlen);
-               return;
-       }
-
-       memcpy(reply, "OK\n", 3);
-       reply_len = 3;
-
-       if (strcmp(buf, "PING") == 0) {
-               memcpy(reply, "PONG\n", 5);
-               reply_len = 5;
-       } else if (strcmp(buf, "MIB") == 0) {
-               reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
-               if (reply_len >= 0) {
-                       res = wpa_get_mib(hapd, reply + reply_len,
-                                         reply_size - reply_len);
-                       if (res < 0)
-                               reply_len = -1;
-                       else
-                               reply_len += res;
-               }
-               if (reply_len >= 0) {
-                       res = ieee802_1x_get_mib(hapd, reply + reply_len,
-                                                reply_size - reply_len);
-                       if (res < 0)
-                               reply_len = -1;
-                       else
-                               reply_len += res;
-               }
-               if (reply_len >= 0) {
-                       res = radius_client_get_mib(hapd->radius,
-                                                   reply + reply_len,
-                                                   reply_size - reply_len);
-                       if (res < 0)
-                               reply_len = -1;
-                       else
-                               reply_len += res;
-               }
-       } else if (strcmp(buf, "STA-FIRST") == 0) {
-               reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
-                                                        reply_size);
-       } else if (strncmp(buf, "STA ", 4) == 0) {
-               reply_len = hostapd_ctrl_iface_sta(hapd, buf + 4, reply,
-                                                  reply_size);
-       } else if (strncmp(buf, "STA-NEXT ", 9) ==