aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
Commit message (Collapse)AuthorAgeFilesLines
* WPS: fix nonce comparisons (UPSTREAM)Eyal Shapira2012-08-132-12/+12
| | | | | | | Multiple memcmps of nonces were actually comparing only the first byte instead of all 16 bytes. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* Fix a crash in WPS PBC overlap (BRCM)Eyal Shapira2012-08-021-0/+5
| | | | | | | | | | | Supposedly fixed a crash which occurs during actual PBC overlap according to BRCM commit log. (Not quite sure what's the exact cause of the crash here. However this looks like a non BRCM specific change so take it). p2p_dev_addr can be NULL in some of the calls. Might cause a problem ?) Signed-off-by: Eyal Shapira <eyal@wizery.com>
* WPS SSDP: Fix socket leaks on error pathsJouni Malinen2012-07-071-1/+6
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS UDF: Fix fd leak on error pathJouni Malinen2012-07-071-1/+3
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Move p2p_connect PIN format validation into a separate functionJouni Malinen2012-06-302-0/+17
| | | | | | | | | This functionality could be shared for other commands, too, so move it to a common function. In addition, implement the validation in a bit more strict way to avoid accepting values like '-123' as a valid PIN. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Share a single function for generating NFS password tokensJouni Malinen2012-06-282-1/+54
| | | | | | | There is no need for both hostapd and wpa_supplicant to have their own functions for this. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Add support for NCF password token from APJouni Malinen2012-06-283-0/+30
| | | | | | | | | | | | | | | | The new hostapd ctrl_iface command WPS_NFC_TOKEN can now be used to manage AP-as-Enrollee operations with NFC password token. WPS/NDEF parameters to this command can be used to generate a new NFC password token. enable/disable parameters can be used to enable/disable use of NFC password token (instead of AP PIN) for external Registrars. A preconfigured NFS password token can be used by providing its parameters with new hostapd.conf fields wps_nfc_dev_pw_id, wps_nfc_dh_pubkey, wps_nfc_dh_privkey, and wps_nfc_dev_pw. This use will also depend on WPS_NFC_TOKEN enable/disable commands, i.e., the configured NFS password token is disabled by default. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS ER: Add support for building NFC configuration tokenJouni Malinen2012-06-282-1/+40
| | | | | | | | WPS_ER_NFC_CONFIG_TOKEN command can now be used to build a NFC configuration token based on AP Settings learnt with WPS_ER_LEARN or set with WPS_ER_CONFIG. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Add support for NFC configuration token from external programJouni Malinen2012-06-282-9/+18
| | | | | | | | The new wpa_supplicant ctrl_iface command WPS_NFC_TAG_READ can now be used to process NFC tags read by external programs to initiate wpa_supplicant to use NFC Configuration Token to create a new network. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Add new mechanism for generation NFC configuration tokenJouni Malinen2012-06-282-1/+2
| | | | | | | | The new hostapd ctrl_iface command WPS_NFC_CONFIG_TOKEN can now be used to fetch payload for an NFC configuration token so that an external program can be used to write this on an NFC tag. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Use separate list of NFC Password Tokens in the RegistrarJouni Malinen2012-06-274-9/+150
| | | | | | | | | | This adds a cleaner mechanism for handling NFC Password Tokens in the WPS Registrar. There could be more than one active NFC Password Token in use and as such, a list of tokens needs to be maintained. The old WPS_OOB interface is still using the old mechanism that supports only a single active NFC Password Token. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Add new mechanism for communicating NFC tag read eventsJouni Malinen2012-06-272-2/+44
| | | | | | | | | | | hostapd ctrl_iface can now be used to deliver payload from read operation of an NFC tag. This allows operations without having to have low-level NFC code within hostapd. For now, the new wps_nfc_tag_read command can be used with NFC password tokens for the case where the AP has an NFC device that is used to read an NFC tag from the station Enrollee. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Add new mechanism for NFC config method using password tokenJouni Malinen2012-06-272-0/+27
| | | | | | | | | | | | Instead of requiring low-level access to an NFC device and synchronous operations, the new WPS_NFC_TOKEN and WPS_NFC ctrl_iface commands can be used to build a NFC password token and initiate WPS protocol run using that token (or pre-configured values) as separate commands. The WPS_NFC_TOKEN output can be written to a NFC tag using an external program, i.e., wpa_supplicant does not need to have low-level code for NFC operations for this. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Move attribute parser definitions into a new header fileJouni Malinen2012-06-273-95/+110
| | | | | | | This allows wps/wps_attr_parse.h to be included into files outside src/wps. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Split wps_build_oob_dev_password() into partsJouni Malinen2012-06-272-12/+26
| | | | | | | This allows sharing of a function to build the attribute without changing the OOB parameters. Signed-hostap: Jouni Malinen <j@w1.fi>
* NDEF: Mark input data const when it is not modifiedJouni Malinen2012-06-272-11/+12
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Allow NDEF functions to be used from outside src/wpsJouni Malinen2012-06-272-4/+4
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* NDEF: Skip unnecessary wpabuf to ptr/len conversionJouni Malinen2012-06-271-5/+5
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Add support for OOB dev password lengths 16..31Jouni Malinen2012-06-274-9/+13
| | | | | | | | | Previously, only the maximum length 32 octets for OOB device password was accepted. Since the specification allows a shorter password to be used with limited OOB mechanism (e.g., small NFC tag), we should accept lengths 16..32. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Fix potential memory leak with NFC password tokenJouni Malinen2012-06-271-0/+1
| | | | | | | The old stored public key hash needs to be freed before replacing the pointer with the new value. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Fix NFC password token building with WPS 2.0Jouni Malinen2012-06-271-1/+1
| | | | | | | | | | The earlier WPS 2.0 changes did not increase the wpabuf size when adding a new attribute to the NFC password token. This could result in aborting the application on wpabuf overflow if NFC out-of-band mechanism is used with WPS 2.0 enabled. Signed-hostap: Jouni Malinen <j@w1.fi> intended-for: hostap-1
* hostapd: Fix PBC config method of WSC IE in Beacon/Probe ResponseYoni Divinsky2012-06-251-4/+8
| | | | | | | | In AP which supports WPSv2 with only virtual push button, when PBC is called, the WSC IE should include Selected Registrar Configuration Methods attribute with the bit of the physical push button not set. Signed-hostap: Yoni Divinsky <yoni.divinsky@ti.com>
* WPS: Allow vendor specific attribute to be added into M1Anirban Sirkhell2012-04-044-1/+18
| | | | | | | | wps_vendor_ext_m1 configuration parameter can now be used to add a vendor specific attribute into the WPS M1 message, e.g., for Windows Vertical Pairing. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Select the BSD license terms as the only license alternativeMasashi Honma2012-03-054-36/+12
| | | | | I changed license terms which I can change. (email of Mon, 5 Mar 2012 22:59:02 +0900 to hostap@lists.shmoo.com)
* WPS: Invalidate wildcard PIN on other radios after successful useJouni Malinen2012-02-292-9/+32
| | | | | | | | If a wildcard PIN is used on any of the radios that hostapd is controlling, invalidate the matching PIN on all the other radios to avoid multiple uses of the same PIN. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Advertise immediate availability of WPS credentialJouni Malinen2012-02-272-5/+5
| | | | | | | | | | | | | | Use Device Password ID in WSC IE of Probe Request and Probe Response frames to advertise immediate availability of WPS credentials per P2P specification sections 3.1.2.1.1 (Listen State), 3.1.2.1.2 (Scan Phase), and 3.1.2.1.3 (Find Phase). For now, the Device Password ID is set only for the case where we are active GO Negotiation with a specific peer. In practice, this means that the Probe Response frames during pending GO Negotiation (whenever in Listen state) indicate availability of the credential. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS UPnP: Clean up URL parserJouni Malinen2012-02-191-32/+34
| | | | | | | | Remove unnecessary second copy of the URL and too long memory allocation. In addition, avoid use of strcpy() to keep static analyzers happier. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Fix clearing of SetSelectedRegistrar with multiple interfacesJouni Malinen2012-02-133-9/+15
| | | | | | | | | | | | | | | | | | The SetSelectedRegistrar timeout was registered for each registrar instance, but the only context pointer (struct subscription *) was shared with each registrar which resulted in the timeout getting cancelled for some of the registrar instances before the selected registrar (ER) information was cleared. In addition, when an ER unsubscribed from receiving events, the selected registrar information got cleared only from a single registrar. Fix these issues by registering a pointer to the registrar instance in the timeout and by iterating over all UPnP interfaces when removing a subscription. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Remove the GPL notification from files contributed by Jouni MalinenJouni Malinen2012-02-1120-160/+40
| | | | | | | Remove the GPL notification text from the files that were initially contributed by myself. Signed-hostap: Jouni Malinen <j@w1.fi>
* Remove the GPL notification from files contributed by AtherosJouni Malinen2012-02-113-24/+6
| | | | | | | Remove the GPL notification text from files that were initially contributed by Atheros Communications or Qualcomm Atheros. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Allow wildcard UUID PIN to be used twiceGanesh Prasadh2012-02-081-3/+11
| | | | | | | | | | | | Previously, PINs that are added with a wildcard UUID were allowed to be used only by a single Enrollee. However, there may be more than one Enrollee trying to connect when an AP indicates that active Registrar is present. As a minimal workaround, allow two Enrollees to try to use the wildcard PIN. More complete extension could use timeout and allow larger set of Enrollees to try to connect (while still keeping in mind PIN disabling requirement after 10 failed attempts). Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Disable AP PIN after 10 consecutive failuresJouni Malinen2012-01-302-1/+10
| | | | | | | | | | | While the exponential increase in the lockout period provides an efficient mitigation mechanism against brute force attacks, this additional trigger to enter indefinite lockout period (cleared by restarting hostapd) will limit attacks even further by giving maximum of 10 attempts (without authorized user action) even in a very long term attack. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Fix an interoperability issue with mixed mode and AP SettingsJouni Malinen2012-01-271-4/+31
| | | | | | | | | | | | | | It looks like Windows 7 WPS implementation does not like multiple Authentication/Encryption Type bits to be set in M7 AP Settings attributes, i.e., it refused to add a network profile if the AP was configured for WPA/WPA2 mixed mode and AP PIN was used to enroll the network. Leave only a single bit set in the Authentication/Encryption Type attributes in M7 when the AP is acting as an Enrollee to avoid this issue. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Cancel previous registered wps_registrar_pbc_timeoutSpencer Chang2011-12-291-0/+1
| | | | | | | | Since wps_registrar_pbc_timeout is called to stop PBC, previously registered wps_registrar_pbc_timeout must be canceled when canceling the WPS operation. Signed-off-by: Spencer Chang <jungwalk@gmail.com>
* Skip WPS PBC overlap detection if P2P address is the sameVitaly Wool2011-12-111-4/+9
| | | | | | | | | | | | | | | | WPS overlap detection can detect false overlap if a P2P peer changes UUID while authentication is ongoing. Changing UUID is of course wrong but this is what some popular devices do so we need to work around it in order to keep compatibility with these devices. There already is a mechanism in WPS registrar to skip overlap detection if P2P addresses of two sessions match but it wasn't really triggered because the address wasn't filled in in the caller function. Let's fill in this address and also clean up WPS PBC sessions on WSC process completion if UUID was changed. Signed-hostap: Vitaly Wool<vitalywool@gmail.com>
* WPS: Fix stopping of active WPS operation on dual concurrent APSubrat Dash2011-11-302-0/+13
| | | | | | | | | | When hostapd controls multiple radios, WPS operations are started on all interfaces. However, when the provisioning run had been completed successfully, actiove WPS mode was stopped only a single interface. Fix this to iterate through all interfaces so that this is handled consistently with the starting of WPS operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS ER: Fix segfault in some selected registrar change casesJouni Malinen2011-11-303-11/+0
| | | | | | | | | | | | | | | | Commit 628d54639a90f779fd5c98c31e049638de56b17e introduced number of new WPS related ctrl_iface messages to hostapd. Some of these were for ER events which do not make any sense to hostapd that cannot operate as an ER. The WPS_EV_ER_SET_SELECTED_REGISTRAR one from wps_registrar_sel_registrar_changed_event() was especially problematic since it can cause wpa_supplicant ER code segfault due to missing event data. Revert all the ER specific changes from commit 628d54639a90f779fd5c98c31e049638de56b17e to get rid of the segfault and undesired extra code in hostapd. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Use NULL instead of 0 for pointersJouni Malinen2011-11-181-4/+4
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Use strdup to initialize dev_password for PBCJouni Malinen2011-11-171-2/+1
| | | | | | | | Some static analyzers complain about memset with '0' value. This was used correctly here, but since use of strdup is about as good an option, use that to silence the invalid warnings. Signed-hostap: Jouni Malinen <j@w1.fi>
* Remove unnecessary include file inclusionJouni Malinen2011-11-132-2/+0
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Send the credential when learning AP params in registrar roleOlivier Sobrie2011-10-301-0/+43
| | | | | | | | | | | | | When the supplicant acts as a registrar to learn the access point parameters send the credentials to the wpa_cli interface after receiving the 7th message. This is needed for proper behavior with wps_cred_processing set to 1 or 2. Without this patch, after the 7th message you got the WPS-CRED-RECEIVED notification without the credentials. This was because the cred_attr and cred_attr_len were not filled in in the wps structure. Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
* Remove unused variablesJouni Malinen2011-10-231-0/+4
|
* Remove unused variable and functionAndrii Bordunov2011-10-221-12/+0
|
* WPS: Send AP Settings as a wrapped Credential attribute to ctrl_ifaceZhi Chen2011-09-302-0/+22
| | | | | | Wrap self-generated WPS credential for new AP settings and send that to control interface to provide the needed information in WPS-NEW-AP-SETTINGS for external processing.
* Fix typos found by codespellPavel Roskin2011-09-223-4/+4
| | | | Signed-off-by: Pavel Roskin <proski@gnu.org>
* Remove time.h include from utils/includes.hJouni Malinen2011-09-121-1/+1
| | | | | | | | | os_*() wrappers should be used instead of functions from time.h. Removing the header from includes.h enforces this. os_unix.c can include this its uses are valid wrapper calls. wps_upnp.c uses gmtime() for which there is no os_*() wrapper available yet, so allow it to use time.h, too. Similarly, allow dump_state.c to use time.h for ctime().
* WPS: Set Probe Request config methods based on configurationBharat Chakravarty2011-09-012-28/+2
| | | | | | Instead of hardcoding the Config Methods attribute value in Probe Request frames, set this based on the configured parameter config_methods to allow correct set of methods to be advertised.
* WPS ER: Fix UPnP XML Device Description parser to find correct deviceJouni Malinen2011-08-313-3/+50
| | | | | | | | The device description file may include multiple devices. Improve the simplistic parser by first trying to find the WFADevice:1 device before fetching the device parameters. While this is still far from complete XML parsing, this should address the most common root device specifications.
* WPS: Wait for EAPOL-Start unless WPS 2.0 station as workaroundJouni Malinen2011-08-282-0/+14
| | | | | | | | | | | Extend the code that waits for the station to send EAPOL-Start before initiating EAPOL authenticator operations to cover the case where the station includes WPS IE in (Re)Association Request frame if that IE does not include support for WPS 2.0. While this should not really be needed, this may help with some deployed WPS 1.0 stations that do not support EAPOL operations correctly and may get confused of the EAP-Request/Identity packets that would show up twice if EAPOL-Start is transmitted.
* WPS: Fix M2/M2D Config Methods to include PushButton even if PBC not in useJouni Malinen2011-08-111-9/+1
| | | | | | | | The Config Methods attribute in M2 and M2D messages is supposed to indicate which configuration methods are supported by the Registrar. As such, it should not depend on whether PBC mode is currently active or not. That will only affect the Selected Registrar Config Methods and Device Password ID attributes.