├── examples ├── __init__.py ├── tkip_ap.py └── wep_open_64.py ├── roguehostapd ├── __init__.py ├── config │ ├── __init__.py │ └── config.ini ├── buildutil │ ├── __init__.py │ └── buildexception.py └── hostapd-2_6 │ ├── src │ ├── tls │ │ ├── .gitignore │ │ ├── pkcs5.h │ │ ├── pkcs8.h │ │ ├── Makefile │ │ ├── rsa.h │ │ ├── pkcs1.h │ │ ├── bignum.h │ │ └── tlsv1_cred.h │ ├── crypto │ │ ├── .gitignore │ │ ├── crypto_none.c │ │ ├── tls_openssl.h │ │ ├── md5.h │ │ ├── aes_siv.h │ │ ├── md5_i.h │ │ ├── aes.h │ │ ├── dh_group5.h │ │ ├── sha384_i.h │ │ ├── sha1_i.h │ │ ├── sha256_i.h │ │ ├── sha512_i.h │ │ ├── des_i.h │ │ ├── dh_groups.h │ │ ├── aes-encblock.c │ │ ├── sha384.h │ │ ├── random.h │ │ ├── dh_group5.c │ │ ├── milenage.h │ │ ├── sha1.h │ │ ├── sha256.h │ │ ├── rc4.c │ │ ├── aes-ctr.c │ │ ├── Makefile │ │ ├── crypto_internal-modexp.c │ │ ├── fips_prf_internal.c │ │ ├── sha1-prf.c │ │ ├── aes-wrap.c │ │ ├── sha256-tlsprf.c │ │ ├── sha1-tprf.c │ │ ├── aes-unwrap.c │ │ └── sha256-kdf.c │ ├── radius │ │ ├── .gitignore │ │ ├── Makefile │ │ └── radius_das.h │ ├── utils │ │ ├── .gitignore │ │ ├── uuid.h │ │ ├── base64.h │ │ ├── module_tests.h │ │ ├── browser.h │ │ ├── platform.h │ │ ├── bitfield.h │ │ ├── edit.h │ │ ├── ip_addr.h │ │ ├── Makefile │ │ ├── ext_password_i.h │ │ ├── ext_password.h │ │ ├── ip_addr.c │ │ ├── includes.h │ │ ├── uuid.c │ │ ├── pcsc_funcs.h │ │ ├── build_config.h │ │ ├── bitfield.c │ │ ├── http-utils.h │ │ ├── ext_password_test.c │ │ └── trace.h │ ├── drivers │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── rfkill.h │ │ ├── netlink.h │ │ ├── linux_ioctl.h │ │ ├── linux_wext.h │ │ ├── linux_defines.h │ │ ├── drivers.c │ │ ├── driver_ndis.h │ │ └── driver_none.c │ ├── fst │ │ ├── Makefile │ │ ├── fst_ctrl_iface.h │ │ ├── fst_internal.h │ │ ├── fst_iface.c │ │ └── fst_group.h │ ├── pae │ │ ├── Makefile │ │ ├── ieee802_1x_key.h │ │ └── ieee802_1x_cp.h │ ├── l2_packet │ │ └── Makefile │ ├── eapol_auth │ │ └── Makefile │ ├── lib.rules │ ├── eapol_supp │ │ └── Makefile │ ├── common │ │ ├── version.h │ │ ├── Makefile │ │ ├── linux_bridge.h │ │ ├── qca-vendor-attr.h │ │ ├── ctrl_iface_common.h │ │ ├── linux_vlan.h │ │ ├── wpa_helpers.h │ │ ├── gas.h │ │ ├── cli.h │ │ ├── hw_features_common.h │ │ └── ieee802_1x_defs.h │ ├── ap │ │ ├── authsrv.h │ │ ├── bss_load.h │ │ ├── wpa_auth_glue.h │ │ ├── tkip_countermeasures.h │ │ ├── karma_handlers.h │ │ ├── dhcp_snoop.h │ │ ├── hs20.h │ │ ├── wmm.h │ │ ├── acs.h │ │ ├── vlan.h │ │ ├── taxonomy.h │ │ ├── vlan.c │ │ ├── neighbor_db.h │ │ ├── iapp.h │ │ ├── ndisc_snoop.h │ │ ├── wnm_ap.h │ │ ├── p2p_hostapd.h │ │ ├── rrm.h │ │ ├── vlan_util.h │ │ ├── ap_mlme.h │ │ ├── ieee802_11_auth.h │ │ ├── dfs.h │ │ ├── vlan_init.h │ │ ├── accounting.h │ │ ├── Makefile │ │ ├── beacon.h │ │ ├── mbo_ap.h │ │ ├── preauth_auth.h │ │ ├── ctrl_iface_ap.h │ │ ├── wpa_auth_ie.h │ │ ├── x_snoop.h │ │ ├── ap_list.h │ │ ├── vlan_ifconfig.c │ │ └── bss_load.c │ ├── eap_server │ │ ├── Makefile │ │ ├── tncs.h │ │ ├── ikev2.h │ │ └── eap_methods.h │ ├── Makefile │ ├── eap_common │ │ ├── chap.h │ │ ├── eap_peap_common.h │ │ ├── Makefile │ │ ├── chap.c │ │ ├── eap_wsc_common.h │ │ ├── eap_wsc_common.c │ │ ├── eap_ikev2_common.h │ │ ├── eap_common.h │ │ ├── eap_psk_common.c │ │ ├── eap_ttls.h │ │ ├── eap_psk_common.h │ │ └── eap_peap_common.c │ ├── eap_peer │ │ ├── Makefile │ │ ├── mschapv2.h │ │ ├── tncc.h │ │ ├── eap_proxy.h │ │ ├── ikev2.h │ │ ├── eap_fast_pac.h │ │ └── eap_proxy_dummy.c │ ├── p2p │ │ └── Makefile │ ├── rsn_supp │ │ ├── Makefile │ │ └── wpa_ie.h │ └── wps │ │ ├── http.h │ │ ├── Makefile │ │ ├── upnp_xml.h │ │ ├── http_server.h │ │ ├── http_client.h │ │ ├── wps_upnp.h │ │ └── wps_dev_attr.h │ ├── hostapd │ ├── hostapd.deny │ ├── hostapd.radius_clients │ ├── hostapd.accept │ ├── hostapd.vlan │ ├── eap_register.h │ ├── logwatch │ │ ├── hostapd.conf │ │ ├── README │ │ └── hostapd │ ├── hostapd.sim_db │ ├── hapd_module_tests.c │ ├── config_file.h │ ├── hostapd.wpa_psk │ ├── hostapd.android.rc │ ├── hostapd.eap_user_sqlite │ ├── hlr_auc_gw.milenage_db │ ├── nt_password_hash.c │ ├── ctrl_iface.h │ ├── wired.conf │ └── hostapd.8 │ └── COPYING ├── setup.cfg ├── MANIFEST.in ├── .travis.yml ├── LICENSE.txt └── setup.py /examples/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /roguehostapd/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /roguehostapd/config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /roguehostapd/buildutil/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/tls/.gitignore: -------------------------------------------------------------------------------- 1 | libtls.a 2 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.md 3 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/.gitignore: -------------------------------------------------------------------------------- 1 | libcrypto.a 2 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/radius/.gitignore: -------------------------------------------------------------------------------- 1 | libradius.a 2 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/.gitignore: -------------------------------------------------------------------------------- 1 | libutils.a 2 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE.txt README.md 2 | recursive-include roguehostapd/ * 3 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/.gitignore: -------------------------------------------------------------------------------- 1 | build.wpa_supplicant 2 | build.hostapd 3 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/fst/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @echo Nothing to be made. 3 | 4 | clean: 5 | rm -f *~ *.o *.d 6 | 7 | install: 8 | @echo Nothing to be made. 9 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/pae/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @echo Nothing to be made. 3 | 4 | clean: 5 | rm -f *~ *.o *.d 6 | 7 | install: 8 | @echo Nothing to be made. 9 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.deny: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are not allowed to authenticate (IEEE 802.11) 2 | # with the AP. 3 | 00:20:30:40:50:60 4 | 00:ab:cd:ef:12:34 5 | 00:00:30:40:50:60 6 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.radius_clients: -------------------------------------------------------------------------------- 1 | # RADIUS client configuration for the RADIUS server 2 | 10.1.2.3 secret passphrase 3 | 192.168.1.0/24 another very secret passphrase 4 | 0.0.0.0/0 radius 5 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @echo Nothing to be made. 3 | 4 | clean: 5 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov 6 | rm -f build.wpa_supplicant build.hostapd 7 | 8 | install: 9 | @echo Nothing to be made. 10 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.accept: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are allowed to authenticate (IEEE 802.11) 2 | # with the AP. Optional VLAN ID can be assigned for clients based on the 3 | # MAC address if dynamic VLANs (hostapd.conf dynamic_vlan option) are used. 4 | 00:11:22:33:44:55 5 | 00:66:77:88:99:aa 6 | 00:00:22:33:44:55 1 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - 2.7 4 | - 3.8 5 | addons: 6 | apt: 7 | update: true 8 | packages: 9 | - libnl-3-dev 10 | - libnl-genl-3-dev 11 | install: pip install flake8 12 | before_script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics 13 | script: python setup.py install 14 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.vlan: -------------------------------------------------------------------------------- 1 | # VLAN ID to network interface mapping 2 | 1 vlan1 3 | 2 vlan2 4 | 3 vlan3 5 | 100 guest 6 | # Optional wildcard entry matching all VLAN IDs. The first # in the interface 7 | # name will be replaced with the VLAN ID. The network interfaces are created 8 | # (and removed) dynamically based on the use. 9 | * vlan# 10 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/l2_packet/Makefile: -------------------------------------------------------------------------------- 1 | all: libl2_packet.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libl2_packet.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | LIB_OBJS = l2_packet_linux.o 12 | 13 | libl2_packet.a: $(LIB_OBJS) 14 | $(AR) crT $@ $? 15 | 16 | -include $(OBJS:%.o=%.d) 17 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eapol_auth/Makefile: -------------------------------------------------------------------------------- 1 | all: libeapol_auth.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libeapol_auth.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | LIB_OBJS = eapol_auth_sm.o eapol_auth_dump.o 12 | 13 | libeapol_auth.a: $(LIB_OBJS) 14 | $(AR) crT $@ $? 15 | 16 | -include $(OBJS:%.o=%.d) 17 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/lib.rules: -------------------------------------------------------------------------------- 1 | ifndef CC 2 | CC=gcc 3 | endif 4 | 5 | ifndef CFLAGS 6 | CFLAGS = -MMD -O2 -Wall -g 7 | endif 8 | 9 | CFLAGS += -I.. -I../utils 10 | 11 | 12 | Q=@ 13 | E=echo 14 | ifeq ($(V), 1) 15 | Q= 16 | E=true 17 | endif 18 | ifeq ($(QUIET), 1) 19 | Q=@ 20 | E=true 21 | endif 22 | 23 | %.o: %.c 24 | $(Q)$(CC) -c -o $@ $(CFLAGS) $< 25 | @$(E) " CC " $< 26 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eapol_supp/Makefile: -------------------------------------------------------------------------------- 1 | all: libeapol_supp.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libeapol_supp.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | CFLAGS += -DIEEE8021X_EAPOL 12 | 13 | LIB_OBJS = eapol_supp_sm.o 14 | 15 | libeapol_supp.a: $(LIB_OBJS) 16 | $(AR) crT $@ $? 17 | 18 | -include $(OBJS:%.o=%.d) 19 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/eap_register.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP method registration 3 | * Copyright (c) 2004-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_REGISTER_H 10 | #define EAP_REGISTER_H 11 | 12 | int eap_server_register_methods(void); 13 | 14 | #endif /* EAP_REGISTER_H */ 15 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/logwatch/hostapd.conf: -------------------------------------------------------------------------------- 1 | # Logwatch configuration for hostapd 2 | # 3 | # Copyright 2005 Henrik Brix Andersen 4 | # Distributed under the terms of the GNU General Public License v2 5 | # Alternatively, this file may be distributed under the terms of the BSD License 6 | 7 | Title = "hostapd" 8 | LogFile = messages 9 | *OnlyService = hostapd 10 | *RemoveHeaders 11 | -------------------------------------------------------------------------------- /examples/tkip_ap.py: -------------------------------------------------------------------------------- 1 | """ 2 | Example for lunching the TKIP Access Point 3 | """ 4 | from roguehostapd import hostapd_controller 5 | 6 | if __name__ == "__main__": 7 | HOSTAPD_CONFIG = { 8 | 'ssid' : 'test', 9 | 'interface': 'wlan12', 10 | 'wpa': '1', 11 | 'wpa_passphrase': '12345678', 12 | } 13 | HOSTAPD_OBJ = hostapd_controller.Hostapd() 14 | HOSTAPD_OBJ.start(HOSTAPD_CONFIG, {}) 15 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | #ifndef VERSION_STR_POSTFIX 5 | #define VERSION_STR_POSTFIX "" 6 | #endif /* VERSION_STR_POSTFIX */ 7 | 8 | #ifndef GIT_VERSION_STR_POSTFIX 9 | #define GIT_VERSION_STR_POSTFIX "" 10 | #endif /* GIT_VERSION_STR_POSTFIX */ 11 | 12 | #define VERSION_STR "2.6" VERSION_STR_POSTFIX GIT_VERSION_STR_POSTFIX 13 | 14 | #endif /* VERSION_H */ 15 | -------------------------------------------------------------------------------- /examples/wep_open_64.py: -------------------------------------------------------------------------------- 1 | """ 2 | Example for lunching the WEP-OPEN-64 Access Point 3 | """ 4 | from roguehostapd import hostapd_controller 5 | 6 | if __name__ == "__main__": 7 | HOSTAPD_CONFIG = { 8 | 'ssid' : 'test', 9 | 'interface': 'wlan12', 10 | 'wep_default_key': '0', 11 | 'wep_key0': '"abcde"', 12 | } 13 | HOSTAPD_OBJ = hostapd_controller.Hostapd() 14 | HOSTAPD_OBJ.start(HOSTAPD_CONFIG, {}) 15 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/radius/Makefile: -------------------------------------------------------------------------------- 1 | all: libradius.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libradius.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | 10 | include ../lib.rules 11 | 12 | CFLAGS += -DCONFIG_IPV6 13 | 14 | LIB_OBJS= \ 15 | radius.o \ 16 | radius_client.o \ 17 | radius_das.o \ 18 | radius_server.o 19 | 20 | libradius.a: $(LIB_OBJS) 21 | $(AR) crT $@ $? 22 | 23 | -include $(OBJS:%.o=%.d) 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/authsrv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Authentication server setup 3 | * Copyright (c) 2002-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef AUTHSRV_H 10 | #define AUTHSRV_H 11 | 12 | int authsrv_init(struct hostapd_data *hapd); 13 | void authsrv_deinit(struct hostapd_data *hapd); 14 | 15 | #endif /* AUTHSRV_H */ 16 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_server/Makefile: -------------------------------------------------------------------------------- 1 | all: libeap_server.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libeap_server.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | CFLAGS += -DCONFIG_HS20 12 | 13 | LIB_OBJS= \ 14 | eap_server.o \ 15 | eap_server_identity.o \ 16 | eap_server_methods.o 17 | 18 | libeap_server.a: $(LIB_OBJS) 19 | $(AR) crT $@ $? 20 | 21 | -include $(OBJS:%.o=%.d) 22 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=ap common crypto drivers eapol_auth eapol_supp eap_common eap_peer eap_server l2_packet p2p pae radius rsn_supp tls utils wps 2 | SUBDIRS += fst 3 | 4 | all: 5 | for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d; done 6 | 7 | clean: 8 | for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d clean; done 9 | rm -f *~ 10 | 11 | install: 12 | for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d install; done 13 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.sim_db: -------------------------------------------------------------------------------- 1 | # Example GSM authentication triplet file for EAP-SIM authenticator 2 | # IMSI:Kc:SRES:RAND 3 | # IMSI: ASCII string (numbers) 4 | # Kc: hex, 8 octets 5 | # SRES: hex, 4 octets 6 | # RAND: hex, 16 octets 7 | 234567898765432:A0A1A2A3A4A5A6A7:D1D2D3D4:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 8 | 234567898765432:B0B1B2B3B4B5B6B7:E1E2E3E4:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB 9 | 234567898765432:C0C1C2C3C4C5C6C7:F1F2F3F4:CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 10 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hapd_module_tests.c: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd module tests 3 | * Copyright (c) 2014, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "utils/includes.h" 10 | 11 | #include "utils/common.h" 12 | #include "utils/module_tests.h" 13 | 14 | int hapd_module_tests(void) 15 | { 16 | wpa_printf(MSG_INFO, "hostapd module tests"); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/bss_load.h: -------------------------------------------------------------------------------- 1 | /* 2 | * BSS load update 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef BSS_LOAD_UPDATE_H 10 | #define BSS_LOAD_UPDATE_H 11 | 12 | 13 | int bss_load_update_init(struct hostapd_data *hapd); 14 | void bss_load_update_deinit(struct hostapd_data *hapd); 15 | 16 | 17 | #endif /* BSS_LOAD_UPDATE_H */ 18 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/logwatch/README: -------------------------------------------------------------------------------- 1 | Logwatch is a utility for analyzing system logs and provide a human 2 | readable summary. This directory has a configuration file and a log 3 | analyzer script for parsing hostapd system log entries for logwatch. 4 | These files can be installed by copying them to following locations: 5 | 6 | /etc/log.d/conf/services/hostapd.conf 7 | /etc/log.d/scripts/services/hostapd 8 | 9 | More information about logwatch is available from http://www.logwatch.org/ 10 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/chap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CHAP-MD5 (RFC 1994) 3 | * Copyright (c) 2007-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef CHAP_H 10 | #define CHAP_H 11 | 12 | #define CHAP_MD5_LEN 16 13 | 14 | int chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge, 15 | size_t challenge_len, u8 *response); 16 | 17 | #endif /* CHAP_H */ 18 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/tls/pkcs5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PKCS #5 (Password-based Encryption) 3 | * Copyright (c) 2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef PKCS5_H 10 | #define PKCS5_H 11 | 12 | u8 * pkcs5_decrypt(const u8 *enc_alg, size_t enc_alg_len, 13 | const u8 *enc_data, size_t enc_data_len, 14 | const char *passwd, size_t *data_len); 15 | 16 | #endif /* PKCS5_H */ 17 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/uuid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Universally Unique IDentifier (UUID) 3 | * Copyright (c) 2008, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef UUID_H 10 | #define UUID_H 11 | 12 | #define UUID_LEN 16 13 | 14 | int uuid_str2bin(const char *str, u8 *bin); 15 | int uuid_bin2str(const u8 *bin, char *str, size_t max_len); 16 | int is_nil_uuid(const u8 *uuid); 17 | 18 | #endif /* UUID_H */ 19 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_peer/Makefile: -------------------------------------------------------------------------------- 1 | all: libeap_peer.a 2 | 3 | clean: 4 | rm -f *~ *.o *.so *.d *.gcno *.gcda *.gcov libeap_peer.a 5 | 6 | install: 7 | if ls *.so >/dev/null 2>&1; then \ 8 | install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \ 9 | cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \ 10 | ; fi 11 | 12 | include ../lib.rules 13 | 14 | CFLAGS += -DIEEE8021X_EAPOL 15 | 16 | LIB_OBJS= \ 17 | eap.o \ 18 | eap_methods.o 19 | 20 | libeap_peer.a: $(LIB_OBJS) 21 | $(AR) crT $@ $? 22 | 23 | -include $(OBJS:%.o=%.d) 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/tls/pkcs8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PKCS #8 (Private-key information syntax) 3 | * Copyright (c) 2006-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef PKCS8_H 10 | #define PKCS8_H 11 | 12 | struct crypto_private_key * pkcs8_key_import(const u8 *buf, size_t len); 13 | struct crypto_private_key * 14 | pkcs8_enc_key_import(const u8 *buf, size_t len, const char *passwd); 15 | 16 | #endif /* PKCS8_H */ 17 | -------------------------------------------------------------------------------- /roguehostapd/config/config.ini: -------------------------------------------------------------------------------- 1 | # the value fields should use json value style 2 | [hostapd_config] 3 | interface="wlan0" 4 | ssid="myFakeAP" 5 | channel=1 6 | beacon_int=100 7 | hw_mode="g" 8 | karma_enable=false 9 | 10 | [options] 11 | debug_verbose=false 12 | key_data=true 13 | timestamp=true 14 | version=false 15 | mute=false 16 | eloop_term_disable=false 17 | 18 | [custom_config] 19 | wpspbc=false 20 | # mac address s.t. ["38:ec:11:00:00:00"] 21 | deny_macs=[] 22 | # password of wpa2 23 | # example: "kaka123456" 24 | wpa2password=null 25 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_peap_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP-PEAP common routines 3 | * Copyright (c) 2008-2011, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_PEAP_COMMON_H 10 | #define EAP_PEAP_COMMON_H 11 | 12 | int peap_prfplus(int version, const u8 *key, size_t key_len, 13 | const char *label, const u8 *seed, size_t seed_len, 14 | u8 *buf, size_t buf_len); 15 | 16 | #endif /* EAP_PEAP_COMMON_H */ 17 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/wpa_auth_glue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / WPA authenticator glue code 3 | * Copyright (c) 2002-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef WPA_AUTH_GLUE_H 10 | #define WPA_AUTH_GLUE_H 11 | 12 | int hostapd_setup_wpa(struct hostapd_data *hapd); 13 | void hostapd_reconfig_wpa(struct hostapd_data *hapd); 14 | void hostapd_deinit_wpa(struct hostapd_data *hapd); 15 | 16 | #endif /* WPA_AUTH_GLUE_H */ 17 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Base64 encoding/decoding (RFC1341) 3 | * Copyright (c) 2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef BASE64_H 10 | #define BASE64_H 11 | 12 | unsigned char * base64_encode(const unsigned char *src, size_t len, 13 | size_t *out_len); 14 | unsigned char * base64_decode(const unsigned char *src, size_t len, 15 | size_t *out_len); 16 | 17 | #endif /* BASE64_H */ 18 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/tkip_countermeasures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / TKIP countermeasures 3 | * Copyright (c) 2002-2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TKIP_COUNTERMEASURES_H 10 | #define TKIP_COUNTERMEASURES_H 11 | 12 | int michael_mic_failure(struct hostapd_data *hapd, const u8 *addr, int local); 13 | void ieee80211_tkip_countermeasures_deinit(struct hostapd_data *hapd); 14 | 15 | #endif /* TKIP_COUNTERMEASURES_H */ 16 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/module_tests.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Module tests 3 | * Copyright (c) 2014-2015, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef MODULE_TESTS_H 10 | #define MODULE_TESTS_H 11 | 12 | int wpas_module_tests(void); 13 | int hapd_module_tests(void); 14 | 15 | int utils_module_tests(void); 16 | int wps_module_tests(void); 17 | int common_module_tests(void); 18 | int crypto_module_tests(void); 19 | 20 | #endif /* MODULE_TESTS_H */ 21 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/p2p/Makefile: -------------------------------------------------------------------------------- 1 | all: libp2p.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libp2p.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | CFLAGS += -DCONFIG_WIFI_DISPLAY 12 | CFLAGS += -DCONFIG_WPS_NFC 13 | 14 | LIB_OBJS= \ 15 | p2p_build.o \ 16 | p2p.o \ 17 | p2p_dev_disc.o \ 18 | p2p_go_neg.o \ 19 | p2p_group.o \ 20 | p2p_invitation.o \ 21 | p2p_parse.o \ 22 | p2p_pd.o \ 23 | p2p_sd.o \ 24 | p2p_utils.o 25 | 26 | libp2p.a: $(LIB_OBJS) 27 | $(AR) crT $@ $? 28 | 29 | -include $(OBJS:%.o=%.d) 30 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/browser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hotspot 2.0 client - Web browser 3 | * Copyright (c) 2013, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef BROWSER_H 10 | #define BROWSER_H 11 | 12 | #ifdef CONFIG_NO_BROWSER 13 | static inline int hs20_web_browser(const char *url) 14 | { 15 | return -1; 16 | } 17 | #else /* CONFIG_NO_BROWSER */ 18 | int hs20_web_browser(const char *url); 19 | #endif /* CONFIG_NO_BROWSER */ 20 | 21 | #endif /* BROWSER_H */ 22 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/config_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / Configuration file parser 3 | * Copyright (c) 2003-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef CONFIG_FILE_H 10 | #define CONFIG_FILE_H 11 | 12 | struct hostapd_config * hostapd_config_read(const char *fname); 13 | int hostapd_set_iface(struct hostapd_config *conf, 14 | struct hostapd_bss_config *bss, const char *field, 15 | char *value); 16 | 17 | #endif /* CONFIG_FILE_H */ 18 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/crypto_none.c: -------------------------------------------------------------------------------- 1 | /* 2 | * WPA Supplicant / Empty template functions for crypto wrapper 3 | * Copyright (c) 2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "crypto.h" 13 | 14 | 15 | int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) 16 | { 17 | return 0; 18 | } 19 | 20 | 21 | void des_encrypt(const u8 *clear, const u8 *key, u8 *cypher) 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/tls_openssl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SSL/TLS interface functions for OpenSSL 3 | * Copyright (c) 2004-2015, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TLS_OPENSSL_H 10 | #define TLS_OPENSSL_H 11 | 12 | enum ocsp_result { 13 | OCSP_GOOD, OCSP_REVOKED, OCSP_NO_RESPONSE, OCSP_INVALID 14 | }; 15 | 16 | enum ocsp_result check_ocsp_resp(SSL_CTX *ssl_ctx, SSL *ssl, X509 *cert, 17 | X509 *issuer, X509 *issuer_issuer); 18 | 19 | #endif /* TLS_OPENSSL_H */ 20 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.wpa_psk: -------------------------------------------------------------------------------- 1 | # List of WPA PSKs. Each line, except for empty lines and lines starting 2 | # with #, must contain a MAC address and PSK separated with a space. 3 | # Special MAC address 00:00:00:00:00:00 can be used to configure PSKs that 4 | # anyone can use. PSK can be configured as an ASCII passphrase of 8..63 5 | # characters or as a 256-bit hex PSK (64 hex digits). 6 | 00:00:00:00:00:00 secret passphrase 7 | 00:11:22:33:44:55 another passphrase 8 | 00:22:33:44:55:66 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef 9 | 00:00:00:00:00:00 another passphrase for all STAs 10 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/Makefile: -------------------------------------------------------------------------------- 1 | all: libcommon.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libcommon.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | CFLAGS += -DCONFIG_IEEE80211R 12 | CFLAGS += -DCONFIG_IEEE80211W 13 | CFLAGS += -DCONFIG_HS20 14 | CFLAGS += -DCONFIG_SAE 15 | CFLAGS += -DCONFIG_SUITE 16 | CFLAGS += -DCONFIG_SUITEB 17 | 18 | LIB_OBJS= \ 19 | gas.o \ 20 | hw_features_common.o \ 21 | ieee802_11_common.o \ 22 | sae.o \ 23 | wpa_common.o 24 | 25 | libcommon.a: $(LIB_OBJS) 26 | $(AR) crT $@ $? 27 | 28 | -include $(OBJS:%.o=%.d) 29 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MD5 hash implementation and interface functions 3 | * Copyright (c) 2003-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef MD5_H 10 | #define MD5_H 11 | 12 | #define MD5_MAC_LEN 16 13 | 14 | int hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, 15 | const u8 *addr[], const size_t *len, u8 *mac); 16 | int hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, 17 | u8 *mac); 18 | 19 | #endif /* MD5_H */ 20 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.android.rc: -------------------------------------------------------------------------------- 1 | # 2 | # init.rc fragment for hostapd on Android 3 | # Copyright (c) 2002-2016, Jouni Malinen 4 | # 5 | # This software may be distributed under the terms of the BSD license. 6 | # See README for more details. 7 | # 8 | 9 | on post-fs-data 10 | mkdir /data/misc/wifi/hostapd 0770 wifi wifi 11 | 12 | service hostapd /system/bin/hostapd \ 13 | -e /data/misc/wifi/entropy.bin \ 14 | /data/misc/wifi/hostapd.conf 15 | class main 16 | user wifi 17 | writepid /data/misc/wifi/hostapd.pid 18 | group wifi 19 | disabled 20 | oneshot 21 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/aes_siv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * AES SIV (RFC 5297) 3 | * Copyright (c) 2013 Cozybit, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef AES_SIV_H 10 | #define AES_SIV_H 11 | 12 | int aes_siv_encrypt(const u8 *key, const u8 *pw, 13 | size_t pwlen, size_t num_elem, 14 | const u8 *addr[], const size_t *len, u8 *out); 15 | int aes_siv_decrypt(const u8 *key, const u8 *iv_crypt, size_t iv_c_len, 16 | size_t num_elem, const u8 *addr[], const size_t *len, 17 | u8 *out); 18 | 19 | #endif /* AES_SIV_H */ 20 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef PLATFORM_H 2 | #define PLATFORM_H 3 | 4 | #include "includes.h" 5 | #include "common.h" 6 | 7 | #define le16_to_cpu le_to_host16 8 | #define le32_to_cpu le_to_host32 9 | 10 | #define get_unaligned(p) \ 11 | ({ \ 12 | struct packed_dummy_struct { \ 13 | typeof(*(p)) __val; \ 14 | } __attribute__((packed)) *__ptr = (void *) (p); \ 15 | \ 16 | __ptr->__val; \ 17 | }) 18 | #define get_unaligned_le16(p) le16_to_cpu(get_unaligned((le16 *)(p))) 19 | #define get_unaligned_le32(p) le32_to_cpu(get_unaligned((le32 *)(p))) 20 | 21 | #endif /* PLATFORM_H */ 22 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/rsn_supp/Makefile: -------------------------------------------------------------------------------- 1 | all: librsn_supp.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov librsn_supp.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | CFLAGS += -DCONFIG_IEEE80211W 12 | CFLAGS += -DCONFIG_IEEE80211R 13 | CFLAGS += -DCONFIG_PEERKEY 14 | CFLAGS += -DCONFIG_TDLS 15 | CFLAGS += -DCONFIG_WNM 16 | CFLAGS += -DIEEE8021X_EAPOL 17 | 18 | LIB_OBJS= \ 19 | pmksa_cache.o \ 20 | wpa_ft.o \ 21 | peerkey.o \ 22 | tdls.o \ 23 | preauth.o \ 24 | wpa.o \ 25 | wpa_ie.o 26 | 27 | librsn_supp.a: $(LIB_OBJS) 28 | $(AR) crT $@ $? 29 | 30 | -include $(OBJS:%.o=%.d) 31 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/md5_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MD5 internal definitions 3 | * Copyright (c) 2003-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef MD5_I_H 10 | #define MD5_I_H 11 | 12 | struct MD5Context { 13 | u32 buf[4]; 14 | u32 bits[2]; 15 | u8 in[64]; 16 | }; 17 | 18 | void MD5Init(struct MD5Context *context); 19 | void MD5Update(struct MD5Context *context, unsigned char const *buf, 20 | unsigned len); 21 | void MD5Final(unsigned char digest[16], struct MD5Context *context); 22 | 23 | #endif /* MD5_I_H */ 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * AES functions 3 | * Copyright (c) 2003-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef AES_H 10 | #define AES_H 11 | 12 | #define AES_BLOCK_SIZE 16 13 | 14 | void * aes_encrypt_init(const u8 *key, size_t len); 15 | void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt); 16 | void aes_encrypt_deinit(void *ctx); 17 | void * aes_decrypt_init(const u8 *key, size_t len); 18 | void aes_decrypt(void *ctx, const u8 *crypt, u8 *plain); 19 | void aes_decrypt_deinit(void *ctx); 20 | 21 | #endif /* AES_H */ 22 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/dh_group5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Diffie-Hellman group 5 operations 3 | * Copyright (c) 2009, 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef DH_GROUP5_H 10 | #define DH_GROUP5_H 11 | 12 | void * dh5_init(struct wpabuf **priv, struct wpabuf **publ); 13 | void * dh5_init_fixed(const struct wpabuf *priv, const struct wpabuf *publ); 14 | struct wpabuf * dh5_derive_shared(void *ctx, const struct wpabuf *peer_public, 15 | const struct wpabuf *own_private); 16 | void dh5_free(void *ctx); 17 | 18 | #endif /* DH_GROUP5_H */ 19 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/bitfield.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bitfield 3 | * Copyright (c) 2013, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef BITFIELD_H 10 | #define BITFIELD_H 11 | 12 | struct bitfield; 13 | 14 | struct bitfield * bitfield_alloc(size_t max_bits); 15 | void bitfield_free(struct bitfield *bf); 16 | void bitfield_set(struct bitfield *bf, size_t bit); 17 | void bitfield_clear(struct bitfield *bf, size_t bit); 18 | int bitfield_is_set(struct bitfield *bf, size_t bit); 19 | int bitfield_get_first_zero(struct bitfield *bf); 20 | 21 | #endif /* BITFIELD_H */ 22 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/Makefile: -------------------------------------------------------------------------------- 1 | all: libeap_common.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libeap_common.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | LIB_OBJS= \ 12 | chap.o \ 13 | eap_common.o \ 14 | eap_eke_common.o \ 15 | eap_eke_common.o \ 16 | eap_fast_common.o \ 17 | eap_gpsk_common.o \ 18 | eap_ikev2_common.o \ 19 | eap_pax_common.o \ 20 | eap_peap_common.o \ 21 | eap_psk_common.o \ 22 | eap_pwd_common.o \ 23 | eap_sake_common.o \ 24 | eap_sim_common.o \ 25 | eap_wsc_common.o \ 26 | ikev2_common.o 27 | 28 | libeap_common.a: $(LIB_OBJS) 29 | $(AR) crT $@ $? 30 | 31 | -include $(OBJS:%.o=%.d) 32 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha384_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA-384 internal definitions 3 | * Copyright (c) 2015, Pali Rohár 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef SHA384_I_H 10 | #define SHA384_I_H 11 | 12 | #include "sha512_i.h" 13 | 14 | #define SHA384_BLOCK_SIZE SHA512_BLOCK_SIZE 15 | 16 | #define sha384_state sha512_state 17 | 18 | void sha384_init(struct sha384_state *md); 19 | int sha384_process(struct sha384_state *md, const unsigned char *in, 20 | unsigned long inlen); 21 | int sha384_done(struct sha384_state *md, unsigned char *out); 22 | 23 | #endif /* SHA384_I_H */ 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/karma_handlers.h: -------------------------------------------------------------------------------- 1 | #ifndef KARMA_HANDLERS_H 2 | #define KARMA_HANDLERS_H 3 | extern void free_sta_karma_data(struct hostapd_data *hapd, struct hostapd_karma_data *); 4 | extern struct hostapd_karma_data *get_sta_karma_data( 5 | struct hostapd_data *hapd, const u8 *mac_addr); 6 | extern struct hostapd_karma_data* create_karma_data( 7 | const u8 *ssid, const u8 *mac_addr, size_t ssid_len); 8 | extern void add_sta_karma_data( 9 | struct hostapd_data *hapd, struct hostapd_karma_data *data); 10 | extern void free_all_karma_data(struct hostapd_data *hapd); 11 | extern struct hostapd_karma_data *get_assoc_karma_data(void); 12 | #endif 13 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha1_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA1 internal definitions 3 | * Copyright (c) 2003-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef SHA1_I_H 10 | #define SHA1_I_H 11 | 12 | struct SHA1Context { 13 | u32 state[5]; 14 | u32 count[2]; 15 | unsigned char buffer[64]; 16 | }; 17 | 18 | void SHA1Init(struct SHA1Context *context); 19 | void SHA1Update(struct SHA1Context *context, const void *data, u32 len); 20 | void SHA1Final(unsigned char digest[20], struct SHA1Context *context); 21 | void SHA1Transform(u32 state[5], const unsigned char buffer[64]); 22 | 23 | #endif /* SHA1_I_H */ 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha256_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA-256 internal definitions 3 | * Copyright (c) 2003-2011, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef SHA256_I_H 10 | #define SHA256_I_H 11 | 12 | #define SHA256_BLOCK_SIZE 64 13 | 14 | struct sha256_state { 15 | u64 length; 16 | u32 state[8], curlen; 17 | u8 buf[SHA256_BLOCK_SIZE]; 18 | }; 19 | 20 | void sha256_init(struct sha256_state *md); 21 | int sha256_process(struct sha256_state *md, const unsigned char *in, 22 | unsigned long inlen); 23 | int sha256_done(struct sha256_state *md, unsigned char *out); 24 | 25 | #endif /* SHA256_I_H */ 26 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/rfkill.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Linux rfkill helper functions for driver wrappers 3 | * Copyright (c) 2010, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef RFKILL_H 10 | #define RFKILL_H 11 | 12 | struct rfkill_data; 13 | 14 | struct rfkill_config { 15 | void *ctx; 16 | char ifname[IFNAMSIZ]; 17 | void (*blocked_cb)(void *ctx); 18 | void (*unblocked_cb)(void *ctx); 19 | }; 20 | 21 | struct rfkill_data * rfkill_init(struct rfkill_config *cfg); 22 | void rfkill_deinit(struct rfkill_data *rfkill); 23 | int rfkill_is_blocked(struct rfkill_data *rfkill); 24 | 25 | #endif /* RFKILL_H */ 26 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha512_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA-512 internal definitions 3 | * Copyright (c) 2015, Pali Rohár 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef SHA512_I_H 10 | #define SHA512_I_H 11 | 12 | #define SHA512_BLOCK_SIZE 128 13 | 14 | struct sha512_state { 15 | u64 length, state[8]; 16 | u32 curlen; 17 | u8 buf[SHA512_BLOCK_SIZE]; 18 | }; 19 | 20 | void sha512_init(struct sha512_state *md); 21 | int sha512_process(struct sha512_state *md, const unsigned char *in, 22 | unsigned long inlen); 23 | int sha512_done(struct sha512_state *md, unsigned char *out); 24 | 25 | #endif /* SHA512_I_H */ 26 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/edit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Command line editing and history 3 | * Copyright (c) 2010, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EDIT_H 10 | #define EDIT_H 11 | 12 | int edit_init(void (*cmd_cb)(void *ctx, char *cmd), 13 | void (*eof_cb)(void *ctx), 14 | char ** (*completion_cb)(void *ctx, const char *cmd, int pos), 15 | void *ctx, const char *history_file, const char *ps); 16 | void edit_deinit(const char *history_file, 17 | int (*filter_cb)(void *ctx, const char *cmd)); 18 | void edit_clear_line(void); 19 | void edit_redraw(void); 20 | 21 | #endif /* EDIT_H */ 22 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/linux_bridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Linux bridge configuration kernel interface 3 | * Copyright (c) 2016, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef LINUX_BRIDGE_H 10 | #define LINUX_BRIDGE_H 11 | 12 | /* This interface is defined in linux/if_bridge.h */ 13 | 14 | #define BRCTL_GET_VERSION 0 15 | #define BRCTL_GET_BRIDGES 1 16 | #define BRCTL_ADD_BRIDGE 2 17 | #define BRCTL_DEL_BRIDGE 3 18 | #define BRCTL_ADD_IF 4 19 | #define BRCTL_DEL_IF 5 20 | #define BRCTL_GET_BRIDGE_INFO 6 21 | #define BRCTL_GET_PORT_LIST 7 22 | #define BRCTL_SET_BRIDGE_FORWARD_DELAY 8 23 | 24 | #endif /* LINUX_BRIDGE_H */ 25 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/dhcp_snoop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DHCP snooping for Proxy ARP 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef DHCP_SNOOP_H 10 | #define DHCP_SNOOP_H 11 | 12 | #ifdef CONFIG_PROXYARP 13 | 14 | int dhcp_snoop_init(struct hostapd_data *hapd); 15 | void dhcp_snoop_deinit(struct hostapd_data *hapd); 16 | 17 | #else /* CONFIG_PROXYARP */ 18 | 19 | static inline int dhcp_snoop_init(struct hostapd_data *hapd) 20 | { 21 | return 0; 22 | } 23 | 24 | static inline void dhcp_snoop_deinit(struct hostapd_data *hapd) 25 | { 26 | } 27 | 28 | #endif /* CONFIG_PROXYARP */ 29 | 30 | #endif /* DHCP_SNOOP_H */ 31 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/ip_addr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IP address processing 3 | * Copyright (c) 2003-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IP_ADDR_H 10 | #define IP_ADDR_H 11 | 12 | struct hostapd_ip_addr { 13 | int af; /* AF_INET / AF_INET6 */ 14 | union { 15 | struct in_addr v4; 16 | #ifdef CONFIG_IPV6 17 | struct in6_addr v6; 18 | #endif /* CONFIG_IPV6 */ 19 | u8 max_len[16]; 20 | } u; 21 | }; 22 | 23 | const char * hostapd_ip_txt(const struct hostapd_ip_addr *addr, char *buf, 24 | size_t buflen); 25 | int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr); 26 | 27 | #endif /* IP_ADDR_H */ 28 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/chap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * CHAP-MD5 (RFC 1994) 3 | * Copyright (c) 2007-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "crypto/crypto.h" 13 | #include "chap.h" 14 | 15 | int chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge, 16 | size_t challenge_len, u8 *response) 17 | { 18 | const u8 *addr[3]; 19 | size_t len[3]; 20 | 21 | addr[0] = &id; 22 | len[0] = 1; 23 | addr[1] = secret; 24 | len[1] = secret_len; 25 | addr[2] = challenge; 26 | len[2] = challenge_len; 27 | return md5_vector(3, addr, len, response); 28 | } 29 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/hs20.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hotspot 2.0 AP ANQP processing 3 | * Copyright (c) 2011-2013, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef HS20_H 10 | #define HS20_H 11 | 12 | struct hostapd_data; 13 | 14 | u8 * hostapd_eid_hs20_indication(struct hostapd_data *hapd, u8 *eid); 15 | u8 * hostapd_eid_osen(struct hostapd_data *hapd, u8 *eid); 16 | int hs20_send_wnm_notification(struct hostapd_data *hapd, const u8 *addr, 17 | u8 osu_method, const char *url); 18 | int hs20_send_wnm_notification_deauth_req(struct hostapd_data *hapd, 19 | const u8 *addr, 20 | const struct wpabuf *payload); 21 | 22 | #endif /* HS20_H */ 23 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/wmm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / WMM (Wi-Fi Multimedia) 3 | * Copyright 2002-2003, Instant802 Networks, Inc. 4 | * Copyright 2005-2006, Devicescape Software, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef WME_H 11 | #define WME_H 12 | 13 | struct ieee80211_mgmt; 14 | struct wmm_tspec_element; 15 | 16 | u8 * hostapd_eid_wmm(struct hostapd_data *hapd, u8 *eid); 17 | int hostapd_eid_wmm_valid(struct hostapd_data *hapd, const u8 *eid, 18 | size_t len); 19 | void hostapd_wmm_action(struct hostapd_data *hapd, 20 | const struct ieee80211_mgmt *mgmt, size_t len); 21 | int wmm_process_tspec(struct wmm_tspec_element *tspec); 22 | 23 | #endif /* WME_H */ 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.eap_user_sqlite: -------------------------------------------------------------------------------- 1 | CREATE TABLE users( 2 | identity TEXT PRIMARY KEY, 3 | methods TEXT, 4 | password TEXT, 5 | remediation TEXT, 6 | phase2 INTEGER 7 | ); 8 | 9 | CREATE TABLE wildcards( 10 | identity TEXT PRIMARY KEY, 11 | methods TEXT 12 | ); 13 | 14 | INSERT INTO users(identity,methods,password,phase2) VALUES ('user','TTLS-MSCHAPV2','password',1); 15 | INSERT INTO users(identity,methods,password,phase2) VALUES ('DOMAIN\mschapv2 user','TTLS-MSCHAPV2','password',1); 16 | 17 | INSERT INTO wildcards(identity,methods) VALUES ('','TTLS,TLS'); 18 | INSERT INTO wildcards(identity,methods) VALUES ('0','AKA'); 19 | 20 | CREATE TABLE authlog( 21 | timestamp TEXT, 22 | session TEXT, 23 | nas_ip TEXT, 24 | username TEXT, 25 | note TEXT 26 | ); 27 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/acs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ACS - Automatic Channel Selection module 3 | * Copyright (c) 2011, Atheros Communications 4 | * Copyright (c) 2013, Qualcomm Atheros, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef ACS_H 11 | #define ACS_H 12 | 13 | #ifdef CONFIG_ACS 14 | 15 | enum hostapd_chan_status acs_init(struct hostapd_iface *iface); 16 | 17 | #else /* CONFIG_ACS */ 18 | 19 | static inline enum hostapd_chan_status acs_init(struct hostapd_iface *iface) 20 | { 21 | wpa_printf(MSG_ERROR, "ACS was disabled on your build, rebuild hostapd with CONFIG_ACS=y or set channel"); 22 | return HOSTAPD_CHAN_INVALID; 23 | } 24 | 25 | #endif /* CONFIG_ACS */ 26 | 27 | #endif /* ACS_H */ 28 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_wsc_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP-WSC definitions for Wi-Fi Protected Setup 3 | * Copyright (c) 2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_WSC_COMMON_H 10 | #define EAP_WSC_COMMON_H 11 | 12 | #define EAP_VENDOR_TYPE_WSC 1 13 | 14 | #define WSC_FLAGS_MF 0x01 15 | #define WSC_FLAGS_LF 0x02 16 | 17 | #define WSC_ID_REGISTRAR "WFA-SimpleConfig-Registrar-1-0" 18 | #define WSC_ID_REGISTRAR_LEN 30 19 | #define WSC_ID_ENROLLEE "WFA-SimpleConfig-Enrollee-1-0" 20 | #define WSC_ID_ENROLLEE_LEN 29 21 | 22 | #define WSC_FRAGMENT_SIZE 1400 23 | 24 | 25 | struct wpabuf * eap_wsc_build_frag_ack(u8 id, u8 code); 26 | 27 | #endif /* EAP_WSC_COMMON_H */ 28 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/tls/Makefile: -------------------------------------------------------------------------------- 1 | all: libtls.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d libtls.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | 10 | include ../lib.rules 11 | 12 | CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 13 | CFLAGS += -DCONFIG_CRYPTO_INTERNAL 14 | CFLAGS += -DCONFIG_TLSV11 15 | CFLAGS += -DCONFIG_TLSV12 16 | 17 | LIB_OBJS= \ 18 | asn1.o \ 19 | bignum.o \ 20 | pkcs1.o \ 21 | pkcs5.o \ 22 | pkcs8.o \ 23 | rsa.o \ 24 | tlsv1_client.o \ 25 | tlsv1_client_read.o \ 26 | tlsv1_client_write.o \ 27 | tlsv1_client_ocsp.o \ 28 | tlsv1_common.o \ 29 | tlsv1_cred.o \ 30 | tlsv1_record.o \ 31 | tlsv1_server.o \ 32 | tlsv1_server_read.o \ 33 | tlsv1_server_write.o \ 34 | x509v3.o 35 | 36 | 37 | libtls.a: $(LIB_OBJS) 38 | $(AR) crT $@ $? 39 | 40 | -include $(OBJS:%.o=%.d) 41 | -------------------------------------------------------------------------------- /roguehostapd/buildutil/buildexception.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module defines the custom exceptions for building hostapd 3 | """ 4 | 5 | class SharedLibMissError(Exception): 6 | """ 7 | Define the Netlink shared library missing exception 8 | """ 9 | def __init__(self, libname, packages): 10 | """ 11 | Initialize the NetlinkMissError object 12 | param self: A SharedLibMissError object 13 | param libname: Required library name 14 | param packages: The packages required by the lib 15 | type self: SharedLibMissError 16 | type libname: str 17 | type packages: list 18 | return: None 19 | rtype: None 20 | """ 21 | super(SharedLibMissError, self).__init__(libname, packages) 22 | self.libname = libname 23 | self.packages = packages 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/Makefile: -------------------------------------------------------------------------------- 1 | all: libutils.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libutils.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | 10 | include ../lib.rules 11 | 12 | #CFLAGS += -DWPA_TRACE 13 | CFLAGS += -DCONFIG_IPV6 14 | CFLAGS += -DCONFIG_DEBUG_FILE 15 | 16 | LIB_OBJS= \ 17 | base64.o \ 18 | bitfield.o \ 19 | common.o \ 20 | ip_addr.o \ 21 | radiotap.o \ 22 | trace.o \ 23 | uuid.o \ 24 | wpa_debug.o \ 25 | wpabuf.o 26 | 27 | # Pick correct OS wrapper implementation 28 | LIB_OBJS += os_unix.o 29 | 30 | # Pick correct event loop implementation 31 | LIB_OBJS += eloop.o 32 | 33 | # Pick correct edit implementation 34 | LIB_OBJS += edit.o 35 | 36 | #LIB_OBJS += pcsc_funcs.o 37 | 38 | libutils.a: $(LIB_OBJS) 39 | $(AR) crT $@ $? 40 | 41 | -include $(OBJS:%.o=%.d) 42 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/des_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DES and 3DES-EDE ciphers 3 | * Copyright (c) 2006-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef DES_I_H 10 | #define DES_I_H 11 | 12 | struct des3_key_s { 13 | u32 ek[3][32]; 14 | u32 dk[3][32]; 15 | }; 16 | 17 | void des_key_setup(const u8 *key, u32 *ek, u32 *dk); 18 | void des_block_encrypt(const u8 *plain, const u32 *ek, u8 *crypt); 19 | void des_block_decrypt(const u8 *crypt, const u32 *dk, u8 *plain); 20 | 21 | void des3_key_setup(const u8 *key, struct des3_key_s *dkey); 22 | void des3_encrypt(const u8 *plain, const struct des3_key_s *key, u8 *crypt); 23 | void des3_decrypt(const u8 *crypt, const struct des3_key_s *key, u8 *plain); 24 | 25 | #endif /* DES_I_H */ 26 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/wps/http.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HTTP for WPS 3 | * Copyright (c) 2000-2003 Intel Corporation 4 | * Copyright (c) 2006-2007 Sony Corporation 5 | * Copyright (c) 2008-2009 Atheros Communications 6 | * Copyright (c) 2009, Jouni Malinen 7 | * 8 | * See wps_upnp.c for more details on licensing and code history. 9 | */ 10 | 11 | #ifndef HTTP_H 12 | #define HTTP_H 13 | 14 | enum http_reply_code { 15 | HTTP_OK = 200, 16 | HTTP_BAD_REQUEST = 400, 17 | UPNP_INVALID_ACTION = 401, 18 | UPNP_INVALID_ARGS = 402, 19 | HTTP_NOT_FOUND = 404, 20 | HTTP_PRECONDITION_FAILED = 412, 21 | HTTP_INTERNAL_SERVER_ERROR = 500, 22 | HTTP_UNIMPLEMENTED = 501, 23 | UPNP_ACTION_FAILED = 501, 24 | UPNP_ARG_VALUE_INVALID = 600, 25 | UPNP_ARG_VALUE_OUT_OF_RANGE = 601, 26 | UPNP_OUT_OF_MEMORY = 603 27 | }; 28 | 29 | #endif /* HTTP_H */ 30 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/qca-vendor-attr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Qualcomm Atheros vendor specific attribute definitions 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef QCA_VENDOR_ATTR_H 10 | #define QCA_VENDOR_ATTR_H 11 | 12 | /* 13 | * This file defines some of the attributes used with Qualcomm Atheros OUI 14 | * 00:13:74 in a way that is not suitable for qca-vendor.h, e.g., due to 15 | * compiler dependencies. 16 | */ 17 | 18 | struct qca_avoid_freq_range { 19 | u32 start_freq; 20 | u32 end_freq; 21 | } __attribute__ ((packed)); 22 | 23 | struct qca_avoid_freq_list { 24 | u32 count; 25 | struct qca_avoid_freq_range range[0]; 26 | } __attribute__ ((packed)); 27 | 28 | #endif /* QCA_VENDOR_ATTR_H */ 29 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/dh_groups.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Diffie-Hellman groups 3 | * Copyright (c) 2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef DH_GROUPS_H 10 | #define DH_GROUPS_H 11 | 12 | struct dh_group { 13 | int id; 14 | const u8 *generator; 15 | size_t generator_len; 16 | const u8 *prime; 17 | size_t prime_len; 18 | const u8 *order; 19 | size_t order_len; 20 | unsigned int safe_prime:1; 21 | }; 22 | 23 | const struct dh_group * dh_groups_get(int id); 24 | struct wpabuf * dh_init(const struct dh_group *dh, struct wpabuf **priv); 25 | struct wpabuf * dh_derive_shared(const struct wpabuf *peer_public, 26 | const struct wpabuf *own_private, 27 | const struct dh_group *dh); 28 | 29 | #endif /* DH_GROUPS_H */ 30 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/wps/Makefile: -------------------------------------------------------------------------------- 1 | all: libwps.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libwps.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | CFLAGS += -DCONFIG_P2P 12 | CFLAGS += -DCONFIG_WPS_OOB 13 | CFLAGS += -DCONFIG_WPS_NFC 14 | 15 | LIB_OBJS= \ 16 | http_client.o \ 17 | httpread.o \ 18 | http_server.o \ 19 | ndef.o \ 20 | upnp_xml.o \ 21 | wps_attr_build.o \ 22 | wps_attr_parse.o \ 23 | wps_attr_process.o \ 24 | wps.o \ 25 | wps_common.o \ 26 | wps_dev_attr.o \ 27 | wps_enrollee.o \ 28 | wps_er.o \ 29 | wps_er_ssdp.o \ 30 | wps_module_tests.o \ 31 | wps_registrar.o \ 32 | wps_upnp_ap.o \ 33 | wps_upnp.o \ 34 | wps_upnp_event.o \ 35 | wps_upnp_ssdp.o \ 36 | wps_upnp_web.o 37 | 38 | libwps.a: $(LIB_OBJS) 39 | $(AR) crT $@ $? 40 | 41 | -include $(OBJS:%.o=%.d) 42 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/ext_password_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * External password backend - internal definitions 3 | * Copyright (c) 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EXT_PASSWORD_I_H 10 | #define EXT_PASSWORD_I_H 11 | 12 | #include "ext_password.h" 13 | 14 | struct ext_password_backend { 15 | const char *name; 16 | void * (*init)(const char *params); 17 | void (*deinit)(void *ctx); 18 | struct wpabuf * (*get)(void *ctx, const char *name); 19 | }; 20 | 21 | struct wpabuf * ext_password_alloc(size_t len); 22 | 23 | /* Available ext_password backends */ 24 | 25 | #ifdef CONFIG_EXT_PASSWORD_TEST 26 | extern const struct ext_password_backend ext_password_test; 27 | #endif /* CONFIG_EXT_PASSWORD_TEST */ 28 | 29 | #endif /* EXT_PASSWORD_I_H */ 30 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/vlan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / VLAN definition 3 | * Copyright (c) 2015, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef VLAN_H 10 | #define VLAN_H 11 | 12 | #define MAX_NUM_TAGGED_VLAN 32 13 | 14 | struct vlan_description { 15 | int notempty; /* 0 : no vlan information present, 1: else */ 16 | int untagged; /* >0 802.1q vid */ 17 | int tagged[MAX_NUM_TAGGED_VLAN]; /* first k items, ascending order */ 18 | }; 19 | 20 | #ifndef CONFIG_NO_VLAN 21 | int vlan_compare(struct vlan_description *a, struct vlan_description *b); 22 | #else /* CONFIG_NO_VLAN */ 23 | static inline int 24 | vlan_compare(struct vlan_description *a, struct vlan_description *b) 25 | { 26 | return 0; 27 | } 28 | #endif /* CONFIG_NO_VLAN */ 29 | 30 | #endif /* VLAN_H */ 31 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/aes-encblock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * AES encrypt_block 3 | * 4 | * Copyright (c) 2003-2007, Jouni Malinen 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #include "includes.h" 11 | 12 | #include "common.h" 13 | #include "aes.h" 14 | #include "aes_wrap.h" 15 | 16 | /** 17 | * aes_128_encrypt_block - Perform one AES 128-bit block operation 18 | * @key: Key for AES 19 | * @in: Input data (16 bytes) 20 | * @out: Output of the AES block operation (16 bytes) 21 | * Returns: 0 on success, -1 on failure 22 | */ 23 | int aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out) 24 | { 25 | void *ctx; 26 | ctx = aes_encrypt_init(key, 16); 27 | if (ctx == NULL) 28 | return -1; 29 | aes_encrypt(ctx, in, out); 30 | aes_encrypt_deinit(ctx); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/netlink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Netlink helper functions for driver wrappers 3 | * Copyright (c) 2002-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef NETLINK_H 10 | #define NETLINK_H 11 | 12 | struct netlink_data; 13 | struct ifinfomsg; 14 | 15 | struct netlink_config { 16 | void *ctx; 17 | void (*newlink_cb)(void *ctx, struct ifinfomsg *ifi, u8 *buf, 18 | size_t len); 19 | void (*dellink_cb)(void *ctx, struct ifinfomsg *ifi, u8 *buf, 20 | size_t len); 21 | }; 22 | 23 | struct netlink_data * netlink_init(struct netlink_config *cfg); 24 | void netlink_deinit(struct netlink_data *netlink); 25 | int netlink_send_oper_ifla(struct netlink_data *netlink, int ifindex, 26 | int linkmode, int operstate); 27 | 28 | #endif /* NETLINK_H */ 29 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/taxonomy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / Station client taxonomy 3 | * Copyright (c) 2015 Google, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TAXONOMY_H 10 | #define TAXONOMY_H 11 | 12 | void taxonomy_sta_info_probe_req(const struct hostapd_data *hapd, 13 | struct sta_info *sta, 14 | const u8 *ie, size_t ie_len); 15 | void taxonomy_hostapd_sta_info_probe_req(const struct hostapd_data *hapd, 16 | struct hostapd_sta_info *sta, 17 | const u8 *ie, size_t ie_len); 18 | void taxonomy_sta_info_assoc_req(const struct hostapd_data *hapd, 19 | struct sta_info *sta, 20 | const u8 *ie, size_t ie_len); 21 | int retrieve_sta_taxonomy(const struct hostapd_data *hapd, 22 | struct sta_info *sta, char *buf, size_t buflen); 23 | 24 | #endif /* TAXONOMY_H */ 25 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/tls/rsa.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RSA 3 | * Copyright (c) 2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef RSA_H 10 | #define RSA_H 11 | 12 | struct crypto_rsa_key; 13 | 14 | struct crypto_rsa_key * 15 | crypto_rsa_import_public_key(const u8 *buf, size_t len); 16 | struct crypto_rsa_key * 17 | crypto_rsa_import_public_key_parts(const u8 *n, size_t n_len, 18 | const u8 *e, size_t e_len); 19 | struct crypto_rsa_key * 20 | crypto_rsa_import_private_key(const u8 *buf, size_t len); 21 | size_t crypto_rsa_get_modulus_len(struct crypto_rsa_key *key); 22 | int crypto_rsa_exptmod(const u8 *in, size_t inlen, u8 *out, size_t *outlen, 23 | struct crypto_rsa_key *key, int use_private); 24 | void crypto_rsa_free(struct crypto_rsa_key *key); 25 | 26 | #endif /* RSA_H */ 27 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha384.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA384 hash implementation and interface functions 3 | * Copyright (c) 2015, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef SHA384_H 10 | #define SHA384_H 11 | 12 | #define SHA384_MAC_LEN 48 13 | 14 | int hmac_sha384_vector(const u8 *key, size_t key_len, size_t num_elem, 15 | const u8 *addr[], const size_t *len, u8 *mac); 16 | int hmac_sha384(const u8 *key, size_t key_len, const u8 *data, 17 | size_t data_len, u8 *mac); 18 | void sha384_prf(const u8 *key, size_t key_len, const char *label, 19 | const u8 *data, size_t data_len, u8 *buf, size_t buf_len); 20 | void sha384_prf_bits(const u8 *key, size_t key_len, const char *label, 21 | const u8 *data, size_t data_len, u8 *buf, 22 | size_t buf_len_bits); 23 | 24 | #endif /* SHA384_H */ 25 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/vlan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / VLAN definition 3 | * Copyright (c) 2016, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "utils/includes.h" 10 | 11 | #include "utils/common.h" 12 | #include "ap/vlan.h" 13 | 14 | /* compare the two arguments, NULL is treated as empty 15 | * return zero iff they are equal 16 | */ 17 | int vlan_compare(struct vlan_description *a, struct vlan_description *b) 18 | { 19 | int i; 20 | const int a_empty = !a || !a->notempty; 21 | const int b_empty = !b || !b->notempty; 22 | 23 | if (a_empty && b_empty) 24 | return 0; 25 | if (a_empty || b_empty) 26 | return 1; 27 | if (a->untagged != b->untagged) 28 | return 1; 29 | for (i = 0; i < MAX_NUM_TAGGED_VLAN; i++) { 30 | if (a->tagged[i] != b->tagged[i]) 31 | return 1; 32 | } 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/wps/upnp_xml.h: -------------------------------------------------------------------------------- 1 | /* 2 | * UPnP XML helper routines 3 | * Copyright (c) 2000-2003 Intel Corporation 4 | * Copyright (c) 2006-2007 Sony Corporation 5 | * Copyright (c) 2008-2009 Atheros Communications 6 | * Copyright (c) 2009, Jouni Malinen 7 | * 8 | * See wps_upnp.c for more details on licensing and code history. 9 | */ 10 | 11 | #ifndef UPNP_XML_H 12 | #define UPNP_XML_H 13 | 14 | #include "http.h" 15 | 16 | void xml_data_encode(struct wpabuf *buf, const char *data, int len); 17 | void xml_add_tagged_data(struct wpabuf *buf, const char *tag, 18 | const char *data); 19 | int xml_next_tag(const char *in, const char **out, 20 | const char **out_tagname, const char **end); 21 | char * xml_get_first_item(const char *doc, const char *item); 22 | struct wpabuf * xml_get_base64_item(const char *data, const char *name, 23 | enum http_reply_code *ret); 24 | 25 | #endif /* UPNP_XML_H */ 26 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_wsc_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP-WSC common routines for Wi-Fi Protected Setup 3 | * Copyright (c) 2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "eap_defs.h" 13 | #include "eap_common.h" 14 | #include "wps/wps.h" 15 | #include "eap_wsc_common.h" 16 | 17 | struct wpabuf * eap_wsc_build_frag_ack(u8 id, u8 code) 18 | { 19 | struct wpabuf *msg; 20 | 21 | msg = eap_msg_alloc(EAP_VENDOR_WFA, EAP_VENDOR_TYPE_WSC, 2, code, id); 22 | if (msg == NULL) { 23 | wpa_printf(MSG_ERROR, "EAP-WSC: Failed to allocate memory for " 24 | "FRAG_ACK"); 25 | return NULL; 26 | } 27 | 28 | wpa_printf(MSG_DEBUG, "EAP-WSC: Send WSC/FRAG_ACK"); 29 | wpabuf_put_u8(msg, WSC_FRAG_ACK); /* Op-Code */ 30 | wpabuf_put_u8(msg, 0); /* Flags */ 31 | 32 | return msg; 33 | } 34 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_peer/mschapv2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MSCHAPV2 (RFC 2759) 3 | * Copyright (c) 2004-2008, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef MSCHAPV2_H 10 | #define MSCHAPV2_H 11 | 12 | #define MSCHAPV2_CHAL_LEN 16 13 | #define MSCHAPV2_NT_RESPONSE_LEN 24 14 | #define MSCHAPV2_AUTH_RESPONSE_LEN 20 15 | #define MSCHAPV2_MASTER_KEY_LEN 16 16 | 17 | const u8 * mschapv2_remove_domain(const u8 *username, size_t *len); 18 | int mschapv2_derive_response(const u8 *username, size_t username_len, 19 | const u8 *password, size_t password_len, 20 | int pwhash, 21 | const u8 *auth_challenge, 22 | const u8 *peer_challenge, 23 | u8 *nt_response, u8 *auth_response, 24 | u8 *master_key); 25 | int mschapv2_verify_auth_response(const u8 *auth_response, 26 | const u8 *buf, size_t buf_len); 27 | 28 | #endif /* MSCHAPV2_H */ 29 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/neighbor_db.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / Neighboring APs DB 3 | * Copyright(c) 2013 - 2016 Intel Mobile Communications GmbH. 4 | * Copyright(c) 2011 - 2016 Intel Corporation. All rights reserved. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef NEIGHBOR_DB_H 11 | #define NEIGHBOR_DB_H 12 | 13 | struct hostapd_neighbor_entry * 14 | hostapd_neighbor_get(struct hostapd_data *hapd, const u8 *bssid, 15 | const struct wpa_ssid_value *ssid); 16 | int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid, 17 | const struct wpa_ssid_value *ssid, 18 | const struct wpabuf *nr, const struct wpabuf *lci, 19 | const struct wpabuf *civic); 20 | int hostapd_neighbor_remove(struct hostapd_data *hapd, const u8 *bssid, 21 | const struct wpa_ssid_value *ssid); 22 | void hostpad_free_neighbor_db(struct hostapd_data *hapd); 23 | 24 | #endif /* NEIGHBOR_DB_H */ 25 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_ikev2_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP-IKEv2 definitions 3 | * Copyright (c) 2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_IKEV2_COMMON_H 10 | #define EAP_IKEV2_COMMON_H 11 | 12 | #define IKEV2_FLAGS_LENGTH_INCLUDED 0x80 13 | #define IKEV2_FLAGS_MORE_FRAGMENTS 0x40 14 | #define IKEV2_FLAGS_ICV_INCLUDED 0x20 15 | 16 | #define IKEV2_FRAGMENT_SIZE 1400 17 | 18 | struct ikev2_keys; 19 | 20 | int eap_ikev2_derive_keymat(int prf, struct ikev2_keys *keys, 21 | const u8 *i_nonce, size_t i_nonce_len, 22 | const u8 *r_nonce, size_t r_nonce_len, 23 | u8 *keymat); 24 | struct wpabuf * eap_ikev2_build_frag_ack(u8 id, u8 code); 25 | int eap_ikev2_validate_icv(int integ_alg, struct ikev2_keys *keys, 26 | int initiator, const struct wpabuf *msg, 27 | const u8 *pos, const u8 *end); 28 | 29 | #endif /* EAP_IKEV2_COMMON_H */ 30 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hlr_auc_gw.milenage_db: -------------------------------------------------------------------------------- 1 | # Parameters for Milenage (Example algorithms for AKA). 2 | # The example Ki, OPc, and AMF values here are from 3GPP TS 35.208 v6.0.0 3 | # 4.3.20 Test Set 20. SQN is the last used SQN value. 4 | # These values can be used for both UMTS (EAP-AKA) and GSM (EAP-SIM) 5 | # authentication. In case of GSM/EAP-SIM, AMF and SQN values are not used, but 6 | # dummy values will need to be included in this file. 7 | 8 | # IMSI Ki OPc AMF SQN [RES_len] 9 | 232010000000000 90dca4eda45b53cf0f12d7c9c3bc6a89 cb9cccc4b9258e6dca4760379fb82581 61df 000000000000 10 | # Example using truncated 32-bit RES instead of 64-bit default 11 | 232010000000001 90dca4eda45b53cf0f12d7c9c3bc6a89 cb9cccc4b9258e6dca4760379fb82581 61df 000000000000 4 12 | 13 | # These values are from Test Set 19 which has the AMF separation bit set to 1 14 | # and as such, is suitable for EAP-AKA' test. 15 | 555444333222111 5122250214c33e723a5dd523fc145fc0 981d464c7c52eb6e5036234984ad0bcf c3ab 16f3b3f70fc1 16 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Random number generator 3 | * Copyright (c) 2010-2011, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef RANDOM_H 10 | #define RANDOM_H 11 | 12 | #ifdef CONFIG_NO_RANDOM_POOL 13 | #define random_init(e) do { } while (0) 14 | #define random_deinit() do { } while (0) 15 | #define random_add_randomness(b, l) do { } while (0) 16 | #define random_get_bytes(b, l) os_get_random((b), (l)) 17 | #define random_pool_ready() 1 18 | #define random_mark_pool_ready() do { } while (0) 19 | #else /* CONFIG_NO_RANDOM_POOL */ 20 | void random_init(const char *entropy_file); 21 | void random_deinit(void); 22 | void random_add_randomness(const void *buf, size_t len); 23 | int random_get_bytes(void *buf, size_t len); 24 | int random_pool_ready(void); 25 | void random_mark_pool_ready(void); 26 | #endif /* CONFIG_NO_RANDOM_POOL */ 27 | 28 | #endif /* RANDOM_H */ 29 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/tls/pkcs1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PKCS #1 (RSA Encryption) 3 | * Copyright (c) 2006-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef PKCS1_H 10 | #define PKCS1_H 11 | 12 | struct crypto_public_key; 13 | struct asn1_oid; 14 | 15 | int pkcs1_encrypt(int block_type, struct crypto_rsa_key *key, 16 | int use_private, const u8 *in, size_t inlen, 17 | u8 *out, size_t *outlen); 18 | int pkcs1_v15_private_key_decrypt(struct crypto_rsa_key *key, 19 | const u8 *in, size_t inlen, 20 | u8 *out, size_t *outlen); 21 | int pkcs1_decrypt_public_key(struct crypto_rsa_key *key, 22 | const u8 *crypt, size_t crypt_len, 23 | u8 *plain, size_t *plain_len); 24 | int pkcs1_v15_sig_ver(struct crypto_public_key *pk, 25 | const u8 *s, size_t s_len, 26 | const struct asn1_oid *hash_alg, 27 | const u8 *hash, size_t hash_len); 28 | 29 | #endif /* PKCS1_H */ 30 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/dh_group5.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Diffie-Hellman group 5 operations 3 | * Copyright (c) 2009, 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "dh_groups.h" 13 | #include "dh_group5.h" 14 | 15 | 16 | void * dh5_init(struct wpabuf **priv, struct wpabuf **publ) 17 | { 18 | wpabuf_free(*publ); 19 | *publ = dh_init(dh_groups_get(5), priv); 20 | if (*publ == NULL) 21 | return NULL; 22 | return (void *) 1; 23 | } 24 | 25 | 26 | void * dh5_init_fixed(const struct wpabuf *priv, const struct wpabuf *publ) 27 | { 28 | return (void *) 1; 29 | } 30 | 31 | 32 | struct wpabuf * dh5_derive_shared(void *ctx, const struct wpabuf *peer_public, 33 | const struct wpabuf *own_private) 34 | { 35 | return dh_derive_shared(peer_public, own_private, dh_groups_get(5)); 36 | } 37 | 38 | 39 | void dh5_free(void *ctx) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/iapp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / IEEE 802.11F-2003 Inter-Access Point Protocol (IAPP) 3 | * Copyright (c) 2002-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IAPP_H 10 | #define IAPP_H 11 | 12 | struct iapp_data; 13 | 14 | #ifdef CONFIG_IAPP 15 | 16 | void iapp_new_station(struct iapp_data *iapp, struct sta_info *sta); 17 | struct iapp_data * iapp_init(struct hostapd_data *hapd, const char *iface); 18 | void iapp_deinit(struct iapp_data *iapp); 19 | 20 | #else /* CONFIG_IAPP */ 21 | 22 | static inline void iapp_new_station(struct iapp_data *iapp, 23 | struct sta_info *sta) 24 | { 25 | } 26 | 27 | static inline struct iapp_data * iapp_init(struct hostapd_data *hapd, 28 | const char *iface) 29 | { 30 | return NULL; 31 | } 32 | 33 | static inline void iapp_deinit(struct iapp_data *iapp) 34 | { 35 | } 36 | 37 | #endif /* CONFIG_IAPP */ 38 | 39 | #endif /* IAPP_H */ 40 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/ndisc_snoop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Neighbor Discovery snooping for Proxy ARP 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef NDISC_SNOOP_H 10 | #define NDISC_SNOOP_H 11 | 12 | #if defined(CONFIG_PROXYARP) && defined(CONFIG_IPV6) 13 | 14 | int ndisc_snoop_init(struct hostapd_data *hapd); 15 | void ndisc_snoop_deinit(struct hostapd_data *hapd); 16 | void sta_ip6addr_del(struct hostapd_data *hapd, struct sta_info *sta); 17 | 18 | #else /* CONFIG_PROXYARP && CONFIG_IPV6 */ 19 | 20 | static inline int ndisc_snoop_init(struct hostapd_data *hapd) 21 | { 22 | return 0; 23 | } 24 | 25 | static inline void ndisc_snoop_deinit(struct hostapd_data *hapd) 26 | { 27 | } 28 | 29 | static inline void sta_ip6addr_del(struct hostapd_data *hapd, 30 | struct sta_info *sta) 31 | { 32 | } 33 | 34 | #endif /* CONFIG_PROXYARP && CONFIG_IPV6 */ 35 | 36 | #endif /* NDISC_SNOOP_H */ 37 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/linux_ioctl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Linux ioctl helper functions for driver wrappers 3 | * Copyright (c) 2002-2010, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef LINUX_IOCTL_H 10 | #define LINUX_IOCTL_H 11 | 12 | int linux_set_iface_flags(int sock, const char *ifname, int dev_up); 13 | int linux_iface_up(int sock, const char *ifname); 14 | int linux_get_ifhwaddr(int sock, const char *ifname, u8 *addr); 15 | int linux_set_ifhwaddr(int sock, const char *ifname, const u8 *addr); 16 | int linux_br_add(int sock, const char *brname); 17 | int linux_br_del(int sock, const char *brname); 18 | int linux_br_add_if(int sock, const char *brname, const char *ifname); 19 | int linux_br_del_if(int sock, const char *brname, const char *ifname); 20 | int linux_br_get(char *brname, const char *ifname); 21 | int linux_master_get(char *master_ifname, const char *ifname); 22 | 23 | #endif /* LINUX_IOCTL_H */ 24 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/ext_password.h: -------------------------------------------------------------------------------- 1 | /* 2 | * External password backend 3 | * Copyright (c) 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EXT_PASSWORD_H 10 | #define EXT_PASSWORD_H 11 | 12 | struct ext_password_data; 13 | 14 | #ifdef CONFIG_EXT_PASSWORD 15 | 16 | struct ext_password_data * ext_password_init(const char *backend, 17 | const char *params); 18 | void ext_password_deinit(struct ext_password_data *data); 19 | 20 | struct wpabuf * ext_password_get(struct ext_password_data *data, 21 | const char *name); 22 | void ext_password_free(struct wpabuf *pw); 23 | 24 | #else /* CONFIG_EXT_PASSWORD */ 25 | 26 | #define ext_password_init(b, p) ((void *) 1) 27 | #define ext_password_deinit(d) do { } while (0) 28 | #define ext_password_get(d, n) (NULL) 29 | #define ext_password_free(p) do { } while (0) 30 | 31 | #endif /* CONFIG_EXT_PASSWORD */ 32 | 33 | #endif /* EXT_PASSWORD_H */ 34 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/wnm_ap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IEEE 802.11v WNM related functions and structures 3 | * Copyright (c) 2011-2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef WNM_AP_H 10 | #define WNM_AP_H 11 | 12 | struct sta_info; 13 | 14 | int ieee802_11_rx_wnm_action_ap(struct hostapd_data *hapd, 15 | const struct ieee80211_mgmt *mgmt, size_t len); 16 | int wnm_send_disassoc_imminent(struct hostapd_data *hapd, 17 | struct sta_info *sta, int disassoc_timer); 18 | int wnm_send_ess_disassoc_imminent(struct hostapd_data *hapd, 19 | struct sta_info *sta, const char *url, 20 | int disassoc_timer); 21 | int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta, 22 | u8 req_mode, int disassoc_timer, u8 valid_int, 23 | const u8 *bss_term_dur, const char *url, 24 | const u8 *nei_rep, size_t nei_rep_len, 25 | const u8 *mbo_attrs, size_t mbo_len); 26 | 27 | #endif /* WNM_AP_H */ 28 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/COPYING: -------------------------------------------------------------------------------- 1 | wpa_supplicant and hostapd 2 | -------------------------- 3 | 4 | Copyright (c) 2002-2016, Jouni Malinen and contributors 5 | All Rights Reserved. 6 | 7 | 8 | See the README file for the current license terms. 9 | 10 | This software was previously distributed under BSD/GPL v2 dual license 11 | terms that allowed either of those license alternatives to be 12 | selected. As of February 11, 2012, the project has chosen to use only 13 | the BSD license option for future distribution. As such, the GPL v2 14 | license option is no longer used. It should be noted that the BSD 15 | license option (the one with advertisement clause removed) is compatible 16 | with GPL and as such, does not prevent use of this software in projects 17 | that use GPL. 18 | 19 | Some of the files may still include pointers to GPL version 2 license 20 | terms. However, such copyright and license notifications are maintained 21 | only for attribution purposes and any distribution of this software 22 | after February 11, 2012 is no longer under the GPL v2 option. 23 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/pae/ieee802_1x_key.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IEEE 802.1X-2010 Key Hierarchy 3 | * Copyright (c) 2013, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IEEE802_1X_KEY_H 10 | #define IEEE802_1X_KEY_H 11 | 12 | int ieee802_1x_cak_128bits_aes_cmac(const u8 *msk, const u8 *mac1, 13 | const u8 *mac2, u8 *cak); 14 | int ieee802_1x_ckn_128bits_aes_cmac(const u8 *msk, const u8 *mac1, 15 | const u8 *mac2, const u8 *sid, 16 | size_t sid_bytes, u8 *ckn); 17 | int ieee802_1x_kek_128bits_aes_cmac(const u8 *cak, const u8 *ckn, 18 | size_t ckn_bytes, u8 *kek); 19 | int ieee802_1x_ick_128bits_aes_cmac(const u8 *cak, const u8 *ckn, 20 | size_t ckn_bytes, u8 *ick); 21 | int ieee802_1x_icv_128bits_aes_cmac(const u8 *ick, const u8 *msg, 22 | size_t msg_bytes, u8 *icv); 23 | int ieee802_1x_sak_128bits_aes_cmac(const u8 *cak, const u8 *ctx, 24 | size_t ctx_bytes, u8 *sak); 25 | 26 | #endif /* IEEE802_1X_KEY_H */ 27 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/p2p_hostapd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / P2P integration 3 | * Copyright (c) 2009-2010, Atheros Communications 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef P2P_HOSTAPD_H 10 | #define P2P_HOSTAPD_H 11 | 12 | #ifdef CONFIG_P2P 13 | 14 | int hostapd_p2p_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, 15 | char *buf, size_t buflen); 16 | int hostapd_p2p_set_noa(struct hostapd_data *hapd, u8 count, int start, 17 | int duration); 18 | void hostapd_p2p_non_p2p_sta_connected(struct hostapd_data *hapd); 19 | void hostapd_p2p_non_p2p_sta_disconnected(struct hostapd_data *hapd); 20 | 21 | 22 | #else /* CONFIG_P2P */ 23 | 24 | static inline int hostapd_p2p_get_mib_sta(struct hostapd_data *hapd, 25 | struct sta_info *sta, 26 | char *buf, size_t buflen) 27 | { 28 | return 0; 29 | } 30 | 31 | #endif /* CONFIG_P2P */ 32 | 33 | u8 * hostapd_eid_p2p_manage(struct hostapd_data *hapd, u8 *eid); 34 | 35 | #endif /* P2P_HOSTAPD_H */ 36 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP common peer/server definitions 3 | * Copyright (c) 2004-2014, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_COMMON_H 10 | #define EAP_COMMON_H 11 | 12 | #include "wpabuf.h" 13 | 14 | struct erp_tlvs { 15 | const u8 *keyname; 16 | const u8 *domain; 17 | 18 | u8 keyname_len; 19 | u8 domain_len; 20 | }; 21 | 22 | int eap_hdr_len_valid(const struct wpabuf *msg, size_t min_payload); 23 | const u8 * eap_hdr_validate(int vendor, EapType eap_type, 24 | const struct wpabuf *msg, size_t *plen); 25 | struct wpabuf * eap_msg_alloc(int vendor, EapType type, size_t payload_len, 26 | u8 code, u8 identifier); 27 | void eap_update_len(struct wpabuf *msg); 28 | u8 eap_get_id(const struct wpabuf *msg); 29 | EapType eap_get_type(const struct wpabuf *msg); 30 | int erp_parse_tlvs(const u8 *pos, const u8 *end, struct erp_tlvs *tlvs, 31 | int stop_at_keyname); 32 | 33 | #endif /* EAP_COMMON_H */ 34 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/linux_wext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Driver interaction with generic Linux Wireless Extensions 3 | * Copyright (c) 2003-2011, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef LINUX_WEXT_H 10 | #define LINUX_WEXT_H 11 | 12 | #ifndef ANDROID 13 | 14 | /* 15 | * Avoid including other kernel header to avoid conflicts with C library 16 | * headers. 17 | */ 18 | #define _LINUX_TYPES_H 19 | #define _LINUX_SOCKET_H 20 | #define _LINUX_IF_H 21 | 22 | #include 23 | #include 24 | typedef uint32_t __u32; 25 | typedef int32_t __s32; 26 | typedef uint16_t __u16; 27 | typedef int16_t __s16; 28 | typedef uint8_t __u8; 29 | #ifndef __user 30 | #define __user 31 | #endif /* __user */ 32 | 33 | #endif /* ANDROID */ 34 | 35 | #include 36 | 37 | #ifndef IW_ENCODE_ALG_PMK 38 | #define IW_ENCODE_ALG_PMK 4 39 | #endif 40 | 41 | #ifndef IW_ENC_CAPA_4WAY_HANDSHAKE 42 | #define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010 43 | #endif 44 | 45 | #endif /* LINUX_WEXT_H */ 46 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/rrm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / Radio Measurement (RRM) 3 | * Copyright(c) 2013 - 2016 Intel Mobile Communications GmbH. 4 | * Copyright(c) 2011 - 2016 Intel Corporation. All rights reserved. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef RRM_H 11 | #define RRM_H 12 | 13 | /* 14 | * Max measure request length is 255, -6 of the body we have 249 for the 15 | * neighbor report elements. Each neighbor report element is at least 2 + 13 16 | * bytes, so we can't have more than 16 responders in the request. 17 | */ 18 | #define RRM_RANGE_REQ_MAX_RESPONDERS 16 19 | 20 | void hostapd_handle_radio_measurement(struct hostapd_data *hapd, 21 | const u8 *buf, size_t len); 22 | int hostapd_send_lci_req(struct hostapd_data *hapd, const u8 *addr); 23 | int hostapd_send_range_req(struct hostapd_data *hapd, const u8 *addr, 24 | u16 random_interval, u8 min_ap, 25 | const u8 *responders, unsigned int n_responders); 26 | void hostapd_clean_rrm(struct hostapd_data *hapd); 27 | 28 | #endif /* RRM_H */ 29 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/vlan_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / VLAN netlink/ioctl api 3 | * Copyright (c) 2012, Michael Braun 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef VLAN_UTIL_H 10 | #define VLAN_UTIL_H 11 | 12 | struct hostapd_data; 13 | struct hostapd_vlan; 14 | struct full_dynamic_vlan; 15 | 16 | int vlan_add(const char *if_name, int vid, const char *vlan_if_name); 17 | int vlan_rem(const char *if_name); 18 | int vlan_set_name_type(unsigned int name_type); 19 | 20 | int ifconfig_helper(const char *if_name, int up); 21 | int ifconfig_up(const char *if_name); 22 | int iface_exists(const char *ifname); 23 | int vlan_if_remove(struct hostapd_data *hapd, struct hostapd_vlan *vlan); 24 | 25 | struct full_dynamic_vlan * 26 | full_dynamic_vlan_init(struct hostapd_data *hapd); 27 | void full_dynamic_vlan_deinit(struct full_dynamic_vlan *priv); 28 | void vlan_newlink(const char *ifname, struct hostapd_data *hapd); 29 | void vlan_dellink(const char *ifname, struct hostapd_data *hapd); 30 | 31 | #endif /* VLAN_UTIL_H */ 32 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/milenage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) 3 | * Copyright (c) 2006-2007 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef MILENAGE_H 10 | #define MILENAGE_H 11 | 12 | void milenage_generate(const u8 *opc, const u8 *amf, const u8 *k, 13 | const u8 *sqn, const u8 *_rand, u8 *autn, u8 *ik, 14 | u8 *ck, u8 *res, size_t *res_len); 15 | int milenage_auts(const u8 *opc, const u8 *k, const u8 *_rand, const u8 *auts, 16 | u8 *sqn); 17 | int gsm_milenage(const u8 *opc, const u8 *k, const u8 *_rand, u8 *sres, 18 | u8 *kc); 19 | int milenage_check(const u8 *opc, const u8 *k, const u8 *sqn, const u8 *_rand, 20 | const u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len, 21 | u8 *auts); 22 | int milenage_f1(const u8 *opc, const u8 *k, const u8 *_rand, 23 | const u8 *sqn, const u8 *amf, u8 *mac_a, u8 *mac_s); 24 | int milenage_f2345(const u8 *opc, const u8 *k, const u8 *_rand, 25 | u8 *res, u8 *ck, u8 *ik, u8 *ak, u8 *akstar); 26 | 27 | #endif /* MILENAGE_H */ 28 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/nt_password_hash.c: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd - Plaintext password to NtPasswordHash 3 | * Copyright (c) 2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "crypto/ms_funcs.h" 13 | 14 | 15 | int main(int argc, char *argv[]) 16 | { 17 | unsigned char password_hash[16]; 18 | size_t i; 19 | char *password, buf[64], *pos; 20 | 21 | if (argc > 1) 22 | password = argv[1]; 23 | else { 24 | if (fgets(buf, sizeof(buf), stdin) == NULL) { 25 | printf("Failed to read password\n"); 26 | return 1; 27 | } 28 | buf[sizeof(buf) - 1] = '\0'; 29 | pos = buf; 30 | while (*pos != '\0') { 31 | if (*pos == '\r' || *pos == '\n') { 32 | *pos = '\0'; 33 | break; 34 | } 35 | pos++; 36 | } 37 | password = buf; 38 | } 39 | 40 | if (nt_password_hash((u8 *) password, strlen(password), password_hash)) 41 | return -1; 42 | for (i = 0; i < sizeof(password_hash); i++) 43 | printf("%02x", password_hash[i]); 44 | printf("\n"); 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/ap_mlme.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / IEEE 802.11 MLME 3 | * Copyright 2003, Jouni Malinen 4 | * Copyright 2003-2004, Instant802 Networks, Inc. 5 | * Copyright 2005-2006, Devicescape Software, Inc. 6 | * 7 | * This software may be distributed under the terms of the BSD license. 8 | * See README for more details. 9 | */ 10 | 11 | #ifndef MLME_H 12 | #define MLME_H 13 | 14 | void mlme_authenticate_indication(struct hostapd_data *hapd, 15 | struct sta_info *sta); 16 | 17 | void mlme_deauthenticate_indication(struct hostapd_data *hapd, 18 | struct sta_info *sta, u16 reason_code); 19 | 20 | void mlme_associate_indication(struct hostapd_data *hapd, 21 | struct sta_info *sta); 22 | 23 | void mlme_reassociate_indication(struct hostapd_data *hapd, 24 | struct sta_info *sta); 25 | 26 | void mlme_disassociate_indication(struct hostapd_data *hapd, 27 | struct sta_info *sta, u16 reason_code); 28 | 29 | void mlme_michaelmicfailure_indication(struct hostapd_data *hapd, 30 | const u8 *addr); 31 | 32 | void mlme_deletekeys_request(struct hostapd_data *hapd, struct sta_info *sta); 33 | 34 | #endif /* MLME_H */ 35 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_peer/tncc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP-TNC - TNCC (IF-IMC and IF-TNCCS) 3 | * Copyright (c) 2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TNCC_H 10 | #define TNCC_H 11 | 12 | struct tncc_data; 13 | 14 | struct tncc_data * tncc_init(void); 15 | void tncc_deinit(struct tncc_data *tncc); 16 | void tncc_init_connection(struct tncc_data *tncc); 17 | size_t tncc_total_send_len(struct tncc_data *tncc); 18 | u8 * tncc_copy_send_buf(struct tncc_data *tncc, u8 *pos); 19 | char * tncc_if_tnccs_start(struct tncc_data *tncc); 20 | char * tncc_if_tnccs_end(void); 21 | 22 | enum tncc_process_res { 23 | TNCCS_PROCESS_ERROR = -1, 24 | TNCCS_PROCESS_OK_NO_RECOMMENDATION = 0, 25 | TNCCS_RECOMMENDATION_ERROR, 26 | TNCCS_RECOMMENDATION_ALLOW, 27 | TNCCS_RECOMMENDATION_NONE, 28 | TNCCS_RECOMMENDATION_ISOLATE 29 | }; 30 | 31 | enum tncc_process_res tncc_process_if_tnccs(struct tncc_data *tncc, 32 | const u8 *msg, size_t len); 33 | 34 | struct wpabuf * tncc_process_soh_request(int ver, const u8 *data, size_t len); 35 | 36 | #endif /* TNCC_H */ 37 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA1 hash implementation and interface functions 3 | * Copyright (c) 2003-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef SHA1_H 10 | #define SHA1_H 11 | 12 | #define SHA1_MAC_LEN 20 13 | 14 | int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem, 15 | const u8 *addr[], const size_t *len, u8 *mac); 16 | int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, 17 | u8 *mac); 18 | int sha1_prf(const u8 *key, size_t key_len, const char *label, 19 | const u8 *data, size_t data_len, u8 *buf, size_t buf_len); 20 | int sha1_t_prf(const u8 *key, size_t key_len, const char *label, 21 | const u8 *seed, size_t seed_len, u8 *buf, size_t buf_len); 22 | int __must_check tls_prf_sha1_md5(const u8 *secret, size_t secret_len, 23 | const char *label, const u8 *seed, 24 | size_t seed_len, u8 *out, size_t outlen); 25 | int pbkdf2_sha1(const char *passphrase, const u8 *ssid, size_t ssid_len, 26 | int iterations, u8 *buf, size_t buflen); 27 | #endif /* SHA1_H */ 28 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/ctrl_iface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / UNIX domain socket -based control interface 3 | * Copyright (c) 2004, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef CTRL_IFACE_H 10 | #define CTRL_IFACE_H 11 | 12 | #ifndef CONFIG_NO_CTRL_IFACE 13 | int hostapd_ctrl_iface_init(struct hostapd_data *hapd); 14 | void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd); 15 | int hostapd_global_ctrl_iface_init(struct hapd_interfaces *interface); 16 | void hostapd_global_ctrl_iface_deinit(struct hapd_interfaces *interface); 17 | #else /* CONFIG_NO_CTRL_IFACE */ 18 | static inline int hostapd_ctrl_iface_init(struct hostapd_data *hapd) 19 | { 20 | return 0; 21 | } 22 | 23 | static inline void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd) 24 | { 25 | } 26 | 27 | static inline int 28 | hostapd_global_ctrl_iface_init(struct hapd_interfaces *interface) 29 | { 30 | return 0; 31 | } 32 | 33 | static inline void 34 | hostapd_global_ctrl_iface_deinit(struct hapd_interfaces *interface) 35 | { 36 | } 37 | #endif /* CONFIG_NO_CTRL_IFACE */ 38 | 39 | #endif /* CTRL_IFACE_H */ 40 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/ieee802_11_auth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / IEEE 802.11 authentication (ACL) 3 | * Copyright (c) 2003-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IEEE802_11_AUTH_H 10 | #define IEEE802_11_AUTH_H 11 | 12 | enum { 13 | HOSTAPD_ACL_REJECT = 0, 14 | HOSTAPD_ACL_ACCEPT = 1, 15 | HOSTAPD_ACL_PENDING = 2, 16 | HOSTAPD_ACL_ACCEPT_TIMEOUT = 3 17 | }; 18 | 19 | int hostapd_check_acl(struct hostapd_data *hapd, const u8 *addr, 20 | struct vlan_description *vlan_id); 21 | int hostapd_allowed_address(struct hostapd_data *hapd, const u8 *addr, 22 | const u8 *msg, size_t len, u32 *session_timeout, 23 | u32 *acct_interim_interval, 24 | struct vlan_description *vlan_id, 25 | struct hostapd_sta_wpa_psk_short **psk, 26 | char **identity, char **radius_cui); 27 | int hostapd_acl_init(struct hostapd_data *hapd); 28 | void hostapd_acl_deinit(struct hostapd_data *hapd); 29 | void hostapd_free_psk_list(struct hostapd_sta_wpa_psk_short *psk); 30 | void hostapd_acl_expire(struct hostapd_data *hapd); 31 | 32 | #endif /* IEEE802_11_AUTH_H */ 33 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/linux_defines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Linux defines for values that are not yet included in common C libraries 3 | * Copyright (c) 2014, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef LINUX_DEFINES_H 10 | #define LINUX_DEFINES_H 11 | 12 | #ifndef SO_WIFI_STATUS 13 | # if defined(__sparc__) 14 | # define SO_WIFI_STATUS 0x0025 15 | # elif defined(__parisc__) 16 | # define SO_WIFI_STATUS 0x4022 17 | # else 18 | # define SO_WIFI_STATUS 41 19 | # endif 20 | 21 | # define SCM_WIFI_STATUS SO_WIFI_STATUS 22 | #endif 23 | 24 | #ifndef SO_EE_ORIGIN_TXSTATUS 25 | #define SO_EE_ORIGIN_TXSTATUS 4 26 | #endif 27 | 28 | #ifndef PACKET_TX_TIMESTAMP 29 | #define PACKET_TX_TIMESTAMP 16 30 | #endif 31 | 32 | #ifndef IFF_LOWER_UP 33 | #define IFF_LOWER_UP 0x10000 /* driver signals L1 up */ 34 | #endif 35 | #ifndef IFF_DORMANT 36 | #define IFF_DORMANT 0x20000 /* driver signals dormant */ 37 | #endif 38 | 39 | #ifndef IF_OPER_DORMANT 40 | #define IF_OPER_DORMANT 5 41 | #endif 42 | #ifndef IF_OPER_UP 43 | #define IF_OPER_UP 6 44 | #endif 45 | 46 | #endif /* LINUX_DEFINES_H */ 47 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/dfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DFS - Dynamic Frequency Selection 3 | * Copyright (c) 2002-2013, Jouni Malinen 4 | * Copyright (c) 2013, Qualcomm Atheros, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | #ifndef DFS_H 10 | #define DFS_H 11 | 12 | int hostapd_handle_dfs(struct hostapd_iface *iface); 13 | 14 | int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq, 15 | int ht_enabled, int chan_offset, int chan_width, 16 | int cf1, int cf2); 17 | int hostapd_dfs_radar_detected(struct hostapd_iface *iface, int freq, 18 | int ht_enabled, 19 | int chan_offset, int chan_width, 20 | int cf1, int cf2); 21 | int hostapd_dfs_nop_finished(struct hostapd_iface *iface, int freq, 22 | int ht_enabled, 23 | int chan_offset, int chan_width, int cf1, int cf2); 24 | int hostapd_is_dfs_required(struct hostapd_iface *iface); 25 | int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq, 26 | int ht_enabled, int chan_offset, int chan_width, 27 | int cf1, int cf2); 28 | int hostapd_handle_dfs_offload(struct hostapd_iface *iface); 29 | 30 | #endif /* DFS_H */ 31 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha256.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA256 hash implementation and interface functions 3 | * Copyright (c) 2003-2016, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef SHA256_H 10 | #define SHA256_H 11 | 12 | #define SHA256_MAC_LEN 32 13 | 14 | int hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem, 15 | const u8 *addr[], const size_t *len, u8 *mac); 16 | int hmac_sha256(const u8 *key, size_t key_len, const u8 *data, 17 | size_t data_len, u8 *mac); 18 | int sha256_prf(const u8 *key, size_t key_len, const char *label, 19 | const u8 *data, size_t data_len, u8 *buf, size_t buf_len); 20 | int sha256_prf_bits(const u8 *key, size_t key_len, const char *label, 21 | const u8 *data, size_t data_len, u8 *buf, 22 | size_t buf_len_bits); 23 | void tls_prf_sha256(const u8 *secret, size_t secret_len, 24 | const char *label, const u8 *seed, size_t seed_len, 25 | u8 *out, size_t outlen); 26 | int hmac_sha256_kdf(const u8 *secret, size_t secret_len, 27 | const char *label, const u8 *seed, size_t seed_len, 28 | u8 *out, size_t outlen); 29 | 30 | #endif /* SHA256_H */ 31 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/rc4.c: -------------------------------------------------------------------------------- 1 | /* 2 | * RC4 stream cipher 3 | * Copyright (c) 2002-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "crypto.h" 13 | 14 | #define S_SWAP(a,b) do { u8 t = S[a]; S[a] = S[b]; S[b] = t; } while(0) 15 | 16 | int rc4_skip(const u8 *key, size_t keylen, size_t skip, 17 | u8 *data, size_t data_len) 18 | { 19 | u32 i, j, k; 20 | u8 S[256], *pos; 21 | size_t kpos; 22 | 23 | /* Setup RC4 state */ 24 | for (i = 0; i < 256; i++) 25 | S[i] = i; 26 | j = 0; 27 | kpos = 0; 28 | for (i = 0; i < 256; i++) { 29 | j = (j + S[i] + key[kpos]) & 0xff; 30 | kpos++; 31 | if (kpos >= keylen) 32 | kpos = 0; 33 | S_SWAP(i, j); 34 | } 35 | 36 | /* Skip the start of the stream */ 37 | i = j = 0; 38 | for (k = 0; k < skip; k++) { 39 | i = (i + 1) & 0xff; 40 | j = (j + S[i]) & 0xff; 41 | S_SWAP(i, j); 42 | } 43 | 44 | /* Apply RC4 to data */ 45 | pos = data; 46 | for (k = 0; k < data_len; k++) { 47 | i = (i + 1) & 0xff; 48 | j = (j + S[i]) & 0xff; 49 | S_SWAP(i, j); 50 | *pos++ ^= S[(S[i] + S[j]) & 0xff]; 51 | } 52 | 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/tls/bignum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Big number math 3 | * Copyright (c) 2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef BIGNUM_H 10 | #define BIGNUM_H 11 | 12 | struct bignum; 13 | 14 | struct bignum * bignum_init(void); 15 | void bignum_deinit(struct bignum *n); 16 | size_t bignum_get_unsigned_bin_len(struct bignum *n); 17 | int bignum_get_unsigned_bin(const struct bignum *n, u8 *buf, size_t *len); 18 | int bignum_set_unsigned_bin(struct bignum *n, const u8 *buf, size_t len); 19 | int bignum_cmp(const struct bignum *a, const struct bignum *b); 20 | int bignum_cmp_d(const struct bignum *a, unsigned long b); 21 | int bignum_add(const struct bignum *a, const struct bignum *b, 22 | struct bignum *c); 23 | int bignum_sub(const struct bignum *a, const struct bignum *b, 24 | struct bignum *c); 25 | int bignum_mul(const struct bignum *a, const struct bignum *b, 26 | struct bignum *c); 27 | int bignum_mulmod(const struct bignum *a, const struct bignum *b, 28 | const struct bignum *c, struct bignum *d); 29 | int bignum_exptmod(const struct bignum *a, const struct bignum *b, 30 | const struct bignum *c, struct bignum *d); 31 | 32 | #endif /* BIGNUM_H */ 33 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/ip_addr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * IP address processing 3 | * Copyright (c) 2003-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "ip_addr.h" 13 | 14 | const char * hostapd_ip_txt(const struct hostapd_ip_addr *addr, char *buf, 15 | size_t buflen) 16 | { 17 | if (buflen == 0 || addr == NULL) 18 | return NULL; 19 | 20 | if (addr->af == AF_INET) { 21 | os_strlcpy(buf, inet_ntoa(addr->u.v4), buflen); 22 | } else { 23 | buf[0] = '\0'; 24 | } 25 | #ifdef CONFIG_IPV6 26 | if (addr->af == AF_INET6) { 27 | if (inet_ntop(AF_INET6, &addr->u.v6, buf, buflen) == NULL) 28 | buf[0] = '\0'; 29 | } 30 | #endif /* CONFIG_IPV6 */ 31 | 32 | return buf; 33 | } 34 | 35 | 36 | int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr) 37 | { 38 | #ifndef CONFIG_NATIVE_WINDOWS 39 | if (inet_aton(txt, &addr->u.v4)) { 40 | addr->af = AF_INET; 41 | return 0; 42 | } 43 | 44 | #ifdef CONFIG_IPV6 45 | if (inet_pton(AF_INET6, txt, &addr->u.v6) > 0) { 46 | addr->af = AF_INET6; 47 | return 0; 48 | } 49 | #endif /* CONFIG_IPV6 */ 50 | #endif /* CONFIG_NATIVE_WINDOWS */ 51 | 52 | return -1; 53 | } 54 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/vlan_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / VLAN initialization 3 | * Copyright 2003, Instant802 Networks, Inc. 4 | * Copyright 2005, Devicescape Software, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef VLAN_INIT_H 11 | #define VLAN_INIT_H 12 | 13 | #ifndef CONFIG_NO_VLAN 14 | int vlan_init(struct hostapd_data *hapd); 15 | void vlan_deinit(struct hostapd_data *hapd); 16 | struct hostapd_vlan * vlan_add_dynamic(struct hostapd_data *hapd, 17 | struct hostapd_vlan *vlan, 18 | int vlan_id, 19 | struct vlan_description *vlan_desc); 20 | int vlan_remove_dynamic(struct hostapd_data *hapd, int vlan_id); 21 | #else /* CONFIG_NO_VLAN */ 22 | static inline int vlan_init(struct hostapd_data *hapd) 23 | { 24 | return 0; 25 | } 26 | 27 | static inline void vlan_deinit(struct hostapd_data *hapd) 28 | { 29 | } 30 | 31 | static inline struct hostapd_vlan * 32 | vlan_add_dynamic(struct hostapd_data *hapd, struct hostapd_vlan *vlan, 33 | int vlan_id, struct vlan_description *vlan_desc) 34 | { 35 | return NULL; 36 | } 37 | 38 | static inline int vlan_remove_dynamic(struct hostapd_data *hapd, int vlan_id) 39 | { 40 | return -1; 41 | } 42 | #endif /* CONFIG_NO_VLAN */ 43 | 44 | #endif /* VLAN_INIT_H */ 45 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/wps/http_server.h: -------------------------------------------------------------------------------- 1 | /* 2 | * http_server - HTTP server 3 | * Copyright (c) 2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef HTTP_SERVER_H 10 | #define HTTP_SERVER_H 11 | 12 | struct http_server; 13 | struct http_request; 14 | 15 | void http_request_deinit(struct http_request *req); 16 | void http_request_send(struct http_request *req, struct wpabuf *resp); 17 | void http_request_send_and_deinit(struct http_request *req, 18 | struct wpabuf *resp); 19 | enum httpread_hdr_type http_request_get_type(struct http_request *req); 20 | char * http_request_get_uri(struct http_request *req); 21 | char * http_request_get_hdr(struct http_request *req); 22 | char * http_request_get_data(struct http_request *req); 23 | char * http_request_get_hdr_line(struct http_request *req, const char *tag); 24 | struct sockaddr_in * http_request_get_cli_addr(struct http_request *req); 25 | 26 | struct http_server * http_server_init(struct in_addr *addr, int port, 27 | void (*cb)(void *ctx, 28 | struct http_request *req), 29 | void *cb_ctx); 30 | void http_server_deinit(struct http_server *srv); 31 | int http_server_get_port(struct http_server *srv); 32 | 33 | #endif /* HTTP_SERVER_H */ 34 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/includes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wpa_supplicant/hostapd - Default include files 3 | * Copyright (c) 2005-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | * 8 | * This header file is included into all C files so that commonly used header 9 | * files can be selected with OS specific ifdef blocks in one place instead of 10 | * having to have OS/C library specific selection in many files. 11 | */ 12 | 13 | #ifndef INCLUDES_H 14 | #define INCLUDES_H 15 | 16 | /* Include possible build time configuration before including anything else */ 17 | #include "build_config.h" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #ifndef _WIN32_WCE 25 | #include 26 | #include 27 | #include 28 | #endif /* _WIN32_WCE */ 29 | #include 30 | 31 | #ifndef _MSC_VER 32 | #include 33 | #endif /* _MSC_VER */ 34 | 35 | #ifndef CONFIG_NATIVE_WINDOWS 36 | #include 37 | #include 38 | #include 39 | #ifndef __vxworks 40 | #include 41 | #include 42 | #endif /* __vxworks */ 43 | #endif /* CONFIG_NATIVE_WINDOWS */ 44 | 45 | #endif /* INCLUDES_H */ 46 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/wired.conf: -------------------------------------------------------------------------------- 1 | ##### hostapd configuration file ############################################## 2 | # Empty lines and lines starting with # are ignored 3 | 4 | # Example configuration file for wired authenticator. See hostapd.conf for 5 | # more details. 6 | 7 | interface=eth0 8 | driver=wired 9 | logger_stdout=-1 10 | logger_stdout_level=1 11 | debug=2 12 | dump_file=/tmp/hostapd.dump 13 | 14 | ieee8021x=1 15 | eap_reauth_period=3600 16 | 17 | use_pae_group_addr=1 18 | 19 | 20 | ##### RADIUS configuration #################################################### 21 | # for IEEE 802.1X with external Authentication Server, IEEE 802.11 22 | # authentication with external ACL for MAC addresses, and accounting 23 | 24 | # The own IP address of the access point (used as NAS-IP-Address) 25 | own_ip_addr=127.0.0.1 26 | 27 | # Optional NAS-Identifier string for RADIUS messages. When used, this should be 28 | # a unique to the NAS within the scope of the RADIUS server. For example, a 29 | # fully qualified domain name can be used here. 30 | nas_identifier=ap.example.com 31 | 32 | # RADIUS authentication server 33 | auth_server_addr=127.0.0.1 34 | auth_server_port=1812 35 | auth_server_shared_secret=radius 36 | 37 | # RADIUS accounting server 38 | acct_server_addr=127.0.0.1 39 | acct_server_port=1813 40 | acct_server_shared_secret=radius 41 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/ctrl_iface_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common hostapd/wpa_supplicant ctrl iface code. 3 | * Copyright (c) 2002-2013, Jouni Malinen 4 | * Copyright (c) 2015, Qualcomm Atheros, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | #ifndef CONTROL_IFACE_COMMON_H 10 | #define CONTROL_IFACE_COMMON_H 11 | 12 | #include "utils/list.h" 13 | 14 | /** 15 | * struct wpa_ctrl_dst - Data structure of control interface monitors 16 | * 17 | * This structure is used to store information about registered control 18 | * interface monitors into struct wpa_supplicant. 19 | */ 20 | struct wpa_ctrl_dst { 21 | struct dl_list list; 22 | struct sockaddr_storage addr; 23 | socklen_t addrlen; 24 | int debug_level; 25 | int errors; 26 | }; 27 | 28 | void sockaddr_print(int level, const char *msg, struct sockaddr_storage *sock, 29 | socklen_t socklen); 30 | 31 | int ctrl_iface_attach(struct dl_list *ctrl_dst, struct sockaddr_storage *from, 32 | socklen_t fromlen); 33 | int ctrl_iface_detach(struct dl_list *ctrl_dst, struct sockaddr_storage *from, 34 | socklen_t fromlen); 35 | int ctrl_iface_level(struct dl_list *ctrl_dst, struct sockaddr_storage *from, 36 | socklen_t fromlen, const char *level); 37 | 38 | #endif /* CONTROL_IFACE_COMMON_H */ 39 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/accounting.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / RADIUS Accounting 3 | * Copyright (c) 2002-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef ACCOUNTING_H 10 | #define ACCOUNTING_H 11 | 12 | #ifdef CONFIG_NO_ACCOUNTING 13 | static inline int accounting_sta_get_id(struct hostapd_data *hapd, 14 | struct sta_info *sta) 15 | { 16 | return 0; 17 | } 18 | 19 | static inline void accounting_sta_start(struct hostapd_data *hapd, 20 | struct sta_info *sta) 21 | { 22 | } 23 | 24 | static inline void accounting_sta_stop(struct hostapd_data *hapd, 25 | struct sta_info *sta) 26 | { 27 | } 28 | 29 | static inline int accounting_init(struct hostapd_data *hapd) 30 | { 31 | return 0; 32 | } 33 | 34 | static inline void accounting_deinit(struct hostapd_data *hapd) 35 | { 36 | } 37 | #else /* CONFIG_NO_ACCOUNTING */ 38 | int accounting_sta_get_id(struct hostapd_data *hapd, struct sta_info *sta); 39 | void accounting_sta_start(struct hostapd_data *hapd, struct sta_info *sta); 40 | void accounting_sta_stop(struct hostapd_data *hapd, struct sta_info *sta); 41 | int accounting_init(struct hostapd_data *hapd); 42 | void accounting_deinit(struct hostapd_data *hapd); 43 | #endif /* CONFIG_NO_ACCOUNTING */ 44 | 45 | #endif /* ACCOUNTING_H */ 46 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/wps/http_client.h: -------------------------------------------------------------------------------- 1 | /* 2 | * http_client - HTTP client 3 | * Copyright (c) 2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef HTTP_CLIENT_H 10 | #define HTTP_CLIENT_H 11 | 12 | struct http_client; 13 | 14 | enum http_client_event { 15 | HTTP_CLIENT_FAILED, 16 | HTTP_CLIENT_TIMEOUT, 17 | HTTP_CLIENT_OK, 18 | HTTP_CLIENT_INVALID_REPLY, 19 | }; 20 | 21 | char * http_client_url_parse(const char *url, struct sockaddr_in *dst, 22 | char **path); 23 | struct http_client * http_client_addr(struct sockaddr_in *dst, 24 | struct wpabuf *req, size_t max_response, 25 | void (*cb)(void *ctx, 26 | struct http_client *c, 27 | enum http_client_event event), 28 | void *cb_ctx); 29 | struct http_client * http_client_url(const char *url, 30 | struct wpabuf *req, size_t max_response, 31 | void (*cb)(void *ctx, 32 | struct http_client *c, 33 | enum http_client_event event), 34 | void *cb_ctx); 35 | void http_client_free(struct http_client *c); 36 | struct wpabuf * http_client_get_body(struct http_client *c); 37 | char * http_client_get_hdr_line(struct http_client *c, const char *tag); 38 | char * http_link_update(char *url, const char *base); 39 | 40 | #endif /* HTTP_CLIENT_H */ 41 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/Makefile: -------------------------------------------------------------------------------- 1 | all: libap.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libap.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | include ../lib.rules 10 | 11 | CFLAGS += -DHOSTAPD 12 | CFLAGS += -DNEED_AP_MLME 13 | CFLAGS += -DCONFIG_HS20 14 | CFLAGS += -DCONFIG_INTERWORKING 15 | CFLAGS += -DCONFIG_IEEE80211R 16 | CFLAGS += -DCONFIG_IEEE80211W 17 | CFLAGS += -DCONFIG_WPS 18 | CFLAGS += -DCONFIG_PROXYARP 19 | CFLAGS += -DCONFIG_IAPP 20 | 21 | LIB_OBJS= \ 22 | accounting.o \ 23 | ap_config.o \ 24 | ap_drv_ops.o \ 25 | ap_list.o \ 26 | ap_mlme.o \ 27 | authsrv.o \ 28 | beacon.o \ 29 | bss_load.o \ 30 | ctrl_iface_ap.o \ 31 | dfs.o \ 32 | dhcp_snoop.o \ 33 | drv_callbacks.o \ 34 | eap_user_db.o \ 35 | gas_serv.o \ 36 | hostapd.o \ 37 | hs20.o \ 38 | hw_features.o \ 39 | iapp.o \ 40 | ieee802_11_auth.o \ 41 | ieee802_11.o \ 42 | ieee802_11_ht.o \ 43 | ieee802_11_shared.o \ 44 | ieee802_11_vht.o \ 45 | ieee802_1x.o \ 46 | ndisc_snoop.o \ 47 | p2p_hostapd.o \ 48 | peerkey_auth.o \ 49 | pmksa_cache_auth.o \ 50 | preauth_auth.o \ 51 | sta_info.o \ 52 | tkip_countermeasures.o \ 53 | utils.o \ 54 | vlan_init.o \ 55 | wmm.o \ 56 | wnm_ap.o \ 57 | wpa_auth.o \ 58 | wpa_auth_ft.o \ 59 | wpa_auth_glue.o \ 60 | wpa_auth_ie.o \ 61 | wps_hostapd.o \ 62 | x_snoop.o 63 | 64 | libap.a: $(LIB_OBJS) 65 | $(AR) crT $@ $? 66 | 67 | -include $(OBJS:%.o=%.d) 68 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/beacon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / IEEE 802.11 Management: Beacon and Probe Request/Response 3 | * Copyright (c) 2002-2004, Instant802 Networks, Inc. 4 | * Copyright (c) 2005-2006, Devicescape Software, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef BEACON_H 11 | #define BEACON_H 12 | 13 | struct ieee80211_mgmt; 14 | 15 | void handle_probe_req(struct hostapd_data *hapd, 16 | const struct ieee80211_mgmt *mgmt, size_t len, 17 | int ssi_signal); 18 | int ieee802_11_set_beacon(struct hostapd_data *hapd); 19 | int ieee802_11_set_beacons(struct hostapd_iface *iface); 20 | int ieee802_11_update_beacons(struct hostapd_iface *iface); 21 | int ieee802_11_build_ap_params(struct hostapd_data *hapd, 22 | struct wpa_driver_ap_params *params); 23 | void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params); 24 | void sta_track_add(struct hostapd_iface *iface, const u8 *addr); 25 | void sta_track_del(struct hostapd_sta_info *info); 26 | void sta_track_expire(struct hostapd_iface *iface, int force); 27 | struct hostapd_data * 28 | sta_track_seen_on(struct hostapd_iface *iface, const u8 *addr, 29 | const char *ifname); 30 | void sta_track_claim_taxonomy_info(struct hostapd_iface *iface, const u8 *addr, 31 | struct wpabuf **probe_ie_taxonomy); 32 | 33 | #endif /* BEACON_H */ 34 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/linux_vlan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Linux VLAN configuration kernel interface 3 | * Copyright (c) 2016, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef LINUX_VLAN_H 10 | #define LINUX_VLAN_H 11 | 12 | /* This ioctl is defined in linux/sockios.h */ 13 | 14 | #ifndef SIOCSIFVLAN 15 | #define SIOCSIFVLAN 0x8983 16 | #endif /* SIOCSIFVLAN */ 17 | 18 | /* This interface is defined in linux/if_vlan.h */ 19 | 20 | #define ADD_VLAN_CMD 0 21 | #define DEL_VLAN_CMD 1 22 | #define SET_VLAN_INGRESS_PRIORITY_CMD 2 23 | #define SET_VLAN_EGRESS_PRIORITY_CMD 3 24 | #define GET_VLAN_INGRESS_PRIORITY_CMD 4 25 | #define GET_VLAN_EGRESS_PRIORITY_CMD 5 26 | #define SET_VLAN_NAME_TYPE_CMD 6 27 | #define SET_VLAN_FLAG_CMD 7 28 | #define GET_VLAN_REALDEV_NAME_CMD 8 29 | #define GET_VLAN_VID_CMD 9 30 | 31 | #define VLAN_NAME_TYPE_PLUS_VID 0 32 | #define VLAN_NAME_TYPE_RAW_PLUS_VID 1 33 | #define VLAN_NAME_TYPE_PLUS_VID_NO_PAD 2 34 | #define VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD 3 35 | 36 | struct vlan_ioctl_args { 37 | int cmd; 38 | char device1[24]; 39 | 40 | union { 41 | char device2[24]; 42 | int VID; 43 | unsigned int skb_priority; 44 | unsigned int name_type; 45 | unsigned int bind_type; 46 | unsigned int flag; 47 | } u; 48 | 49 | short vlan_qos; 50 | }; 51 | 52 | #endif /* LINUX_VLAN_H */ 53 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_server/tncs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP-TNC - TNCS (IF-IMV, IF-TNCCS, and IF-TNCCS-SOH) 3 | * Copyright (c) 2007-2008, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TNCS_H 10 | #define TNCS_H 11 | 12 | struct tncs_data; 13 | 14 | struct tncs_data * tncs_init(void); 15 | void tncs_deinit(struct tncs_data *tncs); 16 | void tncs_init_connection(struct tncs_data *tncs); 17 | size_t tncs_total_send_len(struct tncs_data *tncs); 18 | u8 * tncs_copy_send_buf(struct tncs_data *tncs, u8 *pos); 19 | char * tncs_if_tnccs_start(struct tncs_data *tncs); 20 | char * tncs_if_tnccs_end(void); 21 | 22 | enum tncs_process_res { 23 | TNCCS_PROCESS_ERROR = -1, 24 | TNCCS_PROCESS_OK_NO_RECOMMENDATION = 0, 25 | TNCCS_RECOMMENDATION_ERROR, 26 | TNCCS_RECOMMENDATION_ALLOW, 27 | TNCCS_RECOMMENDATION_NONE, 28 | TNCCS_RECOMMENDATION_ISOLATE, 29 | TNCCS_RECOMMENDATION_NO_ACCESS, 30 | TNCCS_RECOMMENDATION_NO_RECOMMENDATION 31 | }; 32 | 33 | enum tncs_process_res tncs_process_if_tnccs(struct tncs_data *tncs, 34 | const u8 *msg, size_t len); 35 | 36 | int tncs_global_init(void); 37 | void tncs_global_deinit(void); 38 | 39 | struct wpabuf * tncs_build_soh_request(void); 40 | struct wpabuf * tncs_process_soh(const u8 *soh_tlv, size_t soh_tlv_len, 41 | int *failure); 42 | 43 | #endif /* TNCS_H */ 44 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/fst/fst_ctrl_iface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FST module - internal Control interface definitions 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef FST_CTRL_IFACE_H 10 | #define FST_CTRL_IFACE_H 11 | 12 | #include "fst/fst_ctrl_aux.h" 13 | 14 | #ifdef CONFIG_FST 15 | 16 | /* receiver */ 17 | int fst_ctrl_iface_mb_info(const u8 *addr, char *buf, size_t buflen); 18 | 19 | int fst_ctrl_iface_receive(const char *txtaddr, char *buf, size_t buflen); 20 | 21 | extern const struct fst_ctrl *fst_ctrl_cli; 22 | 23 | #else /* CONFIG_FST */ 24 | 25 | static inline int 26 | fst_ctrl_iface_mb_info(const u8 *addr, char *buf, size_t buflen) 27 | { 28 | return 0; 29 | } 30 | 31 | #endif /* CONFIG_FST */ 32 | 33 | int fst_read_next_int_param(const char *params, Boolean *valid, char **endp); 34 | int fst_read_next_text_param(const char *params, char *buf, size_t buflen, 35 | char **endp); 36 | int fst_read_peer_addr(const char *mac, u8 *peer_addr); 37 | 38 | struct fst_iface_cfg; 39 | 40 | int fst_parse_attach_command(const char *cmd, char *ifname, size_t ifname_size, 41 | struct fst_iface_cfg *cfg); 42 | int fst_parse_detach_command(const char *cmd, char *ifname, size_t ifname_size); 43 | int fst_iface_detach(const char *ifname); 44 | 45 | #endif /* CTRL_IFACE_FST_H */ 46 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/mbo_ap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MBO related functions and structures 3 | * Copyright (c) 2016, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef MBO_AP_H 10 | #define MBO_AP_H 11 | 12 | struct hostapd_data; 13 | struct sta_info; 14 | struct ieee802_11_elems; 15 | 16 | #ifdef CONFIG_MBO 17 | 18 | void mbo_ap_check_sta_assoc(struct hostapd_data *hapd, struct sta_info *sta, 19 | struct ieee802_11_elems *elems); 20 | int mbo_ap_get_info(struct sta_info *sta, char *buf, size_t buflen); 21 | void mbo_ap_wnm_notification_req(struct hostapd_data *hapd, const u8 *addr, 22 | const u8 *buf, size_t len); 23 | void mbo_ap_sta_free(struct sta_info *sta); 24 | 25 | #else /* CONFIG_MBO */ 26 | 27 | static inline void mbo_ap_check_sta_assoc(struct hostapd_data *hapd, 28 | struct sta_info *sta, 29 | struct ieee802_11_elems *elems) 30 | { 31 | } 32 | 33 | static inline int mbo_ap_get_info(struct sta_info *sta, char *buf, 34 | size_t buflen) 35 | { 36 | return 0; 37 | } 38 | 39 | static inline void mbo_ap_wnm_notification_req(struct hostapd_data *hapd, 40 | const u8 *addr, 41 | const u8 *buf, size_t len) 42 | { 43 | } 44 | 45 | static inline void mbo_ap_sta_free(struct sta_info *sta) 46 | { 47 | } 48 | 49 | #endif /* CONFIG_MBO */ 50 | 51 | #endif /* MBO_AP_H */ 52 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/aes-ctr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * AES-128 CTR 3 | * 4 | * Copyright (c) 2003-2007, Jouni Malinen 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #include "includes.h" 11 | 12 | #include "common.h" 13 | #include "aes.h" 14 | #include "aes_wrap.h" 15 | 16 | /** 17 | * aes_128_ctr_encrypt - AES-128 CTR mode encryption 18 | * @key: Key for encryption (16 bytes) 19 | * @nonce: Nonce for counter mode (16 bytes) 20 | * @data: Data to encrypt in-place 21 | * @data_len: Length of data in bytes 22 | * Returns: 0 on success, -1 on failure 23 | */ 24 | int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, 25 | u8 *data, size_t data_len) 26 | { 27 | void *ctx; 28 | size_t j, len, left = data_len; 29 | int i; 30 | u8 *pos = data; 31 | u8 counter[AES_BLOCK_SIZE], buf[AES_BLOCK_SIZE]; 32 | 33 | ctx = aes_encrypt_init(key, 16); 34 | if (ctx == NULL) 35 | return -1; 36 | os_memcpy(counter, nonce, AES_BLOCK_SIZE); 37 | 38 | while (left > 0) { 39 | aes_encrypt(ctx, counter, buf); 40 | 41 | len = (left < AES_BLOCK_SIZE) ? left : AES_BLOCK_SIZE; 42 | for (j = 0; j < len; j++) 43 | pos[j] ^= buf[j]; 44 | pos += len; 45 | left -= len; 46 | 47 | for (i = AES_BLOCK_SIZE - 1; i >= 0; i--) { 48 | counter[i]++; 49 | if (counter[i]) 50 | break; 51 | } 52 | } 53 | aes_encrypt_deinit(ctx); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/Makefile: -------------------------------------------------------------------------------- 1 | all: libcrypto.a 2 | 3 | clean: 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov libcrypto.a 5 | 6 | install: 7 | @echo Nothing to be made. 8 | 9 | 10 | include ../lib.rules 11 | 12 | CFLAGS += -DCONFIG_CRYPTO_INTERNAL 13 | CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT 14 | CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER 15 | #CFLAGS += -DALL_DH_GROUPS 16 | CFLAGS += -DCONFIG_SHA256 17 | 18 | LIB_OBJS= \ 19 | aes-cbc.o \ 20 | aes-ccm.o \ 21 | aes-ctr.o \ 22 | aes-eax.o \ 23 | aes-encblock.o \ 24 | aes-gcm.o \ 25 | aes-internal.o \ 26 | aes-internal-dec.o \ 27 | aes-internal-enc.o \ 28 | aes-omac1.o \ 29 | aes-siv.o \ 30 | aes-unwrap.o \ 31 | aes-wrap.o \ 32 | des-internal.o \ 33 | dh_group5.o \ 34 | dh_groups.o \ 35 | md4-internal.o \ 36 | md5.o \ 37 | md5-internal.o \ 38 | milenage.o \ 39 | ms_funcs.o \ 40 | rc4.o \ 41 | sha1.o \ 42 | sha1-internal.o \ 43 | sha1-pbkdf2.o \ 44 | sha1-prf.o \ 45 | sha1-tlsprf.o \ 46 | sha1-tprf.o \ 47 | sha256.o \ 48 | sha256-prf.o \ 49 | sha256-tlsprf.o \ 50 | sha256-internal.o \ 51 | sha384-internal.o \ 52 | sha512-internal.o 53 | 54 | LIB_OBJS += crypto_internal.o 55 | LIB_OBJS += crypto_internal-cipher.o 56 | LIB_OBJS += crypto_internal-modexp.o 57 | LIB_OBJS += crypto_internal-rsa.o 58 | LIB_OBJS += tls_internal.o 59 | LIB_OBJS += fips_prf_internal.o 60 | LIB_OBJS += random.o 61 | 62 | 63 | libcrypto.a: $(LIB_OBJS) 64 | $(AR) crT $@ $? 65 | 66 | -include $(OBJS:%.o=%.d) 67 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/crypto_internal-modexp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Crypto wrapper for internal crypto implementation - modexp 3 | * Copyright (c) 2006-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "tls/bignum.h" 13 | #include "crypto.h" 14 | 15 | 16 | int crypto_mod_exp(const u8 *base, size_t base_len, 17 | const u8 *power, size_t power_len, 18 | const u8 *modulus, size_t modulus_len, 19 | u8 *result, size_t *result_len) 20 | { 21 | struct bignum *bn_base, *bn_exp, *bn_modulus, *bn_result; 22 | int ret = -1; 23 | 24 | bn_base = bignum_init(); 25 | bn_exp = bignum_init(); 26 | bn_modulus = bignum_init(); 27 | bn_result = bignum_init(); 28 | 29 | if (bn_base == NULL || bn_exp == NULL || bn_modulus == NULL || 30 | bn_result == NULL) 31 | goto error; 32 | 33 | if (bignum_set_unsigned_bin(bn_base, base, base_len) < 0 || 34 | bignum_set_unsigned_bin(bn_exp, power, power_len) < 0 || 35 | bignum_set_unsigned_bin(bn_modulus, modulus, modulus_len) < 0) 36 | goto error; 37 | 38 | if (bignum_exptmod(bn_base, bn_exp, bn_modulus, bn_result) < 0) 39 | goto error; 40 | 41 | ret = bignum_get_unsigned_bin(bn_result, result, result_len); 42 | 43 | error: 44 | bignum_deinit(bn_base); 45 | bignum_deinit(bn_exp); 46 | bignum_deinit(bn_modulus); 47 | bignum_deinit(bn_result); 48 | return ret; 49 | } 50 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_peer/eap_proxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP proxy definitions 3 | * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_PROXY_H 10 | #define EAP_PROXY_H 11 | 12 | struct eap_proxy_sm; 13 | struct eapol_callbacks; 14 | struct eap_sm; 15 | struct eap_peer_config; 16 | 17 | enum eap_proxy_status { 18 | EAP_PROXY_FAILURE = 0x00, 19 | EAP_PROXY_SUCCESS 20 | }; 21 | 22 | struct eap_proxy_sm * 23 | eap_proxy_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb, 24 | void *msg_ctx); 25 | 26 | void eap_proxy_deinit(struct eap_proxy_sm *eap_proxy); 27 | 28 | int eap_proxy_key_available(struct eap_proxy_sm *sm); 29 | 30 | const u8 * eap_proxy_get_eapKeyData(struct eap_proxy_sm *sm, size_t *len); 31 | 32 | struct wpabuf * eap_proxy_get_eapRespData(struct eap_proxy_sm *sm); 33 | 34 | int eap_proxy_sm_step(struct eap_proxy_sm *sm, struct eap_sm *eap_sm); 35 | 36 | enum eap_proxy_status 37 | eap_proxy_packet_update(struct eap_proxy_sm *eap_proxy, u8 *eapReqData, 38 | int eapReqDataLen); 39 | 40 | int eap_proxy_sm_get_status(struct eap_proxy_sm *sm, char *buf, size_t buflen, 41 | int verbose); 42 | 43 | int eap_proxy_get_imsi(struct eap_proxy_sm *eap_proxy, char *imsi_buf, 44 | size_t *imsi_len); 45 | 46 | int eap_proxy_notify_config(struct eap_proxy_sm *sm, 47 | struct eap_peer_config *config); 48 | 49 | #endif /* EAP_PROXY_H */ 50 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/wpa_helpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wpa_supplicant ctrl_iface helpers 3 | * Copyright (c) 2010-2011, Atheros Communications, Inc. 4 | * Copyright (c) 2011-2012, Qualcomm Atheros, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef WPA_HELPERS_H 11 | #define WPA_HELPERS_H 12 | 13 | int wpa_command(const char *ifname, const char *cmd); 14 | int wpa_command_resp(const char *ifname, const char *cmd, 15 | char *resp, size_t resp_size); 16 | int get_wpa_status(const char *ifname, const char *field, char *obuf, 17 | size_t obuf_size); 18 | 19 | struct wpa_ctrl * open_wpa_mon(const char *ifname); 20 | int wait_ip_addr(const char *ifname, int timeout); 21 | int get_wpa_cli_event(struct wpa_ctrl *mon, 22 | const char *event, char *buf, size_t buf_size); 23 | int get_wpa_cli_event2(struct wpa_ctrl *mon, 24 | const char *event, const char *event2, 25 | char *buf, size_t buf_size); 26 | 27 | int add_network(const char *ifname); 28 | int set_network(const char *ifname, int id, const char *field, 29 | const char *value); 30 | int set_network_quoted(const char *ifname, int id, const char *field, 31 | const char *value); 32 | int add_cred(const char *ifname); 33 | int set_cred(const char *ifname, int id, const char *field, const char *value); 34 | int set_cred_quoted(const char *ifname, int id, const char *field, 35 | const char *value); 36 | 37 | #endif /* WPA_HELPERS_H */ 38 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/drivers.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Driver interface list 3 | * Copyright (c) 2004-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "utils/includes.h" 10 | #include "utils/common.h" 11 | #include "driver.h" 12 | 13 | 14 | const struct wpa_driver_ops *const wpa_drivers[] = 15 | { 16 | #ifdef CONFIG_DRIVER_NL80211 17 | &wpa_driver_nl80211_ops, 18 | #endif /* CONFIG_DRIVER_NL80211 */ 19 | #ifdef CONFIG_DRIVER_WEXT 20 | &wpa_driver_wext_ops, 21 | #endif /* CONFIG_DRIVER_WEXT */ 22 | #ifdef CONFIG_DRIVER_HOSTAP 23 | &wpa_driver_hostap_ops, 24 | #endif /* CONFIG_DRIVER_HOSTAP */ 25 | #ifdef CONFIG_DRIVER_BSD 26 | &wpa_driver_bsd_ops, 27 | #endif /* CONFIG_DRIVER_BSD */ 28 | #ifdef CONFIG_DRIVER_OPENBSD 29 | &wpa_driver_openbsd_ops, 30 | #endif /* CONFIG_DRIVER_OPENBSD */ 31 | #ifdef CONFIG_DRIVER_NDIS 32 | &wpa_driver_ndis_ops, 33 | #endif /* CONFIG_DRIVER_NDIS */ 34 | #ifdef CONFIG_DRIVER_WIRED 35 | &wpa_driver_wired_ops, 36 | #endif /* CONFIG_DRIVER_WIRED */ 37 | #ifdef CONFIG_DRIVER_MACSEC_QCA 38 | &wpa_driver_macsec_qca_ops, 39 | #endif /* CONFIG_DRIVER_MACSEC_QCA */ 40 | #ifdef CONFIG_DRIVER_ROBOSWITCH 41 | &wpa_driver_roboswitch_ops, 42 | #endif /* CONFIG_DRIVER_ROBOSWITCH */ 43 | #ifdef CONFIG_DRIVER_ATHEROS 44 | &wpa_driver_atheros_ops, 45 | #endif /* CONFIG_DRIVER_ATHEROS */ 46 | #ifdef CONFIG_DRIVER_NONE 47 | &wpa_driver_none_ops, 48 | #endif /* CONFIG_DRIVER_NONE */ 49 | NULL 50 | }; 51 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/preauth_auth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd - Authenticator for IEEE 802.11i RSN pre-authentication 3 | * Copyright (c) 2004-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef PREAUTH_H 10 | #define PREAUTH_H 11 | 12 | #ifdef CONFIG_RSN_PREAUTH 13 | 14 | int rsn_preauth_iface_init(struct hostapd_data *hapd); 15 | void rsn_preauth_iface_deinit(struct hostapd_data *hapd); 16 | void rsn_preauth_finished(struct hostapd_data *hapd, struct sta_info *sta, 17 | int success); 18 | void rsn_preauth_send(struct hostapd_data *hapd, struct sta_info *sta, 19 | u8 *buf, size_t len); 20 | void rsn_preauth_free_station(struct hostapd_data *hapd, struct sta_info *sta); 21 | 22 | #else /* CONFIG_RSN_PREAUTH */ 23 | 24 | static inline int rsn_preauth_iface_init(struct hostapd_data *hapd) 25 | { 26 | return 0; 27 | } 28 | 29 | static inline void rsn_preauth_iface_deinit(struct hostapd_data *hapd) 30 | { 31 | } 32 | 33 | static inline void rsn_preauth_finished(struct hostapd_data *hapd, 34 | struct sta_info *sta, 35 | int success) 36 | { 37 | } 38 | 39 | static inline void rsn_preauth_send(struct hostapd_data *hapd, 40 | struct sta_info *sta, 41 | u8 *buf, size_t len) 42 | { 43 | } 44 | 45 | static inline void rsn_preauth_free_station(struct hostapd_data *hapd, 46 | struct sta_info *sta) 47 | { 48 | } 49 | 50 | #endif /* CONFIG_RSN_PREAUTH */ 51 | 52 | #endif /* PREAUTH_H */ 53 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/ctrl_iface_ap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Control interface for shared AP commands 3 | * Copyright (c) 2004-2013, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef CTRL_IFACE_AP_H 10 | #define CTRL_IFACE_AP_H 11 | 12 | int hostapd_ctrl_iface_sta_first(struct hostapd_data *hapd, 13 | char *buf, size_t buflen); 14 | int hostapd_ctrl_iface_sta(struct hostapd_data *hapd, const char *txtaddr, 15 | char *buf, size_t buflen); 16 | int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd, const char *txtaddr, 17 | char *buf, size_t buflen); 18 | int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd, 19 | const char *txtaddr); 20 | int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd, 21 | const char *txtaddr); 22 | int hostapd_ctrl_iface_signature(struct hostapd_data *hapd, 23 | const char *txtaddr, 24 | char *buf, size_t buflen); 25 | int hostapd_ctrl_iface_poll_sta(struct hostapd_data *hapd, 26 | const char *txtaddr); 27 | int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf, 28 | size_t buflen); 29 | int hostapd_parse_csa_settings(const char *pos, 30 | struct csa_settings *settings); 31 | int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd); 32 | int hostapd_ctrl_iface_pmksa_list(struct hostapd_data *hapd, char *buf, 33 | size_t len); 34 | void hostapd_ctrl_iface_pmksa_flush(struct hostapd_data *hapd); 35 | 36 | #endif /* CTRL_IFACE_AP_H */ 37 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/wpa_auth_ie.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd - WPA/RSN IE and KDE definitions 3 | * Copyright (c) 2004-2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef WPA_AUTH_IE_H 10 | #define WPA_AUTH_IE_H 11 | 12 | struct wpa_eapol_ie_parse { 13 | const u8 *wpa_ie; 14 | size_t wpa_ie_len; 15 | const u8 *rsn_ie; 16 | size_t rsn_ie_len; 17 | const u8 *pmkid; 18 | const u8 *gtk; 19 | size_t gtk_len; 20 | const u8 *mac_addr; 21 | size_t mac_addr_len; 22 | #ifdef CONFIG_PEERKEY 23 | const u8 *smk; 24 | size_t smk_len; 25 | const u8 *nonce; 26 | size_t nonce_len; 27 | const u8 *lifetime; 28 | size_t lifetime_len; 29 | const u8 *error; 30 | size_t error_len; 31 | #endif /* CONFIG_PEERKEY */ 32 | #ifdef CONFIG_IEEE80211W 33 | const u8 *igtk; 34 | size_t igtk_len; 35 | #endif /* CONFIG_IEEE80211W */ 36 | #ifdef CONFIG_IEEE80211R 37 | const u8 *mdie; 38 | size_t mdie_len; 39 | const u8 *ftie; 40 | size_t ftie_len; 41 | #endif /* CONFIG_IEEE80211R */ 42 | #ifdef CONFIG_P2P 43 | const u8 *ip_addr_req; 44 | const u8 *ip_addr_alloc; 45 | #endif /* CONFIG_P2P */ 46 | 47 | const u8 *osen; 48 | size_t osen_len; 49 | }; 50 | 51 | int wpa_parse_kde_ies(const u8 *buf, size_t len, 52 | struct wpa_eapol_ie_parse *ie); 53 | u8 * wpa_add_kde(u8 *pos, u32 kde, const u8 *data, size_t data_len, 54 | const u8 *data2, size_t data2_len); 55 | int wpa_auth_gen_wpa_ie(struct wpa_authenticator *wpa_auth); 56 | 57 | #endif /* WPA_AUTH_IE_H */ 58 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/gas.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generic advertisement service (GAS) (IEEE 802.11u) 3 | * Copyright (c) 2009, Atheros Communications 4 | * Copyright (c) 2011-2012, Qualcomm Atheros 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef GAS_H 11 | #define GAS_H 12 | 13 | struct wpabuf * gas_build_initial_req(u8 dialog_token, size_t size); 14 | struct wpabuf * gas_build_comeback_req(u8 dialog_token); 15 | struct wpabuf * gas_build_initial_resp(u8 dialog_token, u16 status_code, 16 | u16 comeback_delay, size_t size); 17 | struct wpabuf * gas_anqp_build_initial_req(u8 dialog_token, size_t size); 18 | struct wpabuf * gas_anqp_build_initial_resp(u8 dialog_token, u16 status_code, 19 | u16 comeback_delay, size_t size); 20 | struct wpabuf * gas_anqp_build_initial_resp_buf(u8 dialog_token, 21 | u16 status_code, 22 | u16 comeback_delay, 23 | struct wpabuf *payload); 24 | struct wpabuf * gas_anqp_build_comeback_resp(u8 dialog_token, u16 status_code, 25 | u8 frag_id, u8 more, 26 | u16 comeback_delay, size_t size); 27 | struct wpabuf * gas_anqp_build_comeback_resp_buf(u8 dialog_token, 28 | u16 status_code, 29 | u8 frag_id, u8 more, 30 | u16 comeback_delay, 31 | struct wpabuf *payload); 32 | void gas_anqp_set_len(struct wpabuf *buf); 33 | 34 | u8 * gas_anqp_add_element(struct wpabuf *buf, u16 info_id); 35 | void gas_anqp_set_element_len(struct wpabuf *buf, u8 *len_pos); 36 | 37 | #endif /* GAS_H */ 38 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/cli.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common hostapd/wpa_supplicant command line interface functionality 3 | * Copyright (c) 2004-2016, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef CLI_H 10 | #define CLI_H 11 | 12 | #include "utils/list.h" 13 | 14 | extern const char *const cli_license; 15 | extern const char *const cli_full_license; 16 | 17 | struct cli_txt_entry { 18 | struct dl_list list; 19 | char *txt; 20 | }; 21 | 22 | void cli_txt_list_free(struct cli_txt_entry *e); 23 | void cli_txt_list_flush(struct dl_list *list); 24 | 25 | struct cli_txt_entry * 26 | cli_txt_list_get(struct dl_list *txt_list, const char *txt); 27 | 28 | void cli_txt_list_del(struct dl_list *txt_list, const char *txt); 29 | void cli_txt_list_del_addr(struct dl_list *txt_list, const char *txt); 30 | void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt, 31 | int separator); 32 | 33 | int cli_txt_list_add(struct dl_list *txt_list, const char *txt); 34 | int cli_txt_list_add_addr(struct dl_list *txt_list, const char *txt); 35 | int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt, 36 | int separator); 37 | 38 | char ** cli_txt_list_array(struct dl_list *txt_list); 39 | 40 | int get_cmd_arg_num(const char *str, int pos); 41 | int write_cmd(char *buf, size_t buflen, const char *cmd, int argc, 42 | char *argv[]); 43 | 44 | #define max_args 10 45 | int tokenize_cmd(char *cmd, char *argv[]); 46 | 47 | #endif /* CLI_H */ 48 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/x_snoop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generic Snooping for Proxy ARP 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef X_SNOOP_H 10 | #define X_SNOOP_H 11 | 12 | #include "l2_packet/l2_packet.h" 13 | 14 | #ifdef CONFIG_PROXYARP 15 | 16 | int x_snoop_init(struct hostapd_data *hapd); 17 | struct l2_packet_data * 18 | x_snoop_get_l2_packet(struct hostapd_data *hapd, 19 | void (*handler)(void *ctx, const u8 *src_addr, 20 | const u8 *buf, size_t len), 21 | enum l2_packet_filter_type type); 22 | void x_snoop_mcast_to_ucast_convert_send(struct hostapd_data *hapd, 23 | struct sta_info *sta, u8 *buf, 24 | size_t len); 25 | void x_snoop_deinit(struct hostapd_data *hapd); 26 | 27 | #else /* CONFIG_PROXYARP */ 28 | 29 | static inline int x_snoop_init(struct hostapd_data *hapd) 30 | { 31 | return 0; 32 | } 33 | 34 | static inline struct l2_packet_data * 35 | x_snoop_get_l2_packet(struct hostapd_data *hapd, 36 | void (*handler)(void *ctx, const u8 *src_addr, 37 | const u8 *buf, size_t len), 38 | enum l2_packet_filter_type type) 39 | { 40 | return NULL; 41 | } 42 | 43 | static inline void 44 | x_snoop_mcast_to_ucast_convert_send(struct hostapd_data *hapd, 45 | struct sta_info *sta, void *buf, 46 | size_t len) 47 | { 48 | } 49 | 50 | static inline void x_snoop_deinit(struct hostapd_data *hapd) 51 | { 52 | } 53 | 54 | #endif /* CONFIG_PROXYARP */ 55 | 56 | #endif /* X_SNOOP_H */ 57 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/wps/wps_upnp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * UPnP WPS Device 3 | * Copyright (c) 2000-2003 Intel Corporation 4 | * Copyright (c) 2006-2007 Sony Corporation 5 | * Copyright (c) 2008-2009 Atheros Communications 6 | * Copyright (c) 2009, Jouni Malinen 7 | * 8 | * See wps_upnp.c for more details on licensing and code history. 9 | */ 10 | 11 | #ifndef WPS_UPNP_H 12 | #define WPS_UPNP_H 13 | 14 | #include "utils/list.h" 15 | 16 | struct upnp_wps_device_sm; 17 | struct wps_context; 18 | struct wps_data; 19 | 20 | struct upnp_wps_peer { 21 | struct dl_list list; 22 | struct wps_data *wps; 23 | }; 24 | 25 | enum upnp_wps_wlanevent_type { 26 | UPNP_WPS_WLANEVENT_TYPE_PROBE = 1, 27 | UPNP_WPS_WLANEVENT_TYPE_EAP = 2 28 | }; 29 | 30 | struct upnp_wps_device_ctx { 31 | int (*rx_req_put_wlan_response)( 32 | void *priv, enum upnp_wps_wlanevent_type ev_type, 33 | const u8 *mac_addr, const struct wpabuf *msg, 34 | enum wps_msg_type msg_type); 35 | 36 | char *ap_pin; 37 | }; 38 | 39 | struct upnp_wps_device_sm * 40 | upnp_wps_device_init(struct upnp_wps_device_ctx *ctx, struct wps_context *wps, 41 | void *priv, char *net_if); 42 | void upnp_wps_device_deinit(struct upnp_wps_device_sm *sm, void *priv); 43 | 44 | int upnp_wps_device_send_wlan_event(struct upnp_wps_device_sm *sm, 45 | const u8 from_mac_addr[ETH_ALEN], 46 | enum upnp_wps_wlanevent_type ev_type, 47 | const struct wpabuf *msg); 48 | int upnp_wps_subscribers(struct upnp_wps_device_sm *sm); 49 | int upnp_wps_set_ap_pin(struct upnp_wps_device_sm *sm, const char *ap_pin); 50 | 51 | #endif /* WPS_UPNP_H */ 52 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017, Wifiphisher 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/fst/fst_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FST module - auxiliary definitions 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef FST_INTERNAL_H 10 | #define FST_INTERNAL_H 11 | 12 | #include "utils/includes.h" 13 | #include "utils/common.h" 14 | #include "common/defs.h" 15 | #include "common/ieee802_11_defs.h" 16 | #include "fst/fst_iface.h" 17 | #include "fst/fst_group.h" 18 | #include "fst/fst_session.h" 19 | 20 | #define fst_printf(level, format, ...) \ 21 | wpa_printf((level), "FST: " format, ##__VA_ARGS__) 22 | 23 | #define fst_printf_group(group, level, format, ...) \ 24 | wpa_printf((level), "FST: %s: " format, \ 25 | fst_group_get_id(group), ##__VA_ARGS__) 26 | 27 | #define fst_printf_iface(iface, level, format, ...) \ 28 | fst_printf_group(fst_iface_get_group(iface), (level), "%s: " format, \ 29 | fst_iface_get_name(iface), ##__VA_ARGS__) 30 | 31 | enum mb_band_id fst_hw_mode_to_band(enum hostapd_hw_mode mode); 32 | 33 | struct fst_ctrl_handle { 34 | struct fst_ctrl ctrl; 35 | struct dl_list global_ctrls_lentry; 36 | }; 37 | 38 | extern struct dl_list fst_global_ctrls_list; 39 | 40 | #define foreach_fst_ctrl_call(clb, ...) \ 41 | do { \ 42 | struct fst_ctrl_handle *__fst_ctrl_h; \ 43 | dl_list_for_each(__fst_ctrl_h, &fst_global_ctrls_list, \ 44 | struct fst_ctrl_handle, global_ctrls_lentry) \ 45 | if (__fst_ctrl_h->ctrl.clb) \ 46 | __fst_ctrl_h->ctrl.clb(__VA_ARGS__);\ 47 | } while (0) 48 | 49 | #endif /* FST_INTERNAL_H */ 50 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/radius/radius_das.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RADIUS Dynamic Authorization Server (DAS) 3 | * Copyright (c) 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef RADIUS_DAS_H 10 | #define RADIUS_DAS_H 11 | 12 | struct radius_das_data; 13 | 14 | enum radius_das_res { 15 | RADIUS_DAS_SUCCESS, 16 | RADIUS_DAS_NAS_MISMATCH, 17 | RADIUS_DAS_SESSION_NOT_FOUND, 18 | RADIUS_DAS_MULTI_SESSION_MATCH, 19 | }; 20 | 21 | struct radius_das_attrs { 22 | /* NAS identification attributes */ 23 | const u8 *nas_ip_addr; 24 | const u8 *nas_identifier; 25 | size_t nas_identifier_len; 26 | const u8 *nas_ipv6_addr; 27 | 28 | /* Session identification attributes */ 29 | const u8 *sta_addr; 30 | const u8 *user_name; 31 | size_t user_name_len; 32 | const u8 *acct_session_id; 33 | size_t acct_session_id_len; 34 | const u8 *acct_multi_session_id; 35 | size_t acct_multi_session_id_len; 36 | const u8 *cui; 37 | size_t cui_len; 38 | }; 39 | 40 | struct radius_das_conf { 41 | int port; 42 | const u8 *shared_secret; 43 | size_t shared_secret_len; 44 | const struct hostapd_ip_addr *client_addr; 45 | unsigned int time_window; 46 | int require_event_timestamp; 47 | int require_message_authenticator; 48 | void *ctx; 49 | enum radius_das_res (*disconnect)(void *ctx, 50 | struct radius_das_attrs *attr); 51 | }; 52 | 53 | struct radius_das_data * 54 | radius_das_init(struct radius_das_conf *conf); 55 | 56 | void radius_das_deinit(struct radius_das_data *data); 57 | 58 | #endif /* RADIUS_DAS_H */ 59 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/tls/tlsv1_cred.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TLSv1 credentials 3 | * Copyright (c) 2006-2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TLSV1_CRED_H 10 | #define TLSV1_CRED_H 11 | 12 | struct tlsv1_credentials { 13 | struct x509_certificate *trusted_certs; 14 | struct x509_certificate *cert; 15 | struct crypto_private_key *key; 16 | 17 | unsigned int cert_probe:1; 18 | unsigned int ca_cert_verify:1; 19 | unsigned int server_cert_only:1; 20 | u8 srv_cert_hash[32]; 21 | 22 | /* Diffie-Hellman parameters */ 23 | u8 *dh_p; /* prime */ 24 | size_t dh_p_len; 25 | u8 *dh_g; /* generator */ 26 | size_t dh_g_len; 27 | 28 | char *ocsp_stapling_response; 29 | char *ocsp_stapling_response_multi; 30 | }; 31 | 32 | 33 | struct tlsv1_credentials * tlsv1_cred_alloc(void); 34 | void tlsv1_cred_free(struct tlsv1_credentials *cred); 35 | int tlsv1_set_ca_cert(struct tlsv1_credentials *cred, const char *cert, 36 | const u8 *cert_blob, size_t cert_blob_len, 37 | const char *path); 38 | int tlsv1_set_cert(struct tlsv1_credentials *cred, const char *cert, 39 | const u8 *cert_blob, size_t cert_blob_len); 40 | int tlsv1_set_private_key(struct tlsv1_credentials *cred, 41 | const char *private_key, 42 | const char *private_key_passwd, 43 | const u8 *private_key_blob, 44 | size_t private_key_blob_len); 45 | int tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file, 46 | const u8 *dh_blob, size_t dh_blob_len); 47 | 48 | #endif /* TLSV1_CRED_H */ 49 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/uuid.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Universally Unique IDentifier (UUID) 3 | * Copyright (c) 2008, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "uuid.h" 13 | 14 | int uuid_str2bin(const char *str, u8 *bin) 15 | { 16 | const char *pos; 17 | u8 *opos; 18 | 19 | pos = str; 20 | opos = bin; 21 | 22 | if (hexstr2bin(pos, opos, 4)) 23 | return -1; 24 | pos += 8; 25 | opos += 4; 26 | 27 | if (*pos++ != '-' || hexstr2bin(pos, opos, 2)) 28 | return -1; 29 | pos += 4; 30 | opos += 2; 31 | 32 | if (*pos++ != '-' || hexstr2bin(pos, opos, 2)) 33 | return -1; 34 | pos += 4; 35 | opos += 2; 36 | 37 | if (*pos++ != '-' || hexstr2bin(pos, opos, 2)) 38 | return -1; 39 | pos += 4; 40 | opos += 2; 41 | 42 | if (*pos++ != '-' || hexstr2bin(pos, opos, 6)) 43 | return -1; 44 | 45 | return 0; 46 | } 47 | 48 | 49 | int uuid_bin2str(const u8 *bin, char *str, size_t max_len) 50 | { 51 | int len; 52 | len = os_snprintf(str, max_len, "%02x%02x%02x%02x-%02x%02x-%02x%02x-" 53 | "%02x%02x-%02x%02x%02x%02x%02x%02x", 54 | bin[0], bin[1], bin[2], bin[3], 55 | bin[4], bin[5], bin[6], bin[7], 56 | bin[8], bin[9], bin[10], bin[11], 57 | bin[12], bin[13], bin[14], bin[15]); 58 | if (os_snprintf_error(max_len, len)) 59 | return -1; 60 | return 0; 61 | } 62 | 63 | 64 | int is_nil_uuid(const u8 *uuid) 65 | { 66 | int i; 67 | for (i = 0; i < UUID_LEN; i++) 68 | if (uuid[i]) 69 | return 0; 70 | return 1; 71 | } 72 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/hw_features_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common hostapd/wpa_supplicant HW features 3 | * Copyright (c) 2002-2013, Jouni Malinen 4 | * Copyright (c) 2015, Qualcomm Atheros, Inc. 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #ifndef HW_FEATURES_COMMON_H 11 | #define HW_FEATURES_COMMON_H 12 | 13 | #include "drivers/driver.h" 14 | 15 | struct hostapd_channel_data * hw_get_channel_chan(struct hostapd_hw_modes *mode, 16 | int chan, int *freq); 17 | struct hostapd_channel_data * hw_get_channel_freq(struct hostapd_hw_modes *mode, 18 | int freq, int *chan); 19 | 20 | int hw_get_freq(struct hostapd_hw_modes *mode, int chan); 21 | int hw_get_chan(struct hostapd_hw_modes *mode, int freq); 22 | 23 | int allowed_ht40_channel_pair(struct hostapd_hw_modes *mode, int pri_chan, 24 | int sec_chan); 25 | void get_pri_sec_chan(struct wpa_scan_res *bss, int *pri_chan, int *sec_chan); 26 | int check_40mhz_5g(struct hostapd_hw_modes *mode, 27 | struct wpa_scan_results *scan_res, int pri_chan, 28 | int sec_chan); 29 | int check_40mhz_2g4(struct hostapd_hw_modes *mode, 30 | struct wpa_scan_results *scan_res, int pri_chan, 31 | int sec_chan); 32 | int hostapd_set_freq_params(struct hostapd_freq_params *data, 33 | enum hostapd_hw_mode mode, 34 | int freq, int channel, int ht_enabled, 35 | int vht_enabled, int sec_channel_offset, 36 | int vht_oper_chwidth, int center_segment0, 37 | int center_segment1, u32 vht_caps); 38 | 39 | #endif /* HW_FEATURES_COMMON_H */ 40 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/pcsc_funcs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WPA Supplicant / PC/SC smartcard interface for USIM, GSM SIM 3 | * Copyright (c) 2004-2006, 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef PCSC_FUNCS_H 10 | #define PCSC_FUNCS_H 11 | 12 | #ifdef PCSC_FUNCS 13 | struct scard_data * scard_init(const char *reader); 14 | void scard_deinit(struct scard_data *scard); 15 | 16 | int scard_set_pin(struct scard_data *scard, const char *pin); 17 | int scard_get_imsi(struct scard_data *scard, char *imsi, size_t *len); 18 | int scard_get_mnc_len(struct scard_data *scard); 19 | int scard_gsm_auth(struct scard_data *scard, const unsigned char *_rand, 20 | unsigned char *sres, unsigned char *kc); 21 | int scard_umts_auth(struct scard_data *scard, const unsigned char *_rand, 22 | const unsigned char *autn, 23 | unsigned char *res, size_t *res_len, 24 | unsigned char *ik, unsigned char *ck, unsigned char *auts); 25 | int scard_get_pin_retry_counter(struct scard_data *scard); 26 | int scard_supports_umts(struct scard_data *scard); 27 | 28 | #else /* PCSC_FUNCS */ 29 | 30 | #define scard_init(r) NULL 31 | #define scard_deinit(s) do { } while (0) 32 | #define scard_set_pin(s, p) -1 33 | #define scard_get_imsi(s, i, l) -1 34 | #define scard_get_mnc_len(s) -1 35 | #define scard_gsm_auth(s, r, s2, k) -1 36 | #define scard_umts_auth(s, r, a, r2, rl, i, c, a2) -1 37 | #define scard_get_pin_retry_counter(s) -1 38 | #define scard_supports_umts(s) 0 39 | 40 | #endif /* PCSC_FUNCS */ 41 | 42 | #endif /* PCSC_FUNCS_H */ 43 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/build_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wpa_supplicant/hostapd - Build time configuration defines 3 | * Copyright (c) 2005-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | * 8 | * This header file can be used to define configuration defines that were 9 | * originally defined in Makefile. This is mainly meant for IDE use or for 10 | * systems that do not have suitable 'make' tool. In these cases, it may be 11 | * easier to have a single place for defining all the needed C pre-processor 12 | * defines. 13 | */ 14 | 15 | #ifndef BUILD_CONFIG_H 16 | #define BUILD_CONFIG_H 17 | 18 | /* Insert configuration defines, e.g., #define EAP_MD5, here, if needed. */ 19 | 20 | #ifdef CONFIG_WIN32_DEFAULTS 21 | #define CONFIG_NATIVE_WINDOWS 22 | #define CONFIG_ANSI_C_EXTRA 23 | #define CONFIG_WINPCAP 24 | #define IEEE8021X_EAPOL 25 | #define PKCS12_FUNCS 26 | #define PCSC_FUNCS 27 | #define CONFIG_CTRL_IFACE 28 | #define CONFIG_CTRL_IFACE_NAMED_PIPE 29 | #define CONFIG_DRIVER_NDIS 30 | #define CONFIG_NDIS_EVENTS_INTEGRATED 31 | #define CONFIG_DEBUG_FILE 32 | #define EAP_MD5 33 | #define EAP_TLS 34 | #define EAP_MSCHAPv2 35 | #define EAP_PEAP 36 | #define EAP_TTLS 37 | #define EAP_GTC 38 | #define EAP_OTP 39 | #define EAP_LEAP 40 | #define EAP_TNC 41 | #define _CRT_SECURE_NO_DEPRECATE 42 | 43 | #ifdef USE_INTERNAL_CRYPTO 44 | #define CONFIG_TLS_INTERNAL_CLIENT 45 | #define CONFIG_INTERNAL_LIBTOMMATH 46 | #define CONFIG_CRYPTO_INTERNAL 47 | #endif /* USE_INTERNAL_CRYPTO */ 48 | #endif /* CONFIG_WIN32_DEFAULTS */ 49 | 50 | #endif /* BUILD_CONFIG_H */ 51 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_peer/ikev2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IKEv2 responder (RFC 4306) for EAP-IKEV2 3 | * Copyright (c) 2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IKEV2_H 10 | #define IKEV2_H 11 | 12 | #include "eap_common/ikev2_common.h" 13 | 14 | struct ikev2_proposal_data { 15 | u8 proposal_num; 16 | int integ; 17 | int prf; 18 | int encr; 19 | int dh; 20 | }; 21 | 22 | 23 | struct ikev2_responder_data { 24 | enum { SA_INIT, SA_AUTH, CHILD_SA, NOTIFY, IKEV2_DONE, IKEV2_FAILED } 25 | state; 26 | u8 i_spi[IKEV2_SPI_LEN]; 27 | u8 r_spi[IKEV2_SPI_LEN]; 28 | u8 i_nonce[IKEV2_NONCE_MAX_LEN]; 29 | size_t i_nonce_len; 30 | u8 r_nonce[IKEV2_NONCE_MAX_LEN]; 31 | size_t r_nonce_len; 32 | struct wpabuf *i_dh_public; 33 | struct wpabuf *r_dh_private; 34 | struct ikev2_proposal_data proposal; 35 | const struct dh_group *dh; 36 | struct ikev2_keys keys; 37 | u8 *IDi; 38 | size_t IDi_len; 39 | u8 IDi_type; 40 | u8 *IDr; 41 | size_t IDr_len; 42 | struct wpabuf *r_sign_msg; 43 | struct wpabuf *i_sign_msg; 44 | u8 *shared_secret; 45 | size_t shared_secret_len; 46 | enum { PEER_AUTH_CERT, PEER_AUTH_SECRET } peer_auth; 47 | u8 *key_pad; 48 | size_t key_pad_len; 49 | u16 error_type; 50 | enum { LAST_MSG_SA_INIT, LAST_MSG_SA_AUTH } last_msg; 51 | }; 52 | 53 | 54 | void ikev2_responder_deinit(struct ikev2_responder_data *data); 55 | int ikev2_responder_process(struct ikev2_responder_data *data, 56 | const struct wpabuf *buf); 57 | struct wpabuf * ikev2_responder_build(struct ikev2_responder_data *data); 58 | 59 | #endif /* IKEV2_H */ 60 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_peer/eap_fast_pac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP peer method: EAP-FAST PAC file processing 3 | * Copyright (c) 2004-2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_FAST_PAC_H 10 | #define EAP_FAST_PAC_H 11 | 12 | #include "eap_common/eap_fast_common.h" 13 | 14 | struct eap_fast_pac { 15 | struct eap_fast_pac *next; 16 | 17 | u8 pac_key[EAP_FAST_PAC_KEY_LEN]; 18 | u8 *pac_opaque; 19 | size_t pac_opaque_len; 20 | u8 *pac_info; 21 | size_t pac_info_len; 22 | u8 *a_id; 23 | size_t a_id_len; 24 | u8 *i_id; 25 | size_t i_id_len; 26 | u8 *a_id_info; 27 | size_t a_id_info_len; 28 | u16 pac_type; 29 | }; 30 | 31 | 32 | void eap_fast_free_pac(struct eap_fast_pac *pac); 33 | struct eap_fast_pac * eap_fast_get_pac(struct eap_fast_pac *pac_root, 34 | const u8 *a_id, size_t a_id_len, 35 | u16 pac_type); 36 | int eap_fast_add_pac(struct eap_fast_pac **pac_root, 37 | struct eap_fast_pac **pac_current, 38 | struct eap_fast_pac *entry); 39 | int eap_fast_load_pac(struct eap_sm *sm, struct eap_fast_pac **pac_root, 40 | const char *pac_file); 41 | int eap_fast_save_pac(struct eap_sm *sm, struct eap_fast_pac *pac_root, 42 | const char *pac_file); 43 | size_t eap_fast_pac_list_truncate(struct eap_fast_pac *pac_root, 44 | size_t max_len); 45 | int eap_fast_load_pac_bin(struct eap_sm *sm, struct eap_fast_pac **pac_root, 46 | const char *pac_file); 47 | int eap_fast_save_pac_bin(struct eap_sm *sm, struct eap_fast_pac *pac_root, 48 | const char *pac_file); 49 | 50 | #endif /* EAP_FAST_PAC_H */ 51 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_peer/eap_proxy_dummy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP proxy - dummy implementation for build testing 3 | * Copyright (c) 2013 Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "eap_proxy.h" 13 | 14 | struct eap_proxy_sm * 15 | eap_proxy_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb, 16 | void *msg_ctx) 17 | { 18 | return NULL; 19 | } 20 | 21 | 22 | void eap_proxy_deinit(struct eap_proxy_sm *eap_proxy) 23 | { 24 | } 25 | 26 | 27 | int eap_proxy_key_available(struct eap_proxy_sm *sm) 28 | { 29 | return 0; 30 | } 31 | 32 | 33 | const u8 * eap_proxy_get_eapKeyData(struct eap_proxy_sm *sm, size_t *len) 34 | { 35 | return NULL; 36 | } 37 | 38 | 39 | struct wpabuf * eap_proxy_get_eapRespData(struct eap_proxy_sm *sm) 40 | { 41 | return NULL; 42 | } 43 | 44 | 45 | int eap_proxy_sm_step(struct eap_proxy_sm *sm, struct eap_sm *eap_sm) 46 | { 47 | return 0; 48 | } 49 | 50 | 51 | enum eap_proxy_status 52 | eap_proxy_packet_update(struct eap_proxy_sm *eap_proxy, u8 *eapReqData, 53 | int eapReqDataLen) 54 | { 55 | return EAP_PROXY_FAILURE; 56 | } 57 | 58 | 59 | int eap_proxy_sm_get_status(struct eap_proxy_sm *sm, char *buf, size_t buflen, 60 | int verbose) 61 | { 62 | return 0; 63 | } 64 | 65 | 66 | int eap_proxy_get_imsi(struct eap_proxy_sm *eap_proxy, char *imsi_buf, 67 | size_t *imsi_len) 68 | { 69 | return -1; 70 | } 71 | 72 | 73 | int eap_proxy_notify_config(struct eap_proxy_sm *sm, 74 | struct eap_peer_config *config) 75 | { 76 | return -1; 77 | } 78 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_server/ikev2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IKEv2 initiator (RFC 4306) for EAP-IKEV2 3 | * Copyright (c) 2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IKEV2_H 10 | #define IKEV2_H 11 | 12 | #include "eap_common/ikev2_common.h" 13 | 14 | struct ikev2_proposal_data { 15 | u8 proposal_num; 16 | int integ; 17 | int prf; 18 | int encr; 19 | int dh; 20 | }; 21 | 22 | 23 | struct ikev2_initiator_data { 24 | enum { SA_INIT, SA_AUTH, CHILD_SA, IKEV2_DONE } state; 25 | u8 i_spi[IKEV2_SPI_LEN]; 26 | u8 r_spi[IKEV2_SPI_LEN]; 27 | u8 i_nonce[IKEV2_NONCE_MAX_LEN]; 28 | size_t i_nonce_len; 29 | u8 r_nonce[IKEV2_NONCE_MAX_LEN]; 30 | size_t r_nonce_len; 31 | struct wpabuf *r_dh_public; 32 | struct wpabuf *i_dh_private; 33 | struct ikev2_proposal_data proposal; 34 | const struct dh_group *dh; 35 | struct ikev2_keys keys; 36 | u8 *IDi; 37 | size_t IDi_len; 38 | u8 *IDr; 39 | size_t IDr_len; 40 | u8 IDr_type; 41 | struct wpabuf *r_sign_msg; 42 | struct wpabuf *i_sign_msg; 43 | u8 *shared_secret; 44 | size_t shared_secret_len; 45 | enum { PEER_AUTH_CERT, PEER_AUTH_SECRET } peer_auth; 46 | u8 *key_pad; 47 | size_t key_pad_len; 48 | 49 | const u8 * (*get_shared_secret)(void *ctx, const u8 *IDr, 50 | size_t IDr_len, size_t *secret_len); 51 | void *cb_ctx; 52 | int unknown_user; 53 | }; 54 | 55 | 56 | void ikev2_initiator_deinit(struct ikev2_initiator_data *data); 57 | int ikev2_initiator_process(struct ikev2_initiator_data *data, 58 | const struct wpabuf *buf); 59 | struct wpabuf * ikev2_initiator_build(struct ikev2_initiator_data *data); 60 | 61 | #endif /* IKEV2_H */ 62 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/fips_prf_internal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FIPS 186-2 PRF for internal crypto implementation 3 | * Copyright (c) 2006-2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "sha1.h" 13 | #include "sha1_i.h" 14 | #include "crypto.h" 15 | 16 | 17 | int fips186_2_prf(const u8 *seed, size_t seed_len, u8 *x, size_t xlen) 18 | { 19 | u8 xkey[64]; 20 | u32 t[5], _t[5]; 21 | int i, j, m, k; 22 | u8 *xpos = x; 23 | u32 carry; 24 | 25 | if (seed_len < sizeof(xkey)) 26 | os_memset(xkey + seed_len, 0, sizeof(xkey) - seed_len); 27 | else 28 | seed_len = sizeof(xkey); 29 | 30 | /* FIPS 186-2 + change notice 1 */ 31 | 32 | os_memcpy(xkey, seed, seed_len); 33 | t[0] = 0x67452301; 34 | t[1] = 0xEFCDAB89; 35 | t[2] = 0x98BADCFE; 36 | t[3] = 0x10325476; 37 | t[4] = 0xC3D2E1F0; 38 | 39 | m = xlen / 40; 40 | for (j = 0; j < m; j++) { 41 | /* XSEED_j = 0 */ 42 | for (i = 0; i < 2; i++) { 43 | /* XVAL = (XKEY + XSEED_j) mod 2^b */ 44 | 45 | /* w_i = G(t, XVAL) */ 46 | os_memcpy(_t, t, 20); 47 | SHA1Transform(_t, xkey); 48 | _t[0] = host_to_be32(_t[0]); 49 | _t[1] = host_to_be32(_t[1]); 50 | _t[2] = host_to_be32(_t[2]); 51 | _t[3] = host_to_be32(_t[3]); 52 | _t[4] = host_to_be32(_t[4]); 53 | os_memcpy(xpos, _t, 20); 54 | 55 | /* XKEY = (1 + XKEY + w_i) mod 2^b */ 56 | carry = 1; 57 | for (k = 19; k >= 0; k--) { 58 | carry += xkey[k] + xpos[k]; 59 | xkey[k] = carry & 0xff; 60 | carry >>= 8; 61 | } 62 | 63 | xpos += SHA1_MAC_LEN; 64 | } 65 | /* x_j = w_0|w_1 */ 66 | } 67 | 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/hostapd.8: -------------------------------------------------------------------------------- 1 | .TH HOSTAPD 8 "April 7, 2005" hostapd hostapd 2 | .SH NAME 3 | hostapd \- IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator 4 | .SH SYNOPSIS 5 | .B hostapd 6 | [\-hdBKtv] [\-P ] 7 | .SH DESCRIPTION 8 | This manual page documents briefly the 9 | .B hostapd 10 | daemon. 11 | .PP 12 | .B hostapd 13 | is a user space daemon for access point and authentication servers. 14 | It implements IEEE 802.11 access point management, IEEE 802.1X/WPA/WPA2/EAP Authenticators and RADIUS authentication server. 15 | The current version supports Linux (Host AP, mac80211-based drivers) and FreeBSD (net80211). 16 | 17 | .B hostapd 18 | is designed to be a "daemon" program that runs in the background and acts as the backend component controlling authentication. 19 | .B hostapd 20 | supports separate frontend programs and an example text-based frontend, 21 | .BR hostapd_cli , 22 | is included with 23 | .BR hostapd . 24 | .SH OPTIONS 25 | A summary of options is included below. 26 | For a complete description, run 27 | .BR hostapd 28 | from the command line. 29 | .TP 30 | .B \-h 31 | Show usage. 32 | .TP 33 | .B \-d 34 | Show more debug messages. 35 | .TP 36 | .B \-dd 37 | Show even more debug messages. 38 | .TP 39 | .B \-B 40 | Run daemon in the background. 41 | .TP 42 | .B \-P 43 | Path to PID file. 44 | .TP 45 | .B \-K 46 | Include key data in debug messages. 47 | .TP 48 | .B \-t 49 | Include timestamps in some debug messages. 50 | .TP 51 | .B \-v 52 | Show hostapd version. 53 | .SH SEE ALSO 54 | .BR hostapd_cli (1). 55 | .SH AUTHOR 56 | hostapd was written by Jouni Malinen . 57 | .PP 58 | This manual page was written by Faidon Liambotis , 59 | for the Debian project (but may be used by others). 60 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/ap_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / AP table 3 | * Copyright (c) 2002-2003, Jouni Malinen 4 | * Copyright (c) 2003-2004, Instant802 Networks, Inc. 5 | * Copyright (c) 2006, Devicescape Software, Inc. 6 | * 7 | * This software may be distributed under the terms of the BSD license. 8 | * See README for more details. 9 | */ 10 | 11 | #ifndef AP_LIST_H 12 | #define AP_LIST_H 13 | 14 | struct ap_info { 15 | /* Note: next/prev pointers are updated whenever a new beacon is 16 | * received because these are used to find the least recently used 17 | * entries. */ 18 | struct ap_info *next; /* next entry in AP list */ 19 | struct ap_info *prev; /* previous entry in AP list */ 20 | struct ap_info *hnext; /* next entry in hash table list */ 21 | u8 addr[6]; 22 | u8 supported_rates[WLAN_SUPP_RATES_MAX]; 23 | int erp; /* ERP Info or -1 if ERP info element not present */ 24 | 25 | int channel; 26 | 27 | int ht_support; 28 | 29 | struct os_reltime last_beacon; 30 | }; 31 | 32 | struct ieee802_11_elems; 33 | struct hostapd_frame_info; 34 | 35 | void ap_list_process_beacon(struct hostapd_iface *iface, 36 | const struct ieee80211_mgmt *mgmt, 37 | struct ieee802_11_elems *elems, 38 | struct hostapd_frame_info *fi); 39 | #ifdef NEED_AP_MLME 40 | int ap_list_init(struct hostapd_iface *iface); 41 | void ap_list_deinit(struct hostapd_iface *iface); 42 | void ap_list_timer(struct hostapd_iface *iface); 43 | #else /* NEED_AP_MLME */ 44 | static inline int ap_list_init(struct hostapd_iface *iface) 45 | { 46 | return 0; 47 | } 48 | 49 | static inline void ap_list_deinit(struct hostapd_iface *iface) 50 | { 51 | } 52 | 53 | static inline void ap_list_timer(struct hostapd_iface *iface) 54 | { 55 | } 56 | #endif /* NEED_AP_MLME */ 57 | 58 | #endif /* AP_LIST_H */ 59 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/driver_ndis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WPA Supplicant - Windows/NDIS driver interface 3 | * Copyright (c) 2004-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef DRIVER_NDIS_H 10 | #define DRIVER_NDIS_H 11 | 12 | #ifdef CONFIG_NDIS_EVENTS_INTEGRATED 13 | struct ndis_events_data; 14 | struct ndis_events_data * ndis_events_init(HANDLE *read_pipe, HANDLE *event, 15 | const char *ifname, 16 | const char *desc); 17 | void ndis_events_deinit(struct ndis_events_data *events); 18 | #endif /* CONFIG_NDIS_EVENTS_INTEGRATED */ 19 | 20 | struct ndis_pmkid_entry { 21 | struct ndis_pmkid_entry *next; 22 | u8 bssid[ETH_ALEN]; 23 | u8 pmkid[16]; 24 | }; 25 | 26 | struct wpa_driver_ndis_data { 27 | void *ctx; 28 | char ifname[100]; /* GUID: {7EE3EFE5-C165-472F-986D-F6FBEDFE8C8D} */ 29 | #ifdef _WIN32_WCE 30 | TCHAR *adapter_name; 31 | HANDLE event_queue; /* NDISUIO notifier MsgQueue */ 32 | HANDLE connected_event; /* WpaSupplicantConnected event */ 33 | #endif /* _WIN32_WCE */ 34 | u8 own_addr[ETH_ALEN]; 35 | #ifdef CONFIG_USE_NDISUIO 36 | HANDLE ndisuio; 37 | #else /* CONFIG_USE_NDISUIO */ 38 | LPADAPTER adapter; 39 | #endif /* CONFIG_USE_NDISUIO */ 40 | u8 bssid[ETH_ALEN]; 41 | 42 | int has_capability; 43 | int no_of_pmkid; 44 | int radio_enabled; 45 | struct wpa_driver_capa capa; 46 | struct ndis_pmkid_entry *pmkid; 47 | char *adapter_desc; 48 | int wired; 49 | int native80211; 50 | int mode; 51 | int wzc_disabled; 52 | int oid_bssid_set; 53 | #ifdef CONFIG_NDIS_EVENTS_INTEGRATED 54 | HANDLE events_pipe, event_avail; 55 | struct ndis_events_data *events; 56 | #endif /* CONFIG_NDIS_EVENTS_INTEGRATED */ 57 | }; 58 | 59 | #endif /* DRIVER_NDIS_H */ 60 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/vlan_ifconfig.c: -------------------------------------------------------------------------------- 1 | /* 2 | * hostapd / VLAN ifconfig helpers 3 | * Copyright 2003, Instant802 Networks, Inc. 4 | * Copyright 2005-2006, Devicescape Software, Inc. 5 | * Copyright (c) 2009, Jouni Malinen 6 | * 7 | * This software may be distributed under the terms of the BSD license. 8 | * See README for more details. 9 | */ 10 | 11 | #include "utils/includes.h" 12 | #include 13 | #include 14 | 15 | #include "utils/common.h" 16 | #include "vlan_util.h" 17 | 18 | 19 | int ifconfig_helper(const char *if_name, int up) 20 | { 21 | int fd; 22 | struct ifreq ifr; 23 | 24 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { 25 | wpa_printf(MSG_ERROR, "VLAN: %s: socket(AF_INET,SOCK_STREAM) " 26 | "failed: %s", __func__, strerror(errno)); 27 | return -1; 28 | } 29 | 30 | os_memset(&ifr, 0, sizeof(ifr)); 31 | os_strlcpy(ifr.ifr_name, if_name, IFNAMSIZ); 32 | 33 | if (ioctl(fd, SIOCGIFFLAGS, &ifr) != 0) { 34 | wpa_printf(MSG_ERROR, "VLAN: %s: ioctl(SIOCGIFFLAGS) failed " 35 | "for interface %s: %s", 36 | __func__, if_name, strerror(errno)); 37 | close(fd); 38 | return -1; 39 | } 40 | 41 | if (up) 42 | ifr.ifr_flags |= IFF_UP; 43 | else 44 | ifr.ifr_flags &= ~IFF_UP; 45 | 46 | if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) { 47 | wpa_printf(MSG_ERROR, "VLAN: %s: ioctl(SIOCSIFFLAGS) failed " 48 | "for interface %s (up=%d): %s", 49 | __func__, if_name, up, strerror(errno)); 50 | close(fd); 51 | return -1; 52 | } 53 | 54 | close(fd); 55 | return 0; 56 | } 57 | 58 | 59 | int ifconfig_up(const char *if_name) 60 | { 61 | wpa_printf(MSG_DEBUG, "VLAN: Set interface %s up", if_name); 62 | return ifconfig_helper(if_name, 1); 63 | } 64 | 65 | 66 | int iface_exists(const char *ifname) 67 | { 68 | return if_nametoindex(ifname); 69 | } 70 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/bitfield.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Bitfield 3 | * Copyright (c) 2013, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "bitfield.h" 13 | 14 | 15 | struct bitfield { 16 | u8 *bits; 17 | size_t max_bits; 18 | }; 19 | 20 | 21 | struct bitfield * bitfield_alloc(size_t max_bits) 22 | { 23 | struct bitfield *bf; 24 | 25 | bf = os_zalloc(sizeof(*bf) + (max_bits + 7) / 8); 26 | if (bf == NULL) 27 | return NULL; 28 | bf->bits = (u8 *) (bf + 1); 29 | bf->max_bits = max_bits; 30 | return bf; 31 | } 32 | 33 | 34 | void bitfield_free(struct bitfield *bf) 35 | { 36 | os_free(bf); 37 | } 38 | 39 | 40 | void bitfield_set(struct bitfield *bf, size_t bit) 41 | { 42 | if (bit >= bf->max_bits) 43 | return; 44 | bf->bits[bit / 8] |= BIT(bit % 8); 45 | } 46 | 47 | 48 | void bitfield_clear(struct bitfield *bf, size_t bit) 49 | { 50 | if (bit >= bf->max_bits) 51 | return; 52 | bf->bits[bit / 8] &= ~BIT(bit % 8); 53 | } 54 | 55 | 56 | int bitfield_is_set(struct bitfield *bf, size_t bit) 57 | { 58 | if (bit >= bf->max_bits) 59 | return 0; 60 | return !!(bf->bits[bit / 8] & BIT(bit % 8)); 61 | } 62 | 63 | 64 | static int first_zero(u8 val) 65 | { 66 | int i; 67 | for (i = 0; i < 8; i++) { 68 | if (!(val & 0x01)) 69 | return i; 70 | val >>= 1; 71 | } 72 | return -1; 73 | } 74 | 75 | 76 | int bitfield_get_first_zero(struct bitfield *bf) 77 | { 78 | size_t i; 79 | for (i = 0; i < (bf->max_bits + 7) / 8; i++) { 80 | if (bf->bits[i] != 0xff) 81 | break; 82 | } 83 | if (i == (bf->max_bits + 7) / 8) 84 | return -1; 85 | i = i * 8 + first_zero(bf->bits[i]); 86 | if (i >= bf->max_bits) 87 | return -1; 88 | return i; 89 | } 90 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/pae/ieee802_1x_cp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IEEE Std 802.1X-2010 Controlled Port of PAE state machine - CP state machine 3 | * Copyright (c) 2013, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IEEE802_1X_CP_H 10 | #define IEEE802_1X_CP_H 11 | 12 | #include "common/defs.h" 13 | #include "common/ieee802_1x_defs.h" 14 | 15 | struct ieee802_1x_cp_sm; 16 | struct ieee802_1x_kay; 17 | struct ieee802_1x_mka_ki; 18 | 19 | struct ieee802_1x_cp_sm * ieee802_1x_cp_sm_init(struct ieee802_1x_kay *kay); 20 | void ieee802_1x_cp_sm_deinit(struct ieee802_1x_cp_sm *sm); 21 | void ieee802_1x_cp_sm_step(void *cp_ctx); 22 | void ieee802_1x_cp_connect_pending(void *cp_ctx); 23 | void ieee802_1x_cp_connect_unauthenticated(void *cp_ctx); 24 | void ieee802_1x_cp_connect_authenticated(void *cp_ctx); 25 | void ieee802_1x_cp_connect_secure(void *cp_ctx); 26 | void ieee802_1x_cp_signal_chgdserver(void *cp_ctx); 27 | void ieee802_1x_cp_set_electedself(void *cp_ctx, Boolean status); 28 | void ieee802_1x_cp_set_authorizationdata(void *cp_ctx, u8 *pdata, int len); 29 | void ieee802_1x_cp_set_ciphersuite(void *cp_ctx, u64 cs); 30 | void ieee802_1x_cp_set_offset(void *cp_ctx, enum confidentiality_offset offset); 31 | void ieee802_1x_cp_signal_newsak(void *cp_ctx); 32 | void ieee802_1x_cp_set_distributedki(void *cp_ctx, 33 | const struct ieee802_1x_mka_ki *dki); 34 | void ieee802_1x_cp_set_distributedan(void *cp_ctx, u8 an); 35 | void ieee802_1x_cp_set_usingreceivesas(void *cp_ctx, Boolean status); 36 | void ieee802_1x_cp_set_allreceiving(void *cp_ctx, Boolean status); 37 | void ieee802_1x_cp_set_servertransmitting(void *cp_ctx, Boolean status); 38 | void ieee802_1x_cp_set_usingtransmitas(void *cp_ctx, Boolean status); 39 | 40 | #endif /* IEEE802_1X_CP_H */ 41 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/hostapd/logwatch/hostapd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # 3 | # Logwatch script for hostapd 4 | # 5 | # Copyright 2005 Henrik Brix Andersen 6 | # Distributed under the terms of the GNU General Public License v2 7 | # Alternatively, this file may be distributed under the terms of the BSD License 8 | 9 | use strict; 10 | 11 | my $debug = $ENV{'LOGWATCH_DEBUG'} || 0; 12 | my $detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0; 13 | my $debugcounter = 1; 14 | 15 | my %hostapd; 16 | my @unmatched; 17 | 18 | if ($debug >= 5) { 19 | print STDERR "\n\nDEBUG: Inside HOSTAPD Filter\n\n"; 20 | } 21 | 22 | while (defined(my $line = )) { 23 | if ($debug >= 5) { 24 | print STDERR "DEBUG($debugcounter): $line"; 25 | $debugcounter++; 26 | } 27 | chomp($line); 28 | 29 | if (my ($iface,$mac,$layer,$details) = ($line =~ /(.*?): STA (.*?) (.*?): (.*?)$/i)) { 30 | unless ($detail == 10) { 31 | # collapse association events 32 | $details =~ s/^(associated) .*$/$1/i; 33 | } 34 | $hostapd{$iface}->{$mac}->{$layer}->{$details}++; 35 | } else { 36 | push @unmatched, "$line\n"; 37 | } 38 | } 39 | 40 | if (keys %hostapd) { 41 | foreach my $iface (sort keys %hostapd) { 42 | print "Interface $iface:\n"; 43 | foreach my $mac (sort keys %{$hostapd{$iface}}) { 44 | print " Client MAC Address $mac:\n"; 45 | foreach my $layer (sort keys %{$hostapd{$iface}->{$mac}}) { 46 | print " $layer:\n"; 47 | foreach my $details (sort keys %{$hostapd{$iface}->{$mac}->{$layer}}) { 48 | print " $details"; 49 | my $count = $hostapd{$iface}->{$mac}->{$layer}->{$details}; 50 | if ($count > 1) { 51 | print ": " . $count . " Times"; 52 | } 53 | print "\n"; 54 | } 55 | } 56 | } 57 | } 58 | } 59 | 60 | if ($#unmatched >= 0) { 61 | print "\n**Unmatched Entries**\n"; 62 | print @unmatched; 63 | } 64 | 65 | exit(0); 66 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_psk_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP server/peer: EAP-PSK shared routines 3 | * Copyright (c) 2004-2006, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "crypto/aes_wrap.h" 13 | #include "eap_defs.h" 14 | #include "eap_psk_common.h" 15 | 16 | #define aes_block_size 16 17 | 18 | 19 | int eap_psk_key_setup(const u8 *psk, u8 *ak, u8 *kdk) 20 | { 21 | os_memset(ak, 0, aes_block_size); 22 | if (aes_128_encrypt_block(psk, ak, ak)) 23 | return -1; 24 | os_memcpy(kdk, ak, aes_block_size); 25 | ak[aes_block_size - 1] ^= 0x01; 26 | kdk[aes_block_size - 1] ^= 0x02; 27 | if (aes_128_encrypt_block(psk, ak, ak) || 28 | aes_128_encrypt_block(psk, kdk, kdk)) 29 | return -1; 30 | return 0; 31 | } 32 | 33 | 34 | int eap_psk_derive_keys(const u8 *kdk, const u8 *rand_p, u8 *tek, u8 *msk, 35 | u8 *emsk) 36 | { 37 | u8 hash[aes_block_size]; 38 | u8 counter = 1; 39 | int i; 40 | 41 | if (aes_128_encrypt_block(kdk, rand_p, hash)) 42 | return -1; 43 | 44 | hash[aes_block_size - 1] ^= counter; 45 | if (aes_128_encrypt_block(kdk, hash, tek)) 46 | return -1; 47 | hash[aes_block_size - 1] ^= counter; 48 | counter++; 49 | 50 | for (i = 0; i < EAP_MSK_LEN / aes_block_size; i++) { 51 | hash[aes_block_size - 1] ^= counter; 52 | if (aes_128_encrypt_block(kdk, hash, &msk[i * aes_block_size])) 53 | return -1; 54 | hash[aes_block_size - 1] ^= counter; 55 | counter++; 56 | } 57 | 58 | for (i = 0; i < EAP_EMSK_LEN / aes_block_size; i++) { 59 | hash[aes_block_size - 1] ^= counter; 60 | if (aes_128_encrypt_block(kdk, hash, 61 | &emsk[i * aes_block_size])) 62 | return -1; 63 | hash[aes_block_size - 1] ^= counter; 64 | counter++; 65 | } 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/rsn_supp/wpa_ie.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wpa_supplicant - WPA/RSN IE and KDE definitions 3 | * Copyright (c) 2004-2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef WPA_IE_H 10 | #define WPA_IE_H 11 | 12 | struct wpa_sm; 13 | 14 | struct wpa_eapol_ie_parse { 15 | const u8 *wpa_ie; 16 | size_t wpa_ie_len; 17 | const u8 *rsn_ie; 18 | size_t rsn_ie_len; 19 | const u8 *pmkid; 20 | const u8 *gtk; 21 | size_t gtk_len; 22 | const u8 *mac_addr; 23 | size_t mac_addr_len; 24 | #ifdef CONFIG_PEERKEY 25 | const u8 *smk; 26 | size_t smk_len; 27 | const u8 *nonce; 28 | size_t nonce_len; 29 | const u8 *lifetime; 30 | size_t lifetime_len; 31 | const u8 *error; 32 | size_t error_len; 33 | #endif /* CONFIG_PEERKEY */ 34 | #ifdef CONFIG_IEEE80211W 35 | const u8 *igtk; 36 | size_t igtk_len; 37 | #endif /* CONFIG_IEEE80211W */ 38 | const u8 *mdie; 39 | size_t mdie_len; 40 | const u8 *ftie; 41 | size_t ftie_len; 42 | const u8 *reassoc_deadline; 43 | const u8 *key_lifetime; 44 | const u8 *lnkid; 45 | size_t lnkid_len; 46 | const u8 *ext_capab; 47 | size_t ext_capab_len; 48 | const u8 *supp_rates; 49 | size_t supp_rates_len; 50 | const u8 *ext_supp_rates; 51 | size_t ext_supp_rates_len; 52 | const u8 *ht_capabilities; 53 | const u8 *vht_capabilities; 54 | const u8 *supp_channels; 55 | size_t supp_channels_len; 56 | const u8 *supp_oper_classes; 57 | size_t supp_oper_classes_len; 58 | u8 qosinfo; 59 | u16 aid; 60 | const u8 *wmm; 61 | size_t wmm_len; 62 | #ifdef CONFIG_P2P 63 | const u8 *ip_addr_req; 64 | const u8 *ip_addr_alloc; 65 | #endif /* CONFIG_P2P */ 66 | }; 67 | 68 | int wpa_supplicant_parse_ies(const u8 *buf, size_t len, 69 | struct wpa_eapol_ie_parse *ie); 70 | int wpa_gen_wpa_ie(struct wpa_sm *sm, u8 *wpa_ie, size_t wpa_ie_len); 71 | 72 | #endif /* WPA_IE_H */ 73 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha1-prf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA1-based PRF 3 | * Copyright (c) 2003-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "sha1.h" 13 | #include "crypto.h" 14 | 15 | 16 | /** 17 | * sha1_prf - SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1) 18 | * @key: Key for PRF 19 | * @key_len: Length of the key in bytes 20 | * @label: A unique label for each purpose of the PRF 21 | * @data: Extra data to bind into the key 22 | * @data_len: Length of the data 23 | * @buf: Buffer for the generated pseudo-random key 24 | * @buf_len: Number of bytes of key to generate 25 | * Returns: 0 on success, -1 of failure 26 | * 27 | * This function is used to derive new, cryptographically separate keys from a 28 | * given key (e.g., PMK in IEEE 802.11i). 29 | */ 30 | int sha1_prf(const u8 *key, size_t key_len, const char *label, 31 | const u8 *data, size_t data_len, u8 *buf, size_t buf_len) 32 | { 33 | u8 counter = 0; 34 | size_t pos, plen; 35 | u8 hash[SHA1_MAC_LEN]; 36 | size_t label_len = os_strlen(label) + 1; 37 | const unsigned char *addr[3]; 38 | size_t len[3]; 39 | 40 | addr[0] = (u8 *) label; 41 | len[0] = label_len; 42 | addr[1] = data; 43 | len[1] = data_len; 44 | addr[2] = &counter; 45 | len[2] = 1; 46 | 47 | pos = 0; 48 | while (pos < buf_len) { 49 | plen = buf_len - pos; 50 | if (plen >= SHA1_MAC_LEN) { 51 | if (hmac_sha1_vector(key, key_len, 3, addr, len, 52 | &buf[pos])) 53 | return -1; 54 | pos += SHA1_MAC_LEN; 55 | } else { 56 | if (hmac_sha1_vector(key, key_len, 3, addr, len, 57 | hash)) 58 | return -1; 59 | os_memcpy(&buf[pos], hash, plen); 60 | break; 61 | } 62 | counter++; 63 | } 64 | os_memset(hash, 0, sizeof(hash)); 65 | 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_ttls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP server/peer: EAP-TTLS (RFC 5281) 3 | * Copyright (c) 2004-2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_TTLS_H 10 | #define EAP_TTLS_H 11 | 12 | struct ttls_avp { 13 | be32 avp_code; 14 | be32 avp_length; /* 8-bit flags, 24-bit length; 15 | * length includes AVP header */ 16 | /* optional 32-bit Vendor-ID */ 17 | /* Data */ 18 | }; 19 | 20 | struct ttls_avp_vendor { 21 | be32 avp_code; 22 | be32 avp_length; /* 8-bit flags, 24-bit length; 23 | * length includes AVP header */ 24 | be32 vendor_id; 25 | /* Data */ 26 | }; 27 | 28 | #define AVP_FLAGS_VENDOR 0x80 29 | #define AVP_FLAGS_MANDATORY 0x40 30 | 31 | #define AVP_PAD(start, pos) \ 32 | do { \ 33 | int __pad; \ 34 | __pad = (4 - (((pos) - (start)) & 3)) & 3; \ 35 | os_memset((pos), 0, __pad); \ 36 | pos += __pad; \ 37 | } while (0) 38 | 39 | 40 | /* RFC 2865 */ 41 | #define RADIUS_ATTR_USER_NAME 1 42 | #define RADIUS_ATTR_USER_PASSWORD 2 43 | #define RADIUS_ATTR_CHAP_PASSWORD 3 44 | #define RADIUS_ATTR_REPLY_MESSAGE 18 45 | #define RADIUS_ATTR_CHAP_CHALLENGE 60 46 | #define RADIUS_ATTR_EAP_MESSAGE 79 47 | 48 | /* RFC 2548 */ 49 | #define RADIUS_VENDOR_ID_MICROSOFT 311 50 | #define RADIUS_ATTR_MS_CHAP_RESPONSE 1 51 | #define RADIUS_ATTR_MS_CHAP_ERROR 2 52 | #define RADIUS_ATTR_MS_CHAP_NT_ENC_PW 6 53 | #define RADIUS_ATTR_MS_CHAP_CHALLENGE 11 54 | #define RADIUS_ATTR_MS_CHAP2_RESPONSE 25 55 | #define RADIUS_ATTR_MS_CHAP2_SUCCESS 26 56 | #define RADIUS_ATTR_MS_CHAP2_CPW 27 57 | 58 | #define EAP_TTLS_MSCHAPV2_CHALLENGE_LEN 16 59 | #define EAP_TTLS_MSCHAPV2_RESPONSE_LEN 50 60 | #define EAP_TTLS_MSCHAP_CHALLENGE_LEN 8 61 | #define EAP_TTLS_MSCHAP_RESPONSE_LEN 50 62 | #define EAP_TTLS_CHAP_CHALLENGE_LEN 16 63 | #define EAP_TTLS_CHAP_PASSWORD_LEN 16 64 | 65 | #endif /* EAP_TTLS_H */ 66 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/ap/bss_load.c: -------------------------------------------------------------------------------- 1 | /* 2 | * BSS Load Element / Channel Utilization 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "utils/includes.h" 10 | 11 | #include "utils/common.h" 12 | #include "utils/eloop.h" 13 | #include "hostapd.h" 14 | #include "bss_load.h" 15 | #include "ap_drv_ops.h" 16 | #include "beacon.h" 17 | 18 | 19 | static void update_channel_utilization(void *eloop_data, void *user_data) 20 | { 21 | struct hostapd_data *hapd = eloop_data; 22 | unsigned int sec, usec; 23 | int err; 24 | 25 | if (!(hapd->beacon_set_done && hapd->started)) 26 | return; 27 | 28 | err = hostapd_drv_get_survey(hapd, hapd->iface->freq); 29 | if (err) { 30 | wpa_printf(MSG_ERROR, "BSS Load: Failed to get survey data"); 31 | return; 32 | } 33 | 34 | ieee802_11_set_beacon(hapd); 35 | 36 | sec = ((hapd->bss_load_update_timeout / 1000) * 1024) / 1000; 37 | usec = (hapd->bss_load_update_timeout % 1000) * 1024; 38 | eloop_register_timeout(sec, usec, update_channel_utilization, hapd, 39 | NULL); 40 | } 41 | 42 | 43 | int bss_load_update_init(struct hostapd_data *hapd) 44 | { 45 | struct hostapd_bss_config *conf = hapd->conf; 46 | struct hostapd_config *iconf = hapd->iconf; 47 | unsigned int sec, usec; 48 | 49 | if (!conf->bss_load_update_period || !iconf->beacon_int) 50 | return -1; 51 | 52 | hapd->bss_load_update_timeout = conf->bss_load_update_period * 53 | iconf->beacon_int; 54 | sec = ((hapd->bss_load_update_timeout / 1000) * 1024) / 1000; 55 | usec = (hapd->bss_load_update_timeout % 1000) * 1024; 56 | eloop_register_timeout(sec, usec, update_channel_utilization, hapd, 57 | NULL); 58 | return 0; 59 | } 60 | 61 | 62 | void bss_load_update_deinit(struct hostapd_data *hapd) 63 | { 64 | eloop_cancel_timeout(update_channel_utilization, hapd, NULL); 65 | } 66 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/wps/wps_dev_attr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Wi-Fi Protected Setup - device attributes 3 | * Copyright (c) 2008, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef WPS_DEV_ATTR_H 10 | #define WPS_DEV_ATTR_H 11 | 12 | struct wps_parse_attr; 13 | 14 | int wps_build_manufacturer(struct wps_device_data *dev, struct wpabuf *msg); 15 | int wps_build_model_name(struct wps_device_data *dev, struct wpabuf *msg); 16 | int wps_build_model_number(struct wps_device_data *dev, struct wpabuf *msg); 17 | int wps_build_serial_number(struct wps_device_data *dev, struct wpabuf *msg); 18 | int wps_build_dev_name(struct wps_device_data *dev, struct wpabuf *msg); 19 | int wps_build_device_attrs(struct wps_device_data *dev, struct wpabuf *msg); 20 | int wps_build_os_version(struct wps_device_data *dev, struct wpabuf *msg); 21 | int wps_build_vendor_ext_m1(struct wps_device_data *dev, struct wpabuf *msg); 22 | int wps_build_rf_bands(struct wps_device_data *dev, struct wpabuf *msg, 23 | u8 rf_band); 24 | int wps_build_primary_dev_type(struct wps_device_data *dev, 25 | struct wpabuf *msg); 26 | int wps_build_secondary_dev_type(struct wps_device_data *dev, 27 | struct wpabuf *msg); 28 | int wps_build_dev_name(struct wps_device_data *dev, struct wpabuf *msg); 29 | int wps_process_device_attrs(struct wps_device_data *dev, 30 | struct wps_parse_attr *attr); 31 | int wps_process_os_version(struct wps_device_data *dev, const u8 *ver); 32 | int wps_process_rf_bands(struct wps_device_data *dev, const u8 *bands); 33 | void wps_device_data_free(struct wps_device_data *dev); 34 | int wps_build_vendor_ext(struct wps_device_data *dev, struct wpabuf *msg); 35 | int wps_build_req_dev_type(struct wps_device_data *dev, struct wpabuf *msg, 36 | unsigned int num_req_dev_types, 37 | const u8 *req_dev_types); 38 | 39 | #endif /* WPS_DEV_ATTR_H */ 40 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_server/eap_methods.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP server method registration 3 | * Copyright (c) 2004-2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_SERVER_METHODS_H 10 | #define EAP_SERVER_METHODS_H 11 | 12 | #include "eap_common/eap_defs.h" 13 | 14 | const struct eap_method * eap_server_get_eap_method(int vendor, 15 | EapType method); 16 | struct eap_method * eap_server_method_alloc(int version, int vendor, 17 | EapType method, const char *name); 18 | int eap_server_method_register(struct eap_method *method); 19 | 20 | EapType eap_server_get_type(const char *name, int *vendor); 21 | void eap_server_unregister_methods(void); 22 | const char * eap_server_get_name(int vendor, EapType type); 23 | 24 | /* EAP server method registration calls for statically linked in methods */ 25 | int eap_server_identity_register(void); 26 | int eap_server_md5_register(void); 27 | int eap_server_tls_register(void); 28 | int eap_server_unauth_tls_register(void); 29 | int eap_server_wfa_unauth_tls_register(void); 30 | int eap_server_mschapv2_register(void); 31 | int eap_server_peap_register(void); 32 | int eap_server_tlv_register(void); 33 | int eap_server_gtc_register(void); 34 | int eap_server_ttls_register(void); 35 | int eap_server_sim_register(void); 36 | int eap_server_aka_register(void); 37 | int eap_server_aka_prime_register(void); 38 | int eap_server_pax_register(void); 39 | int eap_server_psk_register(void); 40 | int eap_server_sake_register(void); 41 | int eap_server_gpsk_register(void); 42 | int eap_server_vendor_test_register(void); 43 | int eap_server_fast_register(void); 44 | int eap_server_wsc_register(void); 45 | int eap_server_ikev2_register(void); 46 | int eap_server_tnc_register(void); 47 | int eap_server_pwd_register(void); 48 | int eap_server_eke_register(void); 49 | 50 | #endif /* EAP_SERVER_METHODS_H */ 51 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module for setup hostapd shared library 3 | """ 4 | 5 | import shutil 6 | try: 7 | from setuptools import setup 8 | from setuptools.command.install import install 9 | except ImportError: 10 | from distutils.core import setup 11 | from distutils.command.install import install 12 | from distutils.command.build_ext import build_ext 13 | import roguehostapd.buildutil.buildcommon as buildcommon 14 | import roguehostapd.buildutil.buildexception as buildexception 15 | from roguehostapd.config.hostapdconfig import WHITE, RED 16 | 17 | # define project information 18 | NAME = 'roguehostapd' 19 | PACKAGES = [ 20 | 'roguehostapd', 21 | 'examples', 22 | 'roguehostapd.config', 23 | 'roguehostapd.buildutil' 24 | ] 25 | PACKAGE_DIR = {'roguehostapd': 'roguehostapd'} 26 | PACKAGE_DATA = {'roguehostapd': ['config/hostapd.conf', 'config/config.ini']} 27 | VERSION = '1.1.2' 28 | DESCRIPTION = 'Hostapd wrapper for hostapd' 29 | URL = 'https://github.com/wifiphisher/roguehostapd' 30 | AUTHOR = 'Anakin' 31 | 32 | try: 33 | EXT_MODULE = buildcommon.get_extension_module() 34 | setup( 35 | name=NAME, 36 | packages=PACKAGES, 37 | package_dir=PACKAGE_DIR, 38 | package_data=PACKAGE_DATA, 39 | version=VERSION, 40 | description=DESCRIPTION, 41 | url=URL, 42 | author=AUTHOR, 43 | install_requires=[], 44 | zip_safe=False, 45 | cmdclass={ 46 | 'build_ext': build_ext, 47 | 'install': install 48 | }, 49 | ext_modules=EXT_MODULE) 50 | except buildexception.SharedLibMissError as exobj: 51 | print("[" + RED + "!" + WHITE + "] " + 52 | ("The development package for " + exobj.libname + 53 | " is missing. Please download it and restart the compilation." 54 | "If you are on Debian-based system: \'apt-get install{}\'.".format( 55 | "".join(" " + package for package in exobj.packages)))) 56 | finally: 57 | shutil.rmtree('tmp') 58 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/aes-wrap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * AES Key Wrap Algorithm (RFC3394) 3 | * 4 | * Copyright (c) 2003-2007, Jouni Malinen 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #include "includes.h" 11 | 12 | #include "common.h" 13 | #include "aes.h" 14 | #include "aes_wrap.h" 15 | 16 | /** 17 | * aes_wrap - Wrap keys with AES Key Wrap Algorithm (RFC3394) 18 | * @kek: Key encryption key (KEK) 19 | * @kek_len: Length of KEK in octets 20 | * @n: Length of the plaintext key in 64-bit units; e.g., 2 = 128-bit = 16 21 | * bytes 22 | * @plain: Plaintext key to be wrapped, n * 64 bits 23 | * @cipher: Wrapped key, (n + 1) * 64 bits 24 | * Returns: 0 on success, -1 on failure 25 | */ 26 | int aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain, u8 *cipher) 27 | { 28 | u8 *a, *r, b[AES_BLOCK_SIZE]; 29 | int i, j; 30 | void *ctx; 31 | unsigned int t; 32 | 33 | a = cipher; 34 | r = cipher + 8; 35 | 36 | /* 1) Initialize variables. */ 37 | os_memset(a, 0xa6, 8); 38 | os_memcpy(r, plain, 8 * n); 39 | 40 | ctx = aes_encrypt_init(kek, kek_len); 41 | if (ctx == NULL) 42 | return -1; 43 | 44 | /* 2) Calculate intermediate values. 45 | * For j = 0 to 5 46 | * For i=1 to n 47 | * B = AES(K, A | R[i]) 48 | * A = MSB(64, B) ^ t where t = (n*j)+i 49 | * R[i] = LSB(64, B) 50 | */ 51 | for (j = 0; j <= 5; j++) { 52 | r = cipher + 8; 53 | for (i = 1; i <= n; i++) { 54 | os_memcpy(b, a, 8); 55 | os_memcpy(b + 8, r, 8); 56 | aes_encrypt(ctx, b, b); 57 | os_memcpy(a, b, 8); 58 | t = n * j + i; 59 | a[7] ^= t; 60 | a[6] ^= t >> 8; 61 | a[5] ^= t >> 16; 62 | a[4] ^= t >> 24; 63 | os_memcpy(r, b + 8, 8); 64 | r += 8; 65 | } 66 | } 67 | aes_encrypt_deinit(ctx); 68 | 69 | /* 3) Output the results. 70 | * 71 | * These are already in @cipher due to the location of temporary 72 | * variables. 73 | */ 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/http-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HTTP wrapper 3 | * Copyright (c) 2012-2013, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef HTTP_UTILS_H 10 | #define HTTP_UTILS_H 11 | 12 | struct http_ctx; 13 | 14 | struct http_othername { 15 | char *oid; 16 | u8 *data; 17 | size_t len; 18 | }; 19 | 20 | #define HTTP_MAX_CERT_LOGO_HASH 32 21 | 22 | struct http_logo { 23 | char *alg_oid; 24 | u8 *hash; 25 | size_t hash_len; 26 | char *uri; 27 | }; 28 | 29 | struct http_cert { 30 | char **dnsname; 31 | unsigned int num_dnsname; 32 | struct http_othername *othername; 33 | unsigned int num_othername; 34 | struct http_logo *logo; 35 | unsigned int num_logo; 36 | }; 37 | 38 | int soap_init_client(struct http_ctx *ctx, const char *address, 39 | const char *ca_fname, const char *username, 40 | const char *password, const char *client_cert, 41 | const char *client_key); 42 | int soap_reinit_client(struct http_ctx *ctx); 43 | xml_node_t * soap_send_receive(struct http_ctx *ctx, xml_node_t *node); 44 | 45 | struct http_ctx * http_init_ctx(void *upper_ctx, struct xml_node_ctx *xml_ctx); 46 | void http_ocsp_set(struct http_ctx *ctx, int val); 47 | void http_deinit_ctx(struct http_ctx *ctx); 48 | 49 | int http_download_file(struct http_ctx *ctx, const char *url, 50 | const char *fname, const char *ca_fname); 51 | char * http_post(struct http_ctx *ctx, const char *url, const char *data, 52 | const char *content_type, const char *ext_hdr, 53 | const char *ca_fname, 54 | const char *username, const char *password, 55 | const char *client_cert, const char *client_key, 56 | size_t *resp_len); 57 | void http_set_cert_cb(struct http_ctx *ctx, 58 | int (*cb)(void *ctx, struct http_cert *cert), 59 | void *cb_ctx); 60 | const char * http_get_err(struct http_ctx *ctx); 61 | void http_parse_x509_certificate(struct http_ctx *ctx, const char *fname); 62 | 63 | #endif /* HTTP_UTILS_H */ 64 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/drivers/driver_none.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Driver interface for RADIUS server or WPS ER only (no driver) 3 | * Copyright (c) 2008, Atheros Communications 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "driver.h" 13 | 14 | 15 | struct none_driver_data { 16 | struct hostapd_data *hapd; 17 | void *ctx; 18 | }; 19 | 20 | 21 | static void * none_driver_hapd_init(struct hostapd_data *hapd, 22 | struct wpa_init_params *params) 23 | { 24 | struct none_driver_data *drv; 25 | 26 | drv = os_zalloc(sizeof(struct none_driver_data)); 27 | if (drv == NULL) { 28 | wpa_printf(MSG_ERROR, "Could not allocate memory for none " 29 | "driver data"); 30 | return NULL; 31 | } 32 | drv->hapd = hapd; 33 | 34 | return drv; 35 | } 36 | 37 | 38 | static void none_driver_hapd_deinit(void *priv) 39 | { 40 | struct none_driver_data *drv = priv; 41 | 42 | os_free(drv); 43 | } 44 | 45 | 46 | static int none_driver_send_ether(void *priv, const u8 *dst, const u8 *src, 47 | u16 proto, const u8 *data, size_t data_len) 48 | { 49 | return 0; 50 | } 51 | 52 | 53 | static void * none_driver_init(void *ctx, const char *ifname) 54 | { 55 | struct none_driver_data *drv; 56 | 57 | drv = os_zalloc(sizeof(struct none_driver_data)); 58 | if (drv == NULL) { 59 | wpa_printf(MSG_ERROR, "Could not allocate memory for none " 60 | "driver data"); 61 | return NULL; 62 | } 63 | drv->ctx = ctx; 64 | 65 | return drv; 66 | } 67 | 68 | 69 | static void none_driver_deinit(void *priv) 70 | { 71 | struct none_driver_data *drv = priv; 72 | 73 | os_free(drv); 74 | } 75 | 76 | 77 | const struct wpa_driver_ops wpa_driver_none_ops = { 78 | .name = "none", 79 | .desc = "no driver (RADIUS server/WPS ER)", 80 | .hapd_init = none_driver_hapd_init, 81 | .hapd_deinit = none_driver_hapd_deinit, 82 | .send_ether = none_driver_send_ether, 83 | .init = none_driver_init, 84 | .deinit = none_driver_deinit, 85 | }; 86 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha256-tlsprf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * TLS PRF P_SHA256 3 | * Copyright (c) 2011, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "sha256.h" 13 | 14 | 15 | /** 16 | * tls_prf_sha256 - Pseudo-Random Function for TLS v1.2 (P_SHA256, RFC 5246) 17 | * @secret: Key for PRF 18 | * @secret_len: Length of the key in bytes 19 | * @label: A unique label for each purpose of the PRF 20 | * @seed: Seed value to bind into the key 21 | * @seed_len: Length of the seed 22 | * @out: Buffer for the generated pseudo-random key 23 | * @outlen: Number of bytes of key to generate 24 | * Returns: 0 on success, -1 on failure. 25 | * 26 | * This function is used to derive new, cryptographically separate keys from a 27 | * given key in TLS. This PRF is defined in RFC 2246, Chapter 5. 28 | */ 29 | void tls_prf_sha256(const u8 *secret, size_t secret_len, const char *label, 30 | const u8 *seed, size_t seed_len, u8 *out, size_t outlen) 31 | { 32 | size_t clen; 33 | u8 A[SHA256_MAC_LEN]; 34 | u8 P[SHA256_MAC_LEN]; 35 | size_t pos; 36 | const unsigned char *addr[3]; 37 | size_t len[3]; 38 | 39 | addr[0] = A; 40 | len[0] = SHA256_MAC_LEN; 41 | addr[1] = (unsigned char *) label; 42 | len[1] = os_strlen(label); 43 | addr[2] = seed; 44 | len[2] = seed_len; 45 | 46 | /* 47 | * RFC 5246, Chapter 5 48 | * A(0) = seed, A(i) = HMAC(secret, A(i-1)) 49 | * P_hash = HMAC(secret, A(1) + seed) + HMAC(secret, A(2) + seed) + .. 50 | * PRF(secret, label, seed) = P_SHA256(secret, label + seed) 51 | */ 52 | 53 | hmac_sha256_vector(secret, secret_len, 2, &addr[1], &len[1], A); 54 | 55 | pos = 0; 56 | while (pos < outlen) { 57 | hmac_sha256_vector(secret, secret_len, 3, addr, len, P); 58 | hmac_sha256(secret, secret_len, A, SHA256_MAC_LEN, A); 59 | 60 | clen = outlen - pos; 61 | if (clen > SHA256_MAC_LEN) 62 | clen = SHA256_MAC_LEN; 63 | os_memcpy(out + pos, P, clen); 64 | pos += clen; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_psk_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP server/peer: EAP-PSK shared routines 3 | * Copyright (c) 2004-2007, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef EAP_PSK_COMMON_H 10 | #define EAP_PSK_COMMON_H 11 | 12 | 13 | #define EAP_PSK_RAND_LEN 16 14 | #define EAP_PSK_MAC_LEN 16 15 | #define EAP_PSK_TEK_LEN 16 16 | #define EAP_PSK_PSK_LEN 16 17 | #define EAP_PSK_AK_LEN 16 18 | #define EAP_PSK_KDK_LEN 16 19 | 20 | #define EAP_PSK_R_FLAG_CONT 1 21 | #define EAP_PSK_R_FLAG_DONE_SUCCESS 2 22 | #define EAP_PSK_R_FLAG_DONE_FAILURE 3 23 | #define EAP_PSK_E_FLAG 0x20 24 | 25 | #define EAP_PSK_FLAGS_GET_T(flags) (((flags) & 0xc0) >> 6) 26 | #define EAP_PSK_FLAGS_SET_T(t) ((u8) (t) << 6) 27 | 28 | #ifdef _MSC_VER 29 | #pragma pack(push, 1) 30 | #endif /* _MSC_VER */ 31 | 32 | /* EAP-PSK First Message (AS -> Supplicant) */ 33 | struct eap_psk_hdr_1 { 34 | u8 flags; 35 | u8 rand_s[EAP_PSK_RAND_LEN]; 36 | /* Followed by variable length ID_S */ 37 | } STRUCT_PACKED; 38 | 39 | /* EAP-PSK Second Message (Supplicant -> AS) */ 40 | struct eap_psk_hdr_2 { 41 | u8 flags; 42 | u8 rand_s[EAP_PSK_RAND_LEN]; 43 | u8 rand_p[EAP_PSK_RAND_LEN]; 44 | u8 mac_p[EAP_PSK_MAC_LEN]; 45 | /* Followed by variable length ID_P */ 46 | } STRUCT_PACKED; 47 | 48 | /* EAP-PSK Third Message (AS -> Supplicant) */ 49 | struct eap_psk_hdr_3 { 50 | u8 flags; 51 | u8 rand_s[EAP_PSK_RAND_LEN]; 52 | u8 mac_s[EAP_PSK_MAC_LEN]; 53 | /* Followed by variable length PCHANNEL */ 54 | } STRUCT_PACKED; 55 | 56 | /* EAP-PSK Fourth Message (Supplicant -> AS) */ 57 | struct eap_psk_hdr_4 { 58 | u8 flags; 59 | u8 rand_s[EAP_PSK_RAND_LEN]; 60 | /* Followed by variable length PCHANNEL */ 61 | } STRUCT_PACKED; 62 | 63 | #ifdef _MSC_VER 64 | #pragma pack(pop) 65 | #endif /* _MSC_VER */ 66 | 67 | 68 | int __must_check eap_psk_key_setup(const u8 *psk, u8 *ak, u8 *kdk); 69 | int __must_check eap_psk_derive_keys(const u8 *kdk, const u8 *rand_p, u8 *tek, 70 | u8 *msk, u8 *emsk); 71 | 72 | #endif /* EAP_PSK_COMMON_H */ 73 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/common/ieee802_1x_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IEEE Std 802.1X-2010 definitions 3 | * Copyright (c) 2013-2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef IEEE802_1X_DEFS_H 10 | #define IEEE802_1X_DEFS_H 11 | 12 | #define CS_ID_LEN 8 13 | #define CS_ID_GCM_AES_128 0x0080020001000001ULL 14 | #define CS_NAME_GCM_AES_128 "GCM-AES-128" 15 | 16 | enum macsec_policy { 17 | /** 18 | * Should secure sessions. 19 | * This accepts key server's advice to determine whether to secure the 20 | * session or not. 21 | */ 22 | SHOULD_SECURE, 23 | 24 | /** 25 | * Disabled MACsec - do not secure sessions. 26 | */ 27 | DO_NOT_SECURE, 28 | }; 29 | 30 | 31 | /* IEEE Std 802.1X-2010 - Table 11-6 - MACsec Capability */ 32 | enum macsec_cap { 33 | /** 34 | * MACsec is not implemented 35 | */ 36 | MACSEC_CAP_NOT_IMPLEMENTED, 37 | 38 | /** 39 | * 'Integrity without confidentiality' 40 | */ 41 | MACSEC_CAP_INTEGRITY, 42 | 43 | /** 44 | * 'Integrity without confidentiality' and 45 | * 'Integrity and confidentiality' with a confidentiality offset of 0 46 | */ 47 | MACSEC_CAP_INTEG_AND_CONF, 48 | 49 | /** 50 | * 'Integrity without confidentiality' and 51 | * 'Integrity and confidentiality' with a confidentiality offset of 0, 52 | * 30, 50 53 | */ 54 | MACSEC_CAP_INTEG_AND_CONF_0_30_50, 55 | }; 56 | 57 | enum validate_frames { 58 | Disabled, 59 | Checked, 60 | Strict, 61 | }; 62 | 63 | /* IEEE Std 802.1X-2010 - Table 11-6 - Confidentiality Offset */ 64 | enum confidentiality_offset { 65 | CONFIDENTIALITY_NONE = 0, 66 | CONFIDENTIALITY_OFFSET_0 = 1, 67 | CONFIDENTIALITY_OFFSET_30 = 2, 68 | CONFIDENTIALITY_OFFSET_50 = 3, 69 | }; 70 | 71 | /* IEEE Std 802.1X-2010 - Table 9-2 */ 72 | #define DEFAULT_PRIO_INFRA_PORT 0x10 73 | #define DEFAULT_PRIO_PRIMRAY_AP 0x30 74 | #define DEFAULT_PRIO_SECONDARY_AP 0x50 75 | #define DEFAULT_PRIO_GROUP_CA_MEMBER 0x70 76 | #define DEFAULT_PRIO_NOT_KEY_SERVER 0xFF 77 | 78 | #endif /* IEEE802_1X_DEFS_H */ 79 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha1-tprf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SHA1 T-PRF for EAP-FAST 3 | * Copyright (c) 2003-2005, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "sha1.h" 13 | #include "crypto.h" 14 | 15 | /** 16 | * sha1_t_prf - EAP-FAST Pseudo-Random Function (T-PRF) 17 | * @key: Key for PRF 18 | * @key_len: Length of the key in bytes 19 | * @label: A unique label for each purpose of the PRF 20 | * @seed: Seed value to bind into the key 21 | * @seed_len: Length of the seed 22 | * @buf: Buffer for the generated pseudo-random key 23 | * @buf_len: Number of bytes of key to generate 24 | * Returns: 0 on success, -1 of failure 25 | * 26 | * This function is used to derive new, cryptographically separate keys from a 27 | * given key for EAP-FAST. T-PRF is defined in RFC 4851, Section 5.5. 28 | */ 29 | int sha1_t_prf(const u8 *key, size_t key_len, const char *label, 30 | const u8 *seed, size_t seed_len, u8 *buf, size_t buf_len) 31 | { 32 | unsigned char counter = 0; 33 | size_t pos, plen; 34 | u8 hash[SHA1_MAC_LEN]; 35 | size_t label_len = os_strlen(label); 36 | u8 output_len[2]; 37 | const unsigned char *addr[5]; 38 | size_t len[5]; 39 | 40 | addr[0] = hash; 41 | len[0] = 0; 42 | addr[1] = (unsigned char *) label; 43 | len[1] = label_len + 1; 44 | addr[2] = seed; 45 | len[2] = seed_len; 46 | addr[3] = output_len; 47 | len[3] = 2; 48 | addr[4] = &counter; 49 | len[4] = 1; 50 | 51 | output_len[0] = (buf_len >> 8) & 0xff; 52 | output_len[1] = buf_len & 0xff; 53 | pos = 0; 54 | while (pos < buf_len) { 55 | counter++; 56 | plen = buf_len - pos; 57 | if (hmac_sha1_vector(key, key_len, 5, addr, len, hash)) 58 | return -1; 59 | if (plen >= SHA1_MAC_LEN) { 60 | os_memcpy(&buf[pos], hash, SHA1_MAC_LEN); 61 | pos += SHA1_MAC_LEN; 62 | } else { 63 | os_memcpy(&buf[pos], hash, plen); 64 | break; 65 | } 66 | len[0] = SHA1_MAC_LEN; 67 | } 68 | 69 | os_memset(hash, 0, SHA1_MAC_LEN); 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/fst/fst_iface.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FST module - FST interface object implementation 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "utils/includes.h" 10 | #include "utils/common.h" 11 | #include "fst/fst_internal.h" 12 | #include "fst/fst_defs.h" 13 | 14 | 15 | struct fst_iface * fst_iface_create(struct fst_group *g, const char *ifname, 16 | const u8 *own_addr, 17 | const struct fst_wpa_obj *iface_obj, 18 | const struct fst_iface_cfg *cfg) 19 | { 20 | struct fst_iface *i; 21 | 22 | i = os_zalloc(sizeof(*i)); 23 | if (!i) { 24 | fst_printf_group(g, MSG_ERROR, "cannot allocate iface for %s", 25 | ifname); 26 | return NULL; 27 | } 28 | 29 | i->cfg = *cfg; 30 | i->iface_obj = *iface_obj; 31 | i->group = g; 32 | os_strlcpy(i->ifname, ifname, sizeof(i->ifname)); 33 | os_memcpy(i->own_addr, own_addr, sizeof(i->own_addr)); 34 | 35 | if (!i->cfg.llt) { 36 | fst_printf_iface(i, MSG_WARNING, "Zero llt adjusted"); 37 | i->cfg.llt = FST_DEFAULT_LLT_CFG_VALUE; 38 | } 39 | 40 | return i; 41 | } 42 | 43 | 44 | void fst_iface_delete(struct fst_iface *i) 45 | { 46 | fst_iface_set_ies(i, NULL); 47 | wpabuf_free(i->mb_ie); 48 | os_free(i); 49 | } 50 | 51 | 52 | Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr, 53 | Boolean mb_only) 54 | { 55 | struct fst_get_peer_ctx *ctx; 56 | const u8 *a = fst_iface_get_peer_first(iface, &ctx, mb_only); 57 | 58 | for (; a != NULL; a = fst_iface_get_peer_next(iface, &ctx, mb_only)) 59 | if (os_memcmp(addr, a, ETH_ALEN) == 0) 60 | return TRUE; 61 | 62 | return FALSE; 63 | } 64 | 65 | 66 | void fst_iface_attach_mbie(struct fst_iface *i, struct wpabuf *mbie) 67 | { 68 | wpabuf_free(i->mb_ie); 69 | i->mb_ie = mbie; 70 | } 71 | 72 | 73 | enum mb_band_id fst_iface_get_band_id(struct fst_iface *i) 74 | { 75 | enum hostapd_hw_mode hw_mode; 76 | u8 channel; 77 | 78 | fst_iface_get_channel_info(i, &hw_mode, &channel); 79 | return fst_hw_mode_to_band(hw_mode); 80 | } 81 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/ext_password_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * External password backend 3 | * Copyright (c) 2012, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "ext_password_i.h" 13 | 14 | 15 | struct ext_password_test_data { 16 | char *params; 17 | }; 18 | 19 | 20 | static void * ext_password_test_init(const char *params) 21 | { 22 | struct ext_password_test_data *data; 23 | 24 | data = os_zalloc(sizeof(*data)); 25 | if (data == NULL) 26 | return NULL; 27 | 28 | if (params) 29 | data->params = os_strdup(params); 30 | 31 | return data; 32 | } 33 | 34 | 35 | static void ext_password_test_deinit(void *ctx) 36 | { 37 | struct ext_password_test_data *data = ctx; 38 | 39 | str_clear_free(data->params); 40 | os_free(data); 41 | } 42 | 43 | 44 | static struct wpabuf * ext_password_test_get(void *ctx, const char *name) 45 | { 46 | struct ext_password_test_data *data = ctx; 47 | char *pos, *pos2; 48 | size_t nlen; 49 | 50 | wpa_printf(MSG_DEBUG, "EXT PW TEST: get(%s)", name); 51 | 52 | pos = data->params; 53 | if (pos == NULL) 54 | return NULL; 55 | nlen = os_strlen(name); 56 | 57 | while (pos && *pos) { 58 | if (os_strncmp(pos, name, nlen) == 0 && pos[nlen] == '=') { 59 | struct wpabuf *buf; 60 | pos += nlen + 1; 61 | pos2 = pos; 62 | while (*pos2 != '|' && *pos2 != '\0') 63 | pos2++; 64 | buf = ext_password_alloc(pos2 - pos); 65 | if (buf == NULL) 66 | return NULL; 67 | wpabuf_put_data(buf, pos, pos2 - pos); 68 | wpa_hexdump_ascii_key(MSG_DEBUG, "EXT PW TEST: value", 69 | wpabuf_head(buf), 70 | wpabuf_len(buf)); 71 | return buf; 72 | } 73 | 74 | pos = os_strchr(pos + 1, '|'); 75 | if (pos) 76 | pos++; 77 | } 78 | 79 | wpa_printf(MSG_DEBUG, "EXT PW TEST: get(%s) - not found", name); 80 | 81 | return NULL; 82 | } 83 | 84 | 85 | const struct ext_password_backend ext_password_test = { 86 | .name = "test", 87 | .init = ext_password_test_init, 88 | .deinit = ext_password_test_deinit, 89 | .get = ext_password_test_get, 90 | }; 91 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/aes-unwrap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * AES key unwrap (RFC3394) 3 | * 4 | * Copyright (c) 2003-2007, Jouni Malinen 5 | * 6 | * This software may be distributed under the terms of the BSD license. 7 | * See README for more details. 8 | */ 9 | 10 | #include "includes.h" 11 | 12 | #include "common.h" 13 | #include "aes.h" 14 | #include "aes_wrap.h" 15 | 16 | /** 17 | * aes_unwrap - Unwrap key with AES Key Wrap Algorithm (RFC3394) 18 | * @kek: Key encryption key (KEK) 19 | * @kek_len: Length of KEK in octets 20 | * @n: Length of the plaintext key in 64-bit units; e.g., 2 = 128-bit = 16 21 | * bytes 22 | * @cipher: Wrapped key to be unwrapped, (n + 1) * 64 bits 23 | * @plain: Plaintext key, n * 64 bits 24 | * Returns: 0 on success, -1 on failure (e.g., integrity verification failed) 25 | */ 26 | int aes_unwrap(const u8 *kek, size_t kek_len, int n, const u8 *cipher, 27 | u8 *plain) 28 | { 29 | u8 a[8], *r, b[AES_BLOCK_SIZE]; 30 | int i, j; 31 | void *ctx; 32 | unsigned int t; 33 | 34 | /* 1) Initialize variables. */ 35 | os_memcpy(a, cipher, 8); 36 | r = plain; 37 | os_memcpy(r, cipher + 8, 8 * n); 38 | 39 | ctx = aes_decrypt_init(kek, kek_len); 40 | if (ctx == NULL) 41 | return -1; 42 | 43 | /* 2) Compute intermediate values. 44 | * For j = 5 to 0 45 | * For i = n to 1 46 | * B = AES-1(K, (A ^ t) | R[i]) where t = n*j+i 47 | * A = MSB(64, B) 48 | * R[i] = LSB(64, B) 49 | */ 50 | for (j = 5; j >= 0; j--) { 51 | r = plain + (n - 1) * 8; 52 | for (i = n; i >= 1; i--) { 53 | os_memcpy(b, a, 8); 54 | t = n * j + i; 55 | b[7] ^= t; 56 | b[6] ^= t >> 8; 57 | b[5] ^= t >> 16; 58 | b[4] ^= t >> 24; 59 | 60 | os_memcpy(b + 8, r, 8); 61 | aes_decrypt(ctx, b, b); 62 | os_memcpy(a, b, 8); 63 | os_memcpy(r, b + 8, 8); 64 | r -= 8; 65 | } 66 | } 67 | aes_decrypt_deinit(ctx); 68 | 69 | /* 3) Output results. 70 | * 71 | * These are already in @plain due to the location of temporary 72 | * variables. Just verify that the IV matches with the expected value. 73 | */ 74 | for (i = 0; i < 8; i++) { 75 | if (a[i] != 0xa6) 76 | return -1; 77 | } 78 | 79 | return 0; 80 | } 81 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/eap_common/eap_peap_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * EAP-PEAP common routines 3 | * Copyright (c) 2008-2011, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "crypto/sha1.h" 13 | #include "eap_peap_common.h" 14 | 15 | int peap_prfplus(int version, const u8 *key, size_t key_len, 16 | const char *label, const u8 *seed, size_t seed_len, 17 | u8 *buf, size_t buf_len) 18 | { 19 | unsigned char counter = 0; 20 | size_t pos, plen; 21 | u8 hash[SHA1_MAC_LEN]; 22 | size_t label_len = os_strlen(label); 23 | u8 extra[2]; 24 | const unsigned char *addr[5]; 25 | size_t len[5]; 26 | 27 | addr[0] = hash; 28 | len[0] = 0; 29 | addr[1] = (unsigned char *) label; 30 | len[1] = label_len; 31 | addr[2] = seed; 32 | len[2] = seed_len; 33 | 34 | if (version == 0) { 35 | /* 36 | * PRF+(K, S, LEN) = T1 | T2 | ... | Tn 37 | * T1 = HMAC-SHA1(K, S | 0x01 | 0x00 | 0x00) 38 | * T2 = HMAC-SHA1(K, T1 | S | 0x02 | 0x00 | 0x00) 39 | * ... 40 | * Tn = HMAC-SHA1(K, Tn-1 | S | n | 0x00 | 0x00) 41 | */ 42 | 43 | extra[0] = 0; 44 | extra[1] = 0; 45 | 46 | addr[3] = &counter; 47 | len[3] = 1; 48 | addr[4] = extra; 49 | len[4] = 2; 50 | } else { 51 | /* 52 | * PRF (K,S,LEN) = T1 | T2 | T3 | T4 | ... where: 53 | * T1 = HMAC-SHA1(K, S | LEN | 0x01) 54 | * T2 = HMAC-SHA1 (K, T1 | S | LEN | 0x02) 55 | * T3 = HMAC-SHA1 (K, T2 | S | LEN | 0x03) 56 | * T4 = HMAC-SHA1 (K, T3 | S | LEN | 0x04) 57 | * ... 58 | */ 59 | 60 | extra[0] = buf_len & 0xff; 61 | 62 | addr[3] = extra; 63 | len[3] = 1; 64 | addr[4] = &counter; 65 | len[4] = 1; 66 | } 67 | 68 | pos = 0; 69 | while (pos < buf_len) { 70 | counter++; 71 | plen = buf_len - pos; 72 | if (hmac_sha1_vector(key, key_len, 5, addr, len, hash) < 0) 73 | return -1; 74 | if (plen >= SHA1_MAC_LEN) { 75 | os_memcpy(&buf[pos], hash, SHA1_MAC_LEN); 76 | pos += SHA1_MAC_LEN; 77 | } else { 78 | os_memcpy(&buf[pos], hash, plen); 79 | break; 80 | } 81 | len[0] = SHA1_MAC_LEN; 82 | } 83 | 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/crypto/sha256-kdf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * HMAC-SHA256 KDF (RFC 5295) 3 | * Copyright (c) 2014, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #include "includes.h" 10 | 11 | #include "common.h" 12 | #include "sha256.h" 13 | 14 | 15 | /** 16 | * hmac_sha256_kdf - HMAC-SHA256 based KDF (RFC 5295) 17 | * @secret: Key for KDF 18 | * @secret_len: Length of the key in bytes 19 | * @label: A unique label for each purpose of the KDF 20 | * @seed: Seed value to bind into the key 21 | * @seed_len: Length of the seed 22 | * @out: Buffer for the generated pseudo-random key 23 | * @outlen: Number of bytes of key to generate 24 | * Returns: 0 on success, -1 on failure. 25 | * 26 | * This function is used to derive new, cryptographically separate keys from a 27 | * given key in ERP. This KDF is defined in RFC 5295, Chapter 3.1.2. 28 | */ 29 | int hmac_sha256_kdf(const u8 *secret, size_t secret_len, 30 | const char *label, const u8 *seed, size_t seed_len, 31 | u8 *out, size_t outlen) 32 | { 33 | u8 T[SHA256_MAC_LEN]; 34 | u8 iter = 1; 35 | const unsigned char *addr[4]; 36 | size_t len[4]; 37 | size_t pos, clen; 38 | 39 | addr[0] = T; 40 | len[0] = SHA256_MAC_LEN; 41 | addr[1] = (const unsigned char *) label; 42 | len[1] = os_strlen(label) + 1; 43 | addr[2] = seed; 44 | len[2] = seed_len; 45 | addr[3] = &iter; 46 | len[3] = 1; 47 | 48 | if (hmac_sha256_vector(secret, secret_len, 3, &addr[1], &len[1], T) < 0) 49 | return -1; 50 | 51 | pos = 0; 52 | for (;;) { 53 | clen = outlen - pos; 54 | if (clen > SHA256_MAC_LEN) 55 | clen = SHA256_MAC_LEN; 56 | os_memcpy(out + pos, T, clen); 57 | pos += clen; 58 | 59 | if (pos == outlen) 60 | break; 61 | 62 | if (iter == 255) { 63 | os_memset(out, 0, outlen); 64 | os_memset(T, 0, SHA256_MAC_LEN); 65 | return -1; 66 | } 67 | iter++; 68 | 69 | if (hmac_sha256_vector(secret, secret_len, 4, addr, len, T) < 0) 70 | { 71 | os_memset(out, 0, outlen); 72 | os_memset(T, 0, SHA256_MAC_LEN); 73 | return -1; 74 | } 75 | } 76 | 77 | os_memset(T, 0, SHA256_MAC_LEN); 78 | return 0; 79 | } 80 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/utils/trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Backtrace debugging 3 | * Copyright (c) 2009, Jouni Malinen 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef TRACE_H 10 | #define TRACE_H 11 | 12 | #define WPA_TRACE_LEN 16 13 | 14 | #ifdef WPA_TRACE 15 | #include 16 | 17 | #include "list.h" 18 | 19 | #define WPA_TRACE_INFO void *btrace[WPA_TRACE_LEN]; int btrace_num; 20 | 21 | struct wpa_trace_ref { 22 | struct dl_list list; 23 | const void *addr; 24 | WPA_TRACE_INFO 25 | }; 26 | #define WPA_TRACE_REF(name) struct wpa_trace_ref wpa_trace_ref_##name 27 | 28 | #define wpa_trace_dump(title, ptr) \ 29 | wpa_trace_dump_func((title), (ptr)->btrace, (ptr)->btrace_num) 30 | void wpa_trace_dump_func(const char *title, void **btrace, int btrace_num); 31 | #define wpa_trace_record(ptr) \ 32 | (ptr)->btrace_num = backtrace((ptr)->btrace, WPA_TRACE_LEN) 33 | void wpa_trace_show(const char *title); 34 | #define wpa_trace_add_ref(ptr, name, addr) \ 35 | wpa_trace_add_ref_func(&(ptr)->wpa_trace_ref_##name, (addr)) 36 | void wpa_trace_add_ref_func(struct wpa_trace_ref *ref, const void *addr); 37 | #define wpa_trace_remove_ref(ptr, name, addr) \ 38 | do { \ 39 | if ((addr)) \ 40 | dl_list_del(&(ptr)->wpa_trace_ref_##name.list); \ 41 | } while (0) 42 | void wpa_trace_check_ref(const void *addr); 43 | size_t wpa_trace_calling_func(const char *buf[], size_t len); 44 | 45 | #else /* WPA_TRACE */ 46 | 47 | #define WPA_TRACE_INFO 48 | #define WPA_TRACE_REF(n) 49 | #define wpa_trace_dump(title, ptr) do { } while (0) 50 | #define wpa_trace_record(ptr) do { } while (0) 51 | #define wpa_trace_show(title) do { } while (0) 52 | #define wpa_trace_add_ref(ptr, name, addr) do { } while (0) 53 | #define wpa_trace_remove_ref(ptr, name, addr) do { } while (0) 54 | #define wpa_trace_check_ref(addr) do { } while (0) 55 | 56 | #endif /* WPA_TRACE */ 57 | 58 | 59 | #ifdef WPA_TRACE_BFD 60 | 61 | void wpa_trace_dump_funcname(const char *title, void *pc); 62 | 63 | #else /* WPA_TRACE_BFD */ 64 | 65 | #define wpa_trace_dump_funcname(title, pc) do { } while (0) 66 | 67 | #endif /* WPA_TRACE_BFD */ 68 | 69 | void wpa_trace_deinit(void); 70 | 71 | #endif /* TRACE_H */ 72 | -------------------------------------------------------------------------------- /roguehostapd/hostapd-2_6/src/fst/fst_group.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FST module - FST group object definitions 3 | * Copyright (c) 2014, Qualcomm Atheros, Inc. 4 | * 5 | * This software may be distributed under the terms of the BSD license. 6 | * See README for more details. 7 | */ 8 | 9 | #ifndef FST_GROUP_H 10 | #define FST_GROUP_H 11 | 12 | struct fst_group { 13 | char group_id[IFNAMSIZ + 1]; 14 | struct dl_list ifaces; 15 | u8 dialog_token; 16 | u32 fsts_id; 17 | struct dl_list global_groups_lentry; 18 | }; 19 | 20 | struct session_transition_ie; 21 | 22 | #define foreach_fst_group_iface(g, i) \ 23 | dl_list_for_each((i), &(g)->ifaces, struct fst_iface, group_lentry) 24 | 25 | struct fst_group * fst_group_create(const char *group_id); 26 | void fst_group_attach_iface(struct fst_group *g, struct fst_iface *i); 27 | void fst_group_detach_iface(struct fst_group *g, struct fst_iface *i); 28 | void fst_group_delete(struct fst_group *g); 29 | 30 | void fst_group_update_ie(struct fst_group *g); 31 | 32 | static inline Boolean fst_group_has_ifaces(struct fst_group *g) 33 | { 34 | return !dl_list_empty(&g->ifaces); 35 | } 36 | 37 | static inline struct fst_iface * fst_group_first_iface(struct fst_group *g) 38 | { 39 | return dl_list_first(&g->ifaces, struct fst_iface, group_lentry); 40 | } 41 | 42 | static inline const char * fst_group_get_id(struct fst_group *g) 43 | { 44 | return g->group_id; 45 | } 46 | 47 | Boolean fst_group_delete_if_empty(struct fst_group *group); 48 | struct fst_iface * fst_group_get_iface_by_name(struct fst_group *g, 49 | const char *ifname); 50 | struct fst_iface * 51 | fst_group_get_peer_other_connection(struct fst_iface *iface, 52 | const u8 *peer_addr, u8 band_id, 53 | u8 *other_peer_addr); 54 | u8 fst_group_assign_dialog_token(struct fst_group *g); 55 | u32 fst_group_assign_fsts_id(struct fst_group *g); 56 | 57 | extern struct dl_list fst_global_groups_list; 58 | 59 | #define foreach_fst_group(g) \ 60 | dl_list_for_each((g), &fst_global_groups_list, \ 61 | struct fst_group, global_groups_lentry) 62 | 63 | static inline struct fst_group * fst_first_group(void) 64 | { 65 | return dl_list_first(&fst_global_groups_list, struct fst_group, 66 | global_groups_lentry); 67 | } 68 | 69 | #endif /* FST_GROUP_H */ 70 | --------------------------------------------------------------------------------