2 * Wi-Fi Protected Setup
3 * Copyright (c) 2007-2013, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
15 * enum wsc_op_code - EAP-WSC OP-Code values
18 WSC_UPnP
= 0 /* No OP Code in UPnP transport */,
28 struct upnp_wps_device_sm
;
30 struct wps_parse_attr
;
33 * struct wps_credential - WPS Credential
35 * @ssid_len: Length of SSID
36 * @auth_type: Authentication Type (WPS_AUTH_OPEN, .. flags)
37 * @encr_type: Encryption Type (WPS_ENCR_NONE, .. flags)
40 * @key_len: Key length in octets
41 * @mac_addr: MAC address of the Credential receiver
42 * @cred_attr: Unparsed Credential attribute data (used only in cred_cb());
43 * this may be %NULL, if not used
44 * @cred_attr_len: Length of cred_attr in octets
45 * @ap_channel: AP channel
47 struct wps_credential
{
55 u8 mac_addr
[ETH_ALEN
];
61 #define WPS_DEV_TYPE_LEN 8
62 #define WPS_DEV_TYPE_BUFSIZE 21
63 #define WPS_SEC_DEV_TYPE_MAX_LEN 128
64 /* maximum number of advertised WPS vendor extension attributes */
65 #define MAX_WPS_VENDOR_EXTENSIONS 10
66 /* maximum size of WPS Vendor extension attribute */
67 #define WPS_MAX_VENDOR_EXT_LEN 1024
68 /* maximum number of parsed WPS vendor extension attributes */
69 #define MAX_WPS_PARSE_VENDOR_EXT 10
72 * struct wps_device_data - WPS Device Data
73 * @mac_addr: Device MAC address
74 * @device_name: Device Name (0..32 octets encoded in UTF-8)
75 * @manufacturer: Manufacturer (0..64 octets encoded in UTF-8)
76 * @model_name: Model Name (0..32 octets encoded in UTF-8)
77 * @model_number: Model Number (0..32 octets encoded in UTF-8)
78 * @serial_number: Serial Number (0..32 octets encoded in UTF-8)
79 * @pri_dev_type: Primary Device Type
80 * @sec_dev_type: Array of secondary device types
81 * @num_sec_dev_type: Number of secondary device types
82 * @os_version: OS Version
83 * @rf_bands: RF bands (WPS_RF_24GHZ, WPS_RF_50GHZ flags)
84 * @p2p: Whether the device is a P2P device
86 struct wps_device_data
{
87 u8 mac_addr
[ETH_ALEN
];
93 u8 pri_dev_type
[WPS_DEV_TYPE_LEN
];
94 #define WPS_SEC_DEVICE_TYPES 5
95 u8 sec_dev_type
[WPS_SEC_DEVICE_TYPES
][WPS_DEV_TYPE_LEN
];
100 struct wpabuf
*vendor_ext_m1
;
101 struct wpabuf
*vendor_ext
[MAX_WPS_VENDOR_EXTENSIONS
];
107 * struct wps_config - WPS configuration for a single registration protocol run
111 * wps - Pointer to long term WPS context
113 struct wps_context
*wps
;
116 * registrar - Whether this end is a Registrar
121 * pin - Enrollee Device Password (%NULL for Registrar or PBC)
126 * pin_len - Length on pin in octets
131 * pbc - Whether this is protocol run uses PBC
136 * assoc_wps_ie: (Re)AssocReq WPS IE (in AP; %NULL if not AP)
138 const struct wpabuf
*assoc_wps_ie
;
141 * new_ap_settings - New AP settings (%NULL if not used)
143 * This parameter provides new AP settings when using a wireless
144 * stations as a Registrar to configure the AP. %NULL means that AP
145 * will not be reconfigured, i.e., the station will only learn the
146 * current AP settings by using AP PIN.
148 const struct wps_credential
*new_ap_settings
;
151 * peer_addr: MAC address of the peer in AP; %NULL if not AP
156 * use_psk_key - Use PSK format key in Credential
158 * Force PSK format to be used instead of ASCII passphrase when
159 * building Credential for an Enrollee. The PSK value is set in
160 * struct wpa_context::psk.
165 * dev_pw_id - Device Password ID for Enrollee when PIN is used
170 * p2p_dev_addr - P2P Device Address from (Re)Association Request
172 * On AP/GO, this is set to the P2P Device Address of the associating
173 * P2P client if a P2P IE is included in the (Re)Association Request
174 * frame and the P2P Device Address is included. Otherwise, this is set
175 * to %NULL to indicate the station does not have a P2P Device Address.
177 const u8
*p2p_dev_addr
;
180 * pbc_in_m1 - Do not remove PushButton config method in M1 (AP)
182 * This can be used to enable a workaround to allow Windows 7 to use
188 struct wps_data
* wps_init(const struct wps_config
*cfg
);
190 void wps_deinit(struct wps_data
*data
);
193 * enum wps_process_res - WPS message processing result
195 enum wps_process_res
{
197 * WPS_DONE - Processing done
202 * WPS_CONTINUE - Processing continues
207 * WPS_FAILURE - Processing failed
212 * WPS_PENDING - Processing continues, but waiting for an external
213 * event (e.g., UPnP message from an external Registrar)
217 enum wps_process_res
wps_process_msg(struct wps_data
*wps
,
218 enum wsc_op_code op_code
,
219 const struct wpabuf
*msg
);
221 struct wpabuf
* wps_get_msg(struct wps_data
*wps
, enum wsc_op_code
*op_code
);
223 int wps_is_selected_pbc_registrar(const struct wpabuf
*msg
);
224 int wps_is_selected_pin_registrar(const struct wpabuf
*msg
);
225 int wps_ap_priority_compar(const struct wpabuf
*wps_a
,
226 const struct wpabuf
*wps_b
);
227 int wps_is_addr_authorized(const struct wpabuf
*msg
, const u8
*addr
,
229 const u8
* wps_get_uuid_e(const struct wpabuf
*msg
);
230 int wps_is_20(const struct wpabuf
*msg
);
232 struct wpabuf
* wps_build_assoc_req_ie(enum wps_request_type req_type
);
233 struct wpabuf
* wps_build_assoc_resp_ie(void);
234 struct wpabuf
* wps_build_probe_req_ie(u16 pw_id
, struct wps_device_data
*dev
,
236 enum wps_request_type req_type
,
237 unsigned int num_req_dev_types
,
238 const u8
*req_dev_types
);
242 * struct wps_registrar_config - WPS Registrar configuration
244 struct wps_registrar_config
{
246 * new_psk_cb - Callback for new PSK
247 * @ctx: Higher layer context data (cb_ctx)
248 * @mac_addr: MAC address of the Enrollee
250 * @psk_len: The length of psk in octets
251 * Returns: 0 on success, -1 on failure
253 * This callback is called when a new per-device PSK is provisioned.
255 int (*new_psk_cb
)(void *ctx
, const u8
*mac_addr
, const u8
*psk
,
259 * set_ie_cb - Callback for WPS IE changes
260 * @ctx: Higher layer context data (cb_ctx)
261 * @beacon_ie: WPS IE for Beacon
262 * @probe_resp_ie: WPS IE for Probe Response
263 * Returns: 0 on success, -1 on failure
265 * This callback is called whenever the WPS IE in Beacon or Probe
266 * Response frames needs to be changed (AP only). Callee is responsible
267 * for freeing the buffers.
269 int (*set_ie_cb
)(void *ctx
, struct wpabuf
*beacon_ie
,
270 struct wpabuf
*probe_resp_ie
);
273 * pin_needed_cb - Callback for requesting a PIN
274 * @ctx: Higher layer context data (cb_ctx)
275 * @uuid_e: UUID-E of the unknown Enrollee
276 * @dev: Device Data from the unknown Enrollee
278 * This callback is called whenever an unknown Enrollee requests to use
279 * PIN method and a matching PIN (Device Password) is not found in
282 void (*pin_needed_cb
)(void *ctx
, const u8
*uuid_e
,
283 const struct wps_device_data
*dev
);
286 * reg_success_cb - Callback for reporting successful registration
287 * @ctx: Higher layer context data (cb_ctx)
288 * @mac_addr: MAC address of the Enrollee
289 * @uuid_e: UUID-E of the Enrollee
290 * @dev_pw: Device Password (PIN) used during registration
291 * @dev_pw_len: Length of dev_pw in octets
293 * This callback is called whenever an Enrollee completes registration
296 void (*reg_success_cb
)(void *ctx
, const u8
*mac_addr
,
297 const u8
*uuid_e
, const u8
*dev_pw
,
301 * set_sel_reg_cb - Callback for reporting selected registrar changes
302 * @ctx: Higher layer context data (cb_ctx)
303 * @sel_reg: Whether the Registrar is selected
304 * @dev_passwd_id: Device Password ID to indicate with method or
305 * specific password the Registrar intends to use
306 * @sel_reg_config_methods: Bit field of active config methods
308 * This callback is called whenever the Selected Registrar state
309 * changes (e.g., a new PIN becomes available or PBC is invoked). This
310 * callback is only used by External Registrar implementation;
311 * set_ie_cb() is used by AP implementation in similar caes, but it
312 * provides the full WPS IE data instead of just the minimal Registrar
315 void (*set_sel_reg_cb
)(void *ctx
, int sel_reg
, u16 dev_passwd_id
,
316 u16 sel_reg_config_methods
);
319 * enrollee_seen_cb - Callback for reporting Enrollee based on ProbeReq
320 * @ctx: Higher layer context data (cb_ctx)
321 * @addr: MAC address of the Enrollee
322 * @uuid_e: UUID of the Enrollee
323 * @pri_dev_type: Primary device type
324 * @config_methods: Config Methods
325 * @dev_password_id: Device Password ID
326 * @request_type: Request Type
327 * @dev_name: Device Name (if available)
329 void (*enrollee_seen_cb
)(void *ctx
, const u8
*addr
, const u8
*uuid_e
,
330 const u8
*pri_dev_type
, u16 config_methods
,
331 u16 dev_password_id
, u8 request_type
,
332 const char *dev_name
);
335 * cb_ctx: Higher layer context data for Registrar callbacks
340 * skip_cred_build: Do not build credential
342 * This option can be used to disable internal code that builds
343 * Credential attribute into M8 based on the current network
344 * configuration and Enrollee capabilities. The extra_cred data will
345 * then be used as the Credential(s).
350 * extra_cred: Additional Credential attribute(s)
352 * This optional data (set to %NULL to disable) can be used to add
353 * Credential attribute(s) for other networks into M8. If
354 * skip_cred_build is set, this will also override the automatically
355 * generated Credential attribute.
357 const u8
*extra_cred
;
360 * extra_cred_len: Length of extra_cred in octets
362 size_t extra_cred_len
;
365 * disable_auto_conf - Disable auto-configuration on first registration
367 * By default, the AP that is started in not configured state will
368 * generate a random PSK and move to configured state when the first
369 * registration protocol run is completed successfully. This option can
370 * be used to disable this functionality and leave it up to an external
371 * program to take care of configuration. This requires the extra_cred
372 * to be set with a suitable Credential and skip_cred_build being used.
374 int disable_auto_conf
;
377 * static_wep_only - Whether the BSS supports only static WEP
382 * dualband - Whether this is a concurrent dualband AP
387 * force_per_enrollee_psk - Force per-Enrollee random PSK
389 * This forces per-Enrollee random PSK to be generated even if a default
390 * PSK is set for a network.
392 int force_per_enrollee_psk
;
397 * enum wps_event - WPS event types
401 * WPS_EV_M2D - M2D received (Registrar did not know us)
406 * WPS_EV_FAIL - Registration failed
411 * WPS_EV_SUCCESS - Registration succeeded
416 * WPS_EV_PWD_AUTH_FAIL - Password authentication failed
418 WPS_EV_PWD_AUTH_FAIL
,
421 * WPS_EV_PBC_OVERLAP - PBC session overlap detected
426 * WPS_EV_PBC_TIMEOUT - PBC walktime expired before protocol run start
431 * WPS_EV_PBC_ACTIVE - PBC mode was activated
436 * WPS_EV_PBC_DISABLE - PBC mode was disabled
441 * WPS_EV_ER_AP_ADD - ER: AP added
446 * WPS_EV_ER_AP_REMOVE - ER: AP removed
451 * WPS_EV_ER_ENROLLEE_ADD - ER: Enrollee added
453 WPS_EV_ER_ENROLLEE_ADD
,
456 * WPS_EV_ER_ENROLLEE_REMOVE - ER: Enrollee removed
458 WPS_EV_ER_ENROLLEE_REMOVE
,
461 * WPS_EV_ER_AP_SETTINGS - ER: AP Settings learned
463 WPS_EV_ER_AP_SETTINGS
,
466 * WPS_EV_ER_SET_SELECTED_REGISTRAR - ER: SetSelectedRegistrar event
468 WPS_EV_ER_SET_SELECTED_REGISTRAR
,
471 * WPS_EV_AP_PIN_SUCCESS - External Registrar used correct AP PIN
473 WPS_EV_AP_PIN_SUCCESS
477 * union wps_event_data - WPS event data
479 union wps_event_data
{
481 * struct wps_event_m2d - M2D event data
483 struct wps_event_m2d
{
485 const u8
*manufacturer
;
486 size_t manufacturer_len
;
487 const u8
*model_name
;
488 size_t model_name_len
;
489 const u8
*model_number
;
490 size_t model_number_len
;
491 const u8
*serial_number
;
492 size_t serial_number_len
;
495 const u8
*primary_dev_type
; /* 8 octets */
501 * struct wps_event_fail - Registration failure information
502 * @msg: enum wps_msg_type
504 struct wps_event_fail
{
507 u16 error_indication
;
508 u8 peer_macaddr
[ETH_ALEN
];
511 struct wps_event_success
{
512 u8 peer_macaddr
[ETH_ALEN
];
515 struct wps_event_pwd_auth_fail
{
518 u8 peer_macaddr
[ETH_ALEN
];
521 struct wps_event_er_ap
{
524 const char *friendly_name
;
525 const char *manufacturer
;
526 const char *manufacturer_url
;
527 const char *model_description
;
528 const char *model_name
;
529 const char *model_number
;
530 const char *model_url
;
531 const char *serial_number
;
533 const u8
*pri_dev_type
;
537 struct wps_event_er_enrollee
{
543 const u8
*pri_dev_type
;
544 const char *dev_name
;
545 const char *manufacturer
;
546 const char *model_name
;
547 const char *model_number
;
548 const char *serial_number
;
551 struct wps_event_er_ap_settings
{
553 const struct wps_credential
*cred
;
556 struct wps_event_er_set_selected_registrar
{
560 u16 sel_reg_config_methods
;
562 WPS_ER_SET_SEL_REG_START
,
563 WPS_ER_SET_SEL_REG_DONE
,
564 WPS_ER_SET_SEL_REG_FAILED
570 * struct upnp_pending_message - Pending PutWLANResponse messages
571 * @next: Pointer to next pending message or %NULL
572 * @addr: NewWLANEventMAC
574 * @type: Message Type
576 struct upnp_pending_message
{
577 struct upnp_pending_message
*next
;
580 enum wps_msg_type type
;
584 * struct wps_context - Long term WPS context data
586 * This data is stored at the higher layer Authenticator or Supplicant data
587 * structures and it is maintained over multiple registration protocol runs.
591 * ap - Whether the local end is an access point
596 * registrar - Pointer to WPS registrar data from wps_registrar_init()
598 struct wps_registrar
*registrar
;
601 * wps_state - Current WPS state
603 enum wps_state wps_state
;
606 * ap_setup_locked - Whether AP setup is locked (only used at AP)
618 * This SSID is used by the Registrar to fill in information for
619 * Credentials. In addition, AP uses it when acting as an Enrollee to
620 * notify Registrar of the current configuration.
625 * ssid_len - Length of ssid in octets
630 * dev - Own WPS device data
632 struct wps_device_data dev
;
635 * dh_ctx - Context data for Diffie-Hellman operation
640 * dh_privkey - Diffie-Hellman private key
642 struct wpabuf
*dh_privkey
;
645 * dh_pubkey_oob - Diffie-Hellman public key
647 struct wpabuf
*dh_pubkey
;
650 * config_methods - Enabled configuration methods
652 * Bit field of WPS_CONFIG_*
657 * encr_types - Enabled encryption types (bit field of WPS_ENCR_*)
662 * auth_types - Authentication types (bit field of WPS_AUTH_*)
667 * network_key - The current Network Key (PSK) or %NULL to generate new
669 * If %NULL, Registrar will generate per-device PSK. In addition, AP
670 * uses this when acting as an Enrollee to notify Registrar of the
671 * current configuration.
673 * When using WPA/WPA2-Person, this key can be either the ASCII
674 * passphrase (8..63 characters) or the 32-octet PSK (64 hex
675 * characters). When this is set to the ASCII passphrase, the PSK can
676 * be provided in the psk buffer and used per-Enrollee to control which
677 * key type is included in the Credential (e.g., to reduce calculation
678 * need on low-powered devices by provisioning PSK while still allowing
679 * other devices to get the passphrase).
684 * network_key_len - Length of network_key in octets
686 size_t network_key_len
;
689 * psk - The current network PSK
691 * This optional value can be used to provide the current PSK if
692 * network_key is set to the ASCII passphrase.
697 * psk_set - Whether psk value is set
702 * ap_settings - AP Settings override for M7 (only used at AP)
704 * If %NULL, AP Settings attributes will be generated based on the
705 * current network configuration.
710 * ap_settings_len - Length of ap_settings in octets
712 size_t ap_settings_len
;
715 * friendly_name - Friendly Name (required for UPnP)
720 * manufacturer_url - Manufacturer URL (optional for UPnP)
722 char *manufacturer_url
;
725 * model_description - Model Description (recommended for UPnP)
727 char *model_description
;
730 * model_url - Model URL (optional for UPnP)
735 * upc - Universal Product Code (optional for UPnP)
740 * cred_cb - Callback to notify that new Credentials were received
741 * @ctx: Higher layer context data (cb_ctx)
742 * @cred: The received Credential
743 * Return: 0 on success, -1 on failure
745 int (*cred_cb
)(void *ctx
, const struct wps_credential
*cred
);
748 * event_cb - Event callback (state information about progress)
749 * @ctx: Higher layer context data (cb_ctx)
753 void (*event_cb
)(void *ctx
, enum wps_event event
,
754 union wps_event_data
*data
);
757 * rf_band_cb - Fetch currently used RF band
758 * @ctx: Higher layer context data (cb_ctx)
759 * Return: Current used RF band or 0 if not known
761 int (*rf_band_cb
)(void *ctx
);
764 * cb_ctx: Higher layer context data for callbacks
768 struct upnp_wps_device_sm
*wps_upnp
;
770 /* Pending messages from UPnP PutWLANResponse */
771 struct upnp_pending_message
*upnp_msgs
;
773 u16 ap_nfc_dev_pw_id
;
774 struct wpabuf
*ap_nfc_dh_pubkey
;
775 struct wpabuf
*ap_nfc_dh_privkey
;
776 struct wpabuf
*ap_nfc_dev_pw
;
779 struct wps_registrar
*
780 wps_registrar_init(struct wps_context
*wps
,
781 const struct wps_registrar_config
*cfg
);
782 void wps_registrar_deinit(struct wps_registrar
*reg
);
783 int wps_registrar_add_pin(struct wps_registrar
*reg
, const u8
*addr
,
784 const u8
*uuid
, const u8
*pin
, size_t pin_len
,
786 int wps_registrar_invalidate_pin(struct wps_registrar
*reg
, const u8
*uuid
);
787 int wps_registrar_wps_cancel(struct wps_registrar
*reg
);
788 int wps_registrar_unlock_pin(struct wps_registrar
*reg
, const u8
*uuid
);
789 int wps_registrar_button_pushed(struct wps_registrar
*reg
,
790 const u8
*p2p_dev_addr
);
791 void wps_registrar_complete(struct wps_registrar
*registrar
, const u8
*uuid_e
,
792 const u8
*dev_pw
, size_t dev_pw_len
);
793 void wps_registrar_probe_req_rx(struct wps_registrar
*reg
, const u8
*addr
,
794 const struct wpabuf
*wps_data
,
796 int wps_registrar_update_ie(struct wps_registrar
*reg
);
797 int wps_registrar_get_info(struct wps_registrar
*reg
, const u8
*addr
,
798 char *buf
, size_t buflen
);
799 int wps_registrar_config_ap(struct wps_registrar
*reg
,
800 struct wps_credential
*cred
);
801 int wps_registrar_add_nfc_pw_token(struct wps_registrar
*reg
,
802 const u8
*pubkey_hash
, u16 pw_id
,
803 const u8
*dev_pw
, size_t dev_pw_len
);
804 int wps_registrar_add_nfc_password_token(struct wps_registrar
*reg
,
805 const u8
*oob_dev_pw
,
806 size_t oob_dev_pw_len
);
808 int wps_build_credential_wrap(struct wpabuf
*msg
,
809 const struct wps_credential
*cred
);
811 unsigned int wps_pin_checksum(unsigned int pin
);
812 unsigned int wps_pin_valid(unsigned int pin
);
813 unsigned int wps_generate_pin(void);
814 int wps_pin_str_valid(const char *pin
);
815 void wps_free_pending_msgs(struct upnp_pending_message
*msgs
);
817 struct wpabuf
* wps_get_oob_cred(struct wps_context
*wps
);
818 int wps_oob_use_cred(struct wps_context
*wps
, struct wps_parse_attr
*attr
);
819 int wps_attr_text(struct wpabuf
*data
, char *buf
, char *end
);
820 const char * wps_ei_str(enum wps_error_indication ei
);
822 struct wps_er
* wps_er_init(struct wps_context
*wps
, const char *ifname
,
824 void wps_er_refresh(struct wps_er
*er
);
825 void wps_er_deinit(struct wps_er
*er
, void (*cb
)(void *ctx
), void *ctx
);
826 void wps_er_set_sel_reg(struct wps_er
*er
, int sel_reg
, u16 dev_passwd_id
,
827 u16 sel_reg_config_methods
);
828 int wps_er_pbc(struct wps_er
*er
, const u8
*uuid
, const u8
*addr
);
829 const u8
* wps_er_get_sta_uuid(struct wps_er
*er
, const u8
*addr
);
830 int wps_er_learn(struct wps_er
*er
, const u8
*uuid
, const u8
*addr
,
831 const u8
*pin
, size_t pin_len
);
832 int wps_er_set_config(struct wps_er
*er
, const u8
*uuid
, const u8
*addr
,
833 const struct wps_credential
*cred
);
834 int wps_er_config(struct wps_er
*er
, const u8
*uuid
, const u8
*addr
,
835 const u8
*pin
, size_t pin_len
,
836 const struct wps_credential
*cred
);
837 struct wpabuf
* wps_er_config_token_from_cred(struct wps_context
*wps
,
838 struct wps_credential
*cred
);
839 struct wpabuf
* wps_er_nfc_config_token(struct wps_er
*er
, const u8
*uuid
,
842 int wps_dev_type_str2bin(const char *str
, u8 dev_type
[WPS_DEV_TYPE_LEN
]);
843 char * wps_dev_type_bin2str(const u8 dev_type
[WPS_DEV_TYPE_LEN
], char *buf
,
845 void uuid_gen_mac_addr(const u8
*mac_addr
, u8
*uuid
);
846 u16
wps_config_methods_str2bin(const char *str
);
847 struct wpabuf
* wps_build_nfc_pw_token(u16 dev_pw_id
,
848 const struct wpabuf
*pubkey
,
849 const struct wpabuf
*dev_pw
);
850 struct wpabuf
* wps_nfc_token_build(int ndef
, int id
, struct wpabuf
*pubkey
,
851 struct wpabuf
*dev_pw
);
852 struct wpabuf
* wps_nfc_token_gen(int ndef
, int *id
, struct wpabuf
**pubkey
,
853 struct wpabuf
**privkey
,
854 struct wpabuf
**dev_pw
);
857 struct wpabuf
* ndef_parse_wifi(const struct wpabuf
*buf
);
858 struct wpabuf
* ndef_build_wifi(const struct wpabuf
*buf
);
859 struct wpabuf
* ndef_build_wifi_hc(int begin
);
860 struct wpabuf
* ndef_build_wifi_hr(void);
862 #ifdef CONFIG_WPS_STRICT
863 int wps_validate_beacon(const struct wpabuf
*wps_ie
);
864 int wps_validate_beacon_probe_resp(const struct wpabuf
*wps_ie
, int probe
,
866 int wps_validate_probe_req(const struct wpabuf
*wps_ie
, const u8
*addr
);
867 int wps_validate_assoc_req(const struct wpabuf
*wps_ie
);
868 int wps_validate_assoc_resp(const struct wpabuf
*wps_ie
);
869 int wps_validate_m1(const struct wpabuf
*tlvs
);
870 int wps_validate_m2(const struct wpabuf
*tlvs
);
871 int wps_validate_m2d(const struct wpabuf
*tlvs
);
872 int wps_validate_m3(const struct wpabuf
*tlvs
);
873 int wps_validate_m4(const struct wpabuf
*tlvs
);
874 int wps_validate_m4_encr(const struct wpabuf
*tlvs
, int wps2
);
875 int wps_validate_m5(const struct wpabuf
*tlvs
);
876 int wps_validate_m5_encr(const struct wpabuf
*tlvs
, int wps2
);
877 int wps_validate_m6(const struct wpabuf
*tlvs
);
878 int wps_validate_m6_encr(const struct wpabuf
*tlvs
, int wps2
);
879 int wps_validate_m7(const struct wpabuf
*tlvs
);
880 int wps_validate_m7_encr(const struct wpabuf
*tlvs
, int ap
, int wps2
);
881 int wps_validate_m8(const struct wpabuf
*tlvs
);
882 int wps_validate_m8_encr(const struct wpabuf
*tlvs
, int ap
, int wps2
);
883 int wps_validate_wsc_ack(const struct wpabuf
*tlvs
);
884 int wps_validate_wsc_nack(const struct wpabuf
*tlvs
);
885 int wps_validate_wsc_done(const struct wpabuf
*tlvs
);
886 int wps_validate_upnp_set_selected_registrar(const struct wpabuf
*tlvs
);
887 #else /* CONFIG_WPS_STRICT */
888 static inline int wps_validate_beacon(const struct wpabuf
*wps_ie
){
892 static inline int wps_validate_beacon_probe_resp(const struct wpabuf
*wps_ie
,
893 int probe
, const u8
*addr
)
898 static inline int wps_validate_probe_req(const struct wpabuf
*wps_ie
,
904 static inline int wps_validate_assoc_req(const struct wpabuf
*wps_ie
)
909 static inline int wps_validate_assoc_resp(const struct wpabuf
*wps_ie
)
914 static inline int wps_validate_m1(const struct wpabuf
*tlvs
)
919 static inline int wps_validate_m2(const struct wpabuf
*tlvs
)
924 static inline int wps_validate_m2d(const struct wpabuf
*tlvs
)
929 static inline int wps_validate_m3(const struct wpabuf
*tlvs
)
934 static inline int wps_validate_m4(const struct wpabuf
*tlvs
)
939 static inline int wps_validate_m4_encr(const struct wpabuf
*tlvs
, int wps2
)
944 static inline int wps_validate_m5(const struct wpabuf
*tlvs
)
949 static inline int wps_validate_m5_encr(const struct wpabuf
*tlvs
, int wps2
)
954 static inline int wps_validate_m6(const struct wpabuf
*tlvs
)
959 static inline int wps_validate_m6_encr(const struct wpabuf
*tlvs
, int wps2
)
964 static inline int wps_validate_m7(const struct wpabuf
*tlvs
)
969 static inline int wps_validate_m7_encr(const struct wpabuf
*tlvs
, int ap
,
975 static inline int wps_validate_m8(const struct wpabuf
*tlvs
)
980 static inline int wps_validate_m8_encr(const struct wpabuf
*tlvs
, int ap
,
986 static inline int wps_validate_wsc_ack(const struct wpabuf
*tlvs
)
991 static inline int wps_validate_wsc_nack(const struct wpabuf
*tlvs
)
996 static inline int wps_validate_wsc_done(const struct wpabuf
*tlvs
)
1001 static inline int wps_validate_upnp_set_selected_registrar(
1002 const struct wpabuf
*tlvs
)
1006 #endif /* CONFIG_WPS_STRICT */