xref: /freebsd/contrib/wpa/src/wps/wps.h (revision a90b9d0159070121c221b966469c3e36d912bf82)
139beb93cSSam Leffler /*
239beb93cSSam Leffler  * Wi-Fi Protected Setup
3780fb4a2SCy Schubert  * Copyright (c) 2007-2016, Jouni Malinen <j@w1.fi>
439beb93cSSam Leffler  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
739beb93cSSam Leffler  */
839beb93cSSam Leffler 
939beb93cSSam Leffler #ifndef WPS_H
1039beb93cSSam Leffler #define WPS_H
1139beb93cSSam Leffler 
12325151a3SRui Paulo #include "common/ieee802_11_defs.h"
1339beb93cSSam Leffler #include "wps_defs.h"
1439beb93cSSam Leffler 
1539beb93cSSam Leffler /**
1639beb93cSSam Leffler  * enum wsc_op_code - EAP-WSC OP-Code values
1739beb93cSSam Leffler  */
1839beb93cSSam Leffler enum wsc_op_code {
1939beb93cSSam Leffler 	WSC_UPnP = 0 /* No OP Code in UPnP transport */,
2039beb93cSSam Leffler 	WSC_Start = 0x01,
2139beb93cSSam Leffler 	WSC_ACK = 0x02,
2239beb93cSSam Leffler 	WSC_NACK = 0x03,
2339beb93cSSam Leffler 	WSC_MSG = 0x04,
2439beb93cSSam Leffler 	WSC_Done = 0x05,
2539beb93cSSam Leffler 	WSC_FRAG_ACK = 0x06
2639beb93cSSam Leffler };
2739beb93cSSam Leffler 
2839beb93cSSam Leffler struct wps_registrar;
2939beb93cSSam Leffler struct upnp_wps_device_sm;
30e28a4053SRui Paulo struct wps_er;
31f05cddf9SRui Paulo struct wps_parse_attr;
3239beb93cSSam Leffler 
3339beb93cSSam Leffler /**
3439beb93cSSam Leffler  * struct wps_credential - WPS Credential
3539beb93cSSam Leffler  * @ssid: SSID
3639beb93cSSam Leffler  * @ssid_len: Length of SSID
3739beb93cSSam Leffler  * @auth_type: Authentication Type (WPS_AUTH_OPEN, .. flags)
3839beb93cSSam Leffler  * @encr_type: Encryption Type (WPS_ENCR_NONE, .. flags)
3939beb93cSSam Leffler  * @key_idx: Key index
4039beb93cSSam Leffler  * @key: Key
4139beb93cSSam Leffler  * @key_len: Key length in octets
423157ba21SRui Paulo  * @mac_addr: MAC address of the Credential receiver
4339beb93cSSam Leffler  * @cred_attr: Unparsed Credential attribute data (used only in cred_cb());
4439beb93cSSam Leffler  *	this may be %NULL, if not used
4539beb93cSSam Leffler  * @cred_attr_len: Length of cred_attr in octets
4639beb93cSSam Leffler  */
4739beb93cSSam Leffler struct wps_credential {
48325151a3SRui Paulo 	u8 ssid[SSID_MAX_LEN];
4939beb93cSSam Leffler 	size_t ssid_len;
5039beb93cSSam Leffler 	u16 auth_type;
5139beb93cSSam Leffler 	u16 encr_type;
5239beb93cSSam Leffler 	u8 key_idx;
5339beb93cSSam Leffler 	u8 key[64];
5439beb93cSSam Leffler 	size_t key_len;
5539beb93cSSam Leffler 	u8 mac_addr[ETH_ALEN];
5639beb93cSSam Leffler 	const u8 *cred_attr;
5739beb93cSSam Leffler 	size_t cred_attr_len;
5839beb93cSSam Leffler };
5939beb93cSSam Leffler 
60e28a4053SRui Paulo #define WPS_DEV_TYPE_LEN 8
61e28a4053SRui Paulo #define WPS_DEV_TYPE_BUFSIZE 21
62f05cddf9SRui Paulo #define WPS_SEC_DEV_TYPE_MAX_LEN 128
63f05cddf9SRui Paulo /* maximum number of advertised WPS vendor extension attributes */
64f05cddf9SRui Paulo #define MAX_WPS_VENDOR_EXTENSIONS 10
65f05cddf9SRui Paulo /* maximum size of WPS Vendor extension attribute */
66f05cddf9SRui Paulo #define WPS_MAX_VENDOR_EXT_LEN 1024
67f05cddf9SRui Paulo /* maximum number of parsed WPS vendor extension attributes */
68f05cddf9SRui Paulo #define MAX_WPS_PARSE_VENDOR_EXT 10
69e28a4053SRui Paulo 
7039beb93cSSam Leffler /**
7139beb93cSSam Leffler  * struct wps_device_data - WPS Device Data
7239beb93cSSam Leffler  * @mac_addr: Device MAC address
7339beb93cSSam Leffler  * @device_name: Device Name (0..32 octets encoded in UTF-8)
7439beb93cSSam Leffler  * @manufacturer: Manufacturer (0..64 octets encoded in UTF-8)
7539beb93cSSam Leffler  * @model_name: Model Name (0..32 octets encoded in UTF-8)
7639beb93cSSam Leffler  * @model_number: Model Number (0..32 octets encoded in UTF-8)
7739beb93cSSam Leffler  * @serial_number: Serial Number (0..32 octets encoded in UTF-8)
78e28a4053SRui Paulo  * @pri_dev_type: Primary Device Type
79f05cddf9SRui Paulo  * @sec_dev_type: Array of secondary device types
80f05cddf9SRui Paulo  * @num_sec_dev_type: Number of secondary device types
8139beb93cSSam Leffler  * @os_version: OS Version
82325151a3SRui Paulo  * @rf_bands: RF bands (WPS_RF_24GHZ, WPS_RF_50GHZ, WPS_RF_60GHZ flags)
83f05cddf9SRui Paulo  * @p2p: Whether the device is a P2P device
8439beb93cSSam Leffler  */
8539beb93cSSam Leffler struct wps_device_data {
8639beb93cSSam Leffler 	u8 mac_addr[ETH_ALEN];
8739beb93cSSam Leffler 	char *device_name;
8839beb93cSSam Leffler 	char *manufacturer;
8939beb93cSSam Leffler 	char *model_name;
9039beb93cSSam Leffler 	char *model_number;
9139beb93cSSam Leffler 	char *serial_number;
92e28a4053SRui Paulo 	u8 pri_dev_type[WPS_DEV_TYPE_LEN];
93f05cddf9SRui Paulo #define WPS_SEC_DEVICE_TYPES 5
94f05cddf9SRui Paulo 	u8 sec_dev_type[WPS_SEC_DEVICE_TYPES][WPS_DEV_TYPE_LEN];
95f05cddf9SRui Paulo 	u8 num_sec_dev_types;
9639beb93cSSam Leffler 	u32 os_version;
9739beb93cSSam Leffler 	u8 rf_bands;
98f05cddf9SRui Paulo 	u16 config_methods;
99f05cddf9SRui Paulo 	struct wpabuf *vendor_ext_m1;
100f05cddf9SRui Paulo 	struct wpabuf *vendor_ext[MAX_WPS_VENDOR_EXTENSIONS];
101c1d255d3SCy Schubert 	struct wpabuf *application_ext;
10239beb93cSSam Leffler 
103f05cddf9SRui Paulo 	int p2p;
1044bc52338SCy Schubert 	u8 multi_ap_ext;
105e28a4053SRui Paulo };
106e28a4053SRui Paulo 
10739beb93cSSam Leffler /**
10839beb93cSSam Leffler  * struct wps_config - WPS configuration for a single registration protocol run
10939beb93cSSam Leffler  */
11039beb93cSSam Leffler struct wps_config {
11139beb93cSSam Leffler 	/**
11239beb93cSSam Leffler 	 * wps - Pointer to long term WPS context
11339beb93cSSam Leffler 	 */
11439beb93cSSam Leffler 	struct wps_context *wps;
11539beb93cSSam Leffler 
11639beb93cSSam Leffler 	/**
11739beb93cSSam Leffler 	 * registrar - Whether this end is a Registrar
11839beb93cSSam Leffler 	 */
11939beb93cSSam Leffler 	int registrar;
12039beb93cSSam Leffler 
12139beb93cSSam Leffler 	/**
12239beb93cSSam Leffler 	 * pin - Enrollee Device Password (%NULL for Registrar or PBC)
12339beb93cSSam Leffler 	 */
12439beb93cSSam Leffler 	const u8 *pin;
12539beb93cSSam Leffler 
12639beb93cSSam Leffler 	/**
12739beb93cSSam Leffler 	 * pin_len - Length on pin in octets
12839beb93cSSam Leffler 	 */
12939beb93cSSam Leffler 	size_t pin_len;
13039beb93cSSam Leffler 
13139beb93cSSam Leffler 	/**
13239beb93cSSam Leffler 	 * pbc - Whether this is protocol run uses PBC
13339beb93cSSam Leffler 	 */
13439beb93cSSam Leffler 	int pbc;
13539beb93cSSam Leffler 
13639beb93cSSam Leffler 	/**
13739beb93cSSam Leffler 	 * assoc_wps_ie: (Re)AssocReq WPS IE (in AP; %NULL if not AP)
13839beb93cSSam Leffler 	 */
13939beb93cSSam Leffler 	const struct wpabuf *assoc_wps_ie;
140e28a4053SRui Paulo 
141e28a4053SRui Paulo 	/**
142e28a4053SRui Paulo 	 * new_ap_settings - New AP settings (%NULL if not used)
143e28a4053SRui Paulo 	 *
144e28a4053SRui Paulo 	 * This parameter provides new AP settings when using a wireless
145e28a4053SRui Paulo 	 * stations as a Registrar to configure the AP. %NULL means that AP
146e28a4053SRui Paulo 	 * will not be reconfigured, i.e., the station will only learn the
147e28a4053SRui Paulo 	 * current AP settings by using AP PIN.
148e28a4053SRui Paulo 	 */
149e28a4053SRui Paulo 	const struct wps_credential *new_ap_settings;
150e28a4053SRui Paulo 
151e28a4053SRui Paulo 	/**
152e28a4053SRui Paulo 	 * peer_addr: MAC address of the peer in AP; %NULL if not AP
153e28a4053SRui Paulo 	 */
154e28a4053SRui Paulo 	const u8 *peer_addr;
155e28a4053SRui Paulo 
156e28a4053SRui Paulo 	/**
157e28a4053SRui Paulo 	 * use_psk_key - Use PSK format key in Credential
158e28a4053SRui Paulo 	 *
159e28a4053SRui Paulo 	 * Force PSK format to be used instead of ASCII passphrase when
160e28a4053SRui Paulo 	 * building Credential for an Enrollee. The PSK value is set in
161e28a4053SRui Paulo 	 * struct wpa_context::psk.
162e28a4053SRui Paulo 	 */
163e28a4053SRui Paulo 	int use_psk_key;
164f05cddf9SRui Paulo 
165f05cddf9SRui Paulo 	/**
166f05cddf9SRui Paulo 	 * dev_pw_id - Device Password ID for Enrollee when PIN is used
167f05cddf9SRui Paulo 	 */
168f05cddf9SRui Paulo 	u16 dev_pw_id;
169f05cddf9SRui Paulo 
170f05cddf9SRui Paulo 	/**
171f05cddf9SRui Paulo 	 * p2p_dev_addr - P2P Device Address from (Re)Association Request
172f05cddf9SRui Paulo 	 *
173f05cddf9SRui Paulo 	 * On AP/GO, this is set to the P2P Device Address of the associating
174f05cddf9SRui Paulo 	 * P2P client if a P2P IE is included in the (Re)Association Request
175f05cddf9SRui Paulo 	 * frame and the P2P Device Address is included. Otherwise, this is set
176f05cddf9SRui Paulo 	 * to %NULL to indicate the station does not have a P2P Device Address.
177f05cddf9SRui Paulo 	 */
178f05cddf9SRui Paulo 	const u8 *p2p_dev_addr;
179f05cddf9SRui Paulo 
180f05cddf9SRui Paulo 	/**
181f05cddf9SRui Paulo 	 * pbc_in_m1 - Do not remove PushButton config method in M1 (AP)
182f05cddf9SRui Paulo 	 *
183f05cddf9SRui Paulo 	 * This can be used to enable a workaround to allow Windows 7 to use
184f05cddf9SRui Paulo 	 * PBC with the AP.
185f05cddf9SRui Paulo 	 */
186f05cddf9SRui Paulo 	int pbc_in_m1;
1875b9c547cSRui Paulo 
1885b9c547cSRui Paulo 	/**
1895b9c547cSRui Paulo 	 * peer_pubkey_hash - Peer public key hash or %NULL if not known
1905b9c547cSRui Paulo 	 */
1915b9c547cSRui Paulo 	const u8 *peer_pubkey_hash;
1924bc52338SCy Schubert 
1934bc52338SCy Schubert 	/**
1944bc52338SCy Schubert 	 * multi_ap_backhaul_sta - Whether this is a Multi-AP backhaul STA
1954bc52338SCy Schubert 	 * enrollee
1964bc52338SCy Schubert 	 */
1974bc52338SCy Schubert 	int multi_ap_backhaul_sta;
198*a90b9d01SCy Schubert 
199*a90b9d01SCy Schubert 	/*
200*a90b9d01SCy Schubert 	 * multi_ap_profile - Get the Multi-AP Profile
201*a90b9d01SCy Schubert 	 */
202*a90b9d01SCy Schubert 	int multi_ap_profile;
20339beb93cSSam Leffler };
20439beb93cSSam Leffler 
20539beb93cSSam Leffler struct wps_data * wps_init(const struct wps_config *cfg);
20639beb93cSSam Leffler 
20739beb93cSSam Leffler void wps_deinit(struct wps_data *data);
20839beb93cSSam Leffler 
20939beb93cSSam Leffler /**
21039beb93cSSam Leffler  * enum wps_process_res - WPS message processing result
21139beb93cSSam Leffler  */
21239beb93cSSam Leffler enum wps_process_res {
21339beb93cSSam Leffler 	/**
21439beb93cSSam Leffler 	 * WPS_DONE - Processing done
21539beb93cSSam Leffler 	 */
21639beb93cSSam Leffler 	WPS_DONE,
21739beb93cSSam Leffler 
21839beb93cSSam Leffler 	/**
21939beb93cSSam Leffler 	 * WPS_CONTINUE - Processing continues
22039beb93cSSam Leffler 	 */
22139beb93cSSam Leffler 	WPS_CONTINUE,
22239beb93cSSam Leffler 
22339beb93cSSam Leffler 	/**
22439beb93cSSam Leffler 	 * WPS_FAILURE - Processing failed
22539beb93cSSam Leffler 	 */
22639beb93cSSam Leffler 	WPS_FAILURE,
22739beb93cSSam Leffler 
22839beb93cSSam Leffler 	/**
22939beb93cSSam Leffler 	 * WPS_PENDING - Processing continues, but waiting for an external
23039beb93cSSam Leffler 	 *	event (e.g., UPnP message from an external Registrar)
23139beb93cSSam Leffler 	 */
23239beb93cSSam Leffler 	WPS_PENDING
23339beb93cSSam Leffler };
23439beb93cSSam Leffler enum wps_process_res wps_process_msg(struct wps_data *wps,
23539beb93cSSam Leffler 				     enum wsc_op_code op_code,
23639beb93cSSam Leffler 				     const struct wpabuf *msg);
23739beb93cSSam Leffler 
23839beb93cSSam Leffler struct wpabuf * wps_get_msg(struct wps_data *wps, enum wsc_op_code *op_code);
23939beb93cSSam Leffler 
24039beb93cSSam Leffler int wps_is_selected_pbc_registrar(const struct wpabuf *msg);
24139beb93cSSam Leffler int wps_is_selected_pin_registrar(const struct wpabuf *msg);
242f05cddf9SRui Paulo int wps_ap_priority_compar(const struct wpabuf *wps_a,
243f05cddf9SRui Paulo 			   const struct wpabuf *wps_b);
244f05cddf9SRui Paulo int wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr,
245f05cddf9SRui Paulo 			   int ver1_compat);
24639beb93cSSam Leffler const u8 * wps_get_uuid_e(const struct wpabuf *msg);
247f05cddf9SRui Paulo int wps_is_20(const struct wpabuf *msg);
24839beb93cSSam Leffler 
24939beb93cSSam Leffler struct wpabuf * wps_build_assoc_req_ie(enum wps_request_type req_type);
250e28a4053SRui Paulo struct wpabuf * wps_build_assoc_resp_ie(void);
251f05cddf9SRui Paulo struct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev,
25239beb93cSSam Leffler 				       const u8 *uuid,
253f05cddf9SRui Paulo 				       enum wps_request_type req_type,
254f05cddf9SRui Paulo 				       unsigned int num_req_dev_types,
255f05cddf9SRui Paulo 				       const u8 *req_dev_types);
25639beb93cSSam Leffler 
25739beb93cSSam Leffler 
25839beb93cSSam Leffler /**
25939beb93cSSam Leffler  * struct wps_registrar_config - WPS Registrar configuration
26039beb93cSSam Leffler  */
26139beb93cSSam Leffler struct wps_registrar_config {
26239beb93cSSam Leffler 	/**
26339beb93cSSam Leffler 	 * new_psk_cb - Callback for new PSK
26439beb93cSSam Leffler 	 * @ctx: Higher layer context data (cb_ctx)
26539beb93cSSam Leffler 	 * @mac_addr: MAC address of the Enrollee
2665b9c547cSRui Paulo 	 * @p2p_dev_addr: P2P Device Address of the Enrollee or all zeros if not
26739beb93cSSam Leffler 	 * @psk: The new PSK
26839beb93cSSam Leffler 	 * @psk_len: The length of psk in octets
26939beb93cSSam Leffler 	 * Returns: 0 on success, -1 on failure
27039beb93cSSam Leffler 	 *
27139beb93cSSam Leffler 	 * This callback is called when a new per-device PSK is provisioned.
27239beb93cSSam Leffler 	 */
2735b9c547cSRui Paulo 	int (*new_psk_cb)(void *ctx, const u8 *mac_addr, const u8 *p2p_dev_addr,
2745b9c547cSRui Paulo 			  const u8 *psk, size_t psk_len);
27539beb93cSSam Leffler 
27639beb93cSSam Leffler 	/**
27739beb93cSSam Leffler 	 * set_ie_cb - Callback for WPS IE changes
27839beb93cSSam Leffler 	 * @ctx: Higher layer context data (cb_ctx)
27939beb93cSSam Leffler 	 * @beacon_ie: WPS IE for Beacon
28039beb93cSSam Leffler 	 * @probe_resp_ie: WPS IE for Probe Response
28139beb93cSSam Leffler 	 * Returns: 0 on success, -1 on failure
28239beb93cSSam Leffler 	 *
28339beb93cSSam Leffler 	 * This callback is called whenever the WPS IE in Beacon or Probe
284e28a4053SRui Paulo 	 * Response frames needs to be changed (AP only). Callee is responsible
285e28a4053SRui Paulo 	 * for freeing the buffers.
28639beb93cSSam Leffler 	 */
287e28a4053SRui Paulo 	int (*set_ie_cb)(void *ctx, struct wpabuf *beacon_ie,
288e28a4053SRui Paulo 			 struct wpabuf *probe_resp_ie);
28939beb93cSSam Leffler 
29039beb93cSSam Leffler 	/**
29139beb93cSSam Leffler 	 * pin_needed_cb - Callback for requesting a PIN
29239beb93cSSam Leffler 	 * @ctx: Higher layer context data (cb_ctx)
29339beb93cSSam Leffler 	 * @uuid_e: UUID-E of the unknown Enrollee
29439beb93cSSam Leffler 	 * @dev: Device Data from the unknown Enrollee
29539beb93cSSam Leffler 	 *
29639beb93cSSam Leffler 	 * This callback is called whenever an unknown Enrollee requests to use
29739beb93cSSam Leffler 	 * PIN method and a matching PIN (Device Password) is not found in
29839beb93cSSam Leffler 	 * Registrar data.
29939beb93cSSam Leffler 	 */
30039beb93cSSam Leffler 	void (*pin_needed_cb)(void *ctx, const u8 *uuid_e,
30139beb93cSSam Leffler 			      const struct wps_device_data *dev);
30239beb93cSSam Leffler 
30339beb93cSSam Leffler 	/**
30439beb93cSSam Leffler 	 * reg_success_cb - Callback for reporting successful registration
30539beb93cSSam Leffler 	 * @ctx: Higher layer context data (cb_ctx)
30639beb93cSSam Leffler 	 * @mac_addr: MAC address of the Enrollee
30739beb93cSSam Leffler 	 * @uuid_e: UUID-E of the Enrollee
308f05cddf9SRui Paulo 	 * @dev_pw: Device Password (PIN) used during registration
309f05cddf9SRui Paulo 	 * @dev_pw_len: Length of dev_pw in octets
31039beb93cSSam Leffler 	 *
31139beb93cSSam Leffler 	 * This callback is called whenever an Enrollee completes registration
31239beb93cSSam Leffler 	 * successfully.
31339beb93cSSam Leffler 	 */
31439beb93cSSam Leffler 	void (*reg_success_cb)(void *ctx, const u8 *mac_addr,
315f05cddf9SRui Paulo 			       const u8 *uuid_e, const u8 *dev_pw,
316f05cddf9SRui Paulo 			       size_t dev_pw_len);
31739beb93cSSam Leffler 
31839beb93cSSam Leffler 	/**
319e28a4053SRui Paulo 	 * set_sel_reg_cb - Callback for reporting selected registrar changes
320e28a4053SRui Paulo 	 * @ctx: Higher layer context data (cb_ctx)
321e28a4053SRui Paulo 	 * @sel_reg: Whether the Registrar is selected
322e28a4053SRui Paulo 	 * @dev_passwd_id: Device Password ID to indicate with method or
323e28a4053SRui Paulo 	 *	specific password the Registrar intends to use
324e28a4053SRui Paulo 	 * @sel_reg_config_methods: Bit field of active config methods
325e28a4053SRui Paulo 	 *
326e28a4053SRui Paulo 	 * This callback is called whenever the Selected Registrar state
327e28a4053SRui Paulo 	 * changes (e.g., a new PIN becomes available or PBC is invoked). This
328e28a4053SRui Paulo 	 * callback is only used by External Registrar implementation;
329e28a4053SRui Paulo 	 * set_ie_cb() is used by AP implementation in similar caes, but it
330e28a4053SRui Paulo 	 * provides the full WPS IE data instead of just the minimal Registrar
331e28a4053SRui Paulo 	 * state information.
332e28a4053SRui Paulo 	 */
333e28a4053SRui Paulo 	void (*set_sel_reg_cb)(void *ctx, int sel_reg, u16 dev_passwd_id,
334e28a4053SRui Paulo 			       u16 sel_reg_config_methods);
335e28a4053SRui Paulo 
336e28a4053SRui Paulo 	/**
337e28a4053SRui Paulo 	 * enrollee_seen_cb - Callback for reporting Enrollee based on ProbeReq
338e28a4053SRui Paulo 	 * @ctx: Higher layer context data (cb_ctx)
339e28a4053SRui Paulo 	 * @addr: MAC address of the Enrollee
340e28a4053SRui Paulo 	 * @uuid_e: UUID of the Enrollee
341e28a4053SRui Paulo 	 * @pri_dev_type: Primary device type
342e28a4053SRui Paulo 	 * @config_methods: Config Methods
343e28a4053SRui Paulo 	 * @dev_password_id: Device Password ID
344e28a4053SRui Paulo 	 * @request_type: Request Type
345e28a4053SRui Paulo 	 * @dev_name: Device Name (if available)
346e28a4053SRui Paulo 	 */
347e28a4053SRui Paulo 	void (*enrollee_seen_cb)(void *ctx, const u8 *addr, const u8 *uuid_e,
348e28a4053SRui Paulo 				 const u8 *pri_dev_type, u16 config_methods,
349e28a4053SRui Paulo 				 u16 dev_password_id, u8 request_type,
350e28a4053SRui Paulo 				 const char *dev_name);
351e28a4053SRui Paulo 
352e28a4053SRui Paulo 	/**
353c1d255d3SCy Schubert 	 * lookup_pskfile_cb - Callback for searching for PSK in wpa_psk_file
354c1d255d3SCy Schubert 	 * @ctx: Higher layer context data (cb_ctx)
355c1d255d3SCy Schubert 	 * @addr: Enrollee's MAC address
356c1d255d3SCy Schubert 	 * @psk: Pointer to found PSK (output arg)
357c1d255d3SCy Schubert 	 */
358c1d255d3SCy Schubert 	int (*lookup_pskfile_cb)(void *ctx, const u8 *mac_addr, const u8 **psk);
359c1d255d3SCy Schubert 
360c1d255d3SCy Schubert 	/**
36139beb93cSSam Leffler 	 * cb_ctx: Higher layer context data for Registrar callbacks
36239beb93cSSam Leffler 	 */
36339beb93cSSam Leffler 	void *cb_ctx;
36439beb93cSSam Leffler 
36539beb93cSSam Leffler 	/**
36639beb93cSSam Leffler 	 * skip_cred_build: Do not build credential
36739beb93cSSam Leffler 	 *
36839beb93cSSam Leffler 	 * This option can be used to disable internal code that builds
36939beb93cSSam Leffler 	 * Credential attribute into M8 based on the current network
37039beb93cSSam Leffler 	 * configuration and Enrollee capabilities. The extra_cred data will
37139beb93cSSam Leffler 	 * then be used as the Credential(s).
37239beb93cSSam Leffler 	 */
37339beb93cSSam Leffler 	int skip_cred_build;
37439beb93cSSam Leffler 
37539beb93cSSam Leffler 	/**
37639beb93cSSam Leffler 	 * extra_cred: Additional Credential attribute(s)
37739beb93cSSam Leffler 	 *
37839beb93cSSam Leffler 	 * This optional data (set to %NULL to disable) can be used to add
37939beb93cSSam Leffler 	 * Credential attribute(s) for other networks into M8. If
38039beb93cSSam Leffler 	 * skip_cred_build is set, this will also override the automatically
38139beb93cSSam Leffler 	 * generated Credential attribute.
38239beb93cSSam Leffler 	 */
38339beb93cSSam Leffler 	const u8 *extra_cred;
38439beb93cSSam Leffler 
38539beb93cSSam Leffler 	/**
38639beb93cSSam Leffler 	 * extra_cred_len: Length of extra_cred in octets
38739beb93cSSam Leffler 	 */
38839beb93cSSam Leffler 	size_t extra_cred_len;
38939beb93cSSam Leffler 
39039beb93cSSam Leffler 	/**
39139beb93cSSam Leffler 	 * disable_auto_conf - Disable auto-configuration on first registration
39239beb93cSSam Leffler 	 *
39339beb93cSSam Leffler 	 * By default, the AP that is started in not configured state will
39439beb93cSSam Leffler 	 * generate a random PSK and move to configured state when the first
39539beb93cSSam Leffler 	 * registration protocol run is completed successfully. This option can
39639beb93cSSam Leffler 	 * be used to disable this functionality and leave it up to an external
39739beb93cSSam Leffler 	 * program to take care of configuration. This requires the extra_cred
39839beb93cSSam Leffler 	 * to be set with a suitable Credential and skip_cred_build being used.
39939beb93cSSam Leffler 	 */
40039beb93cSSam Leffler 	int disable_auto_conf;
4013157ba21SRui Paulo 
4023157ba21SRui Paulo 	/**
403f05cddf9SRui Paulo 	 * dualband - Whether this is a concurrent dualband AP
404f05cddf9SRui Paulo 	 */
405f05cddf9SRui Paulo 	int dualband;
4065b9c547cSRui Paulo 
4075b9c547cSRui Paulo 	/**
4085b9c547cSRui Paulo 	 * force_per_enrollee_psk - Force per-Enrollee random PSK
4095b9c547cSRui Paulo 	 *
4105b9c547cSRui Paulo 	 * This forces per-Enrollee random PSK to be generated even if a default
4115b9c547cSRui Paulo 	 * PSK is set for a network.
4125b9c547cSRui Paulo 	 */
4135b9c547cSRui Paulo 	int force_per_enrollee_psk;
4144bc52338SCy Schubert 
4154bc52338SCy Schubert 	/**
4164bc52338SCy Schubert 	 * multi_ap_backhaul_ssid - SSID to supply to a Multi-AP backhaul
4174bc52338SCy Schubert 	 * enrollee
4184bc52338SCy Schubert 	 *
4194bc52338SCy Schubert 	 * This SSID is used by the Registrar to fill in information for
4204bc52338SCy Schubert 	 * Credentials when the enrollee advertises it is a Multi-AP backhaul
4214bc52338SCy Schubert 	 * STA.
4224bc52338SCy Schubert 	 */
4234bc52338SCy Schubert 	const u8 *multi_ap_backhaul_ssid;
4244bc52338SCy Schubert 
4254bc52338SCy Schubert 	/**
4264bc52338SCy Schubert 	 * multi_ap_backhaul_ssid_len - Length of multi_ap_backhaul_ssid in
4274bc52338SCy Schubert 	 * octets
4284bc52338SCy Schubert 	 */
4294bc52338SCy Schubert 	size_t multi_ap_backhaul_ssid_len;
4304bc52338SCy Schubert 
4314bc52338SCy Schubert 	/**
4324bc52338SCy Schubert 	 * multi_ap_backhaul_network_key - The Network Key (PSK) for the
4334bc52338SCy Schubert 	 * Multi-AP backhaul enrollee.
4344bc52338SCy Schubert 	 *
4354bc52338SCy Schubert 	 * This key can be either the ASCII passphrase (8..63 characters) or the
4364bc52338SCy Schubert 	 * 32-octet PSK (64 hex characters).
4374bc52338SCy Schubert 	 */
4384bc52338SCy Schubert 	const u8 *multi_ap_backhaul_network_key;
4394bc52338SCy Schubert 
4404bc52338SCy Schubert 	/**
4414bc52338SCy Schubert 	 * multi_ap_backhaul_network_key_len - Length of
4424bc52338SCy Schubert 	 * multi_ap_backhaul_network_key in octets
4434bc52338SCy Schubert 	 */
4444bc52338SCy Schubert 	size_t multi_ap_backhaul_network_key_len;
44539beb93cSSam Leffler };
44639beb93cSSam Leffler 
44739beb93cSSam Leffler 
44839beb93cSSam Leffler /**
44939beb93cSSam Leffler  * enum wps_event - WPS event types
45039beb93cSSam Leffler  */
45139beb93cSSam Leffler enum wps_event {
45239beb93cSSam Leffler 	/**
45339beb93cSSam Leffler 	 * WPS_EV_M2D - M2D received (Registrar did not know us)
45439beb93cSSam Leffler 	 */
45539beb93cSSam Leffler 	WPS_EV_M2D,
45639beb93cSSam Leffler 
45739beb93cSSam Leffler 	/**
45839beb93cSSam Leffler 	 * WPS_EV_FAIL - Registration failed
45939beb93cSSam Leffler 	 */
46039beb93cSSam Leffler 	WPS_EV_FAIL,
46139beb93cSSam Leffler 
46239beb93cSSam Leffler 	/**
46339beb93cSSam Leffler 	 * WPS_EV_SUCCESS - Registration succeeded
46439beb93cSSam Leffler 	 */
46539beb93cSSam Leffler 	WPS_EV_SUCCESS,
46639beb93cSSam Leffler 
46739beb93cSSam Leffler 	/**
46839beb93cSSam Leffler 	 * WPS_EV_PWD_AUTH_FAIL - Password authentication failed
46939beb93cSSam Leffler 	 */
4703157ba21SRui Paulo 	WPS_EV_PWD_AUTH_FAIL,
4713157ba21SRui Paulo 
4723157ba21SRui Paulo 	/**
4733157ba21SRui Paulo 	 * WPS_EV_PBC_OVERLAP - PBC session overlap detected
4743157ba21SRui Paulo 	 */
4753157ba21SRui Paulo 	WPS_EV_PBC_OVERLAP,
4763157ba21SRui Paulo 
4773157ba21SRui Paulo 	/**
4783157ba21SRui Paulo 	 * WPS_EV_PBC_TIMEOUT - PBC walktime expired before protocol run start
4793157ba21SRui Paulo 	 */
480e28a4053SRui Paulo 	WPS_EV_PBC_TIMEOUT,
481e28a4053SRui Paulo 
482e28a4053SRui Paulo 	/**
4835b9c547cSRui Paulo 	 * WPS_EV_PBC_ACTIVE - PBC mode was activated
4845b9c547cSRui Paulo 	 */
4855b9c547cSRui Paulo 	WPS_EV_PBC_ACTIVE,
4865b9c547cSRui Paulo 
4875b9c547cSRui Paulo 	/**
4885b9c547cSRui Paulo 	 * WPS_EV_PBC_DISABLE - PBC mode was disabled
4895b9c547cSRui Paulo 	 */
4905b9c547cSRui Paulo 	WPS_EV_PBC_DISABLE,
4915b9c547cSRui Paulo 
4925b9c547cSRui Paulo 	/**
493e28a4053SRui Paulo 	 * WPS_EV_ER_AP_ADD - ER: AP added
494e28a4053SRui Paulo 	 */
495e28a4053SRui Paulo 	WPS_EV_ER_AP_ADD,
496e28a4053SRui Paulo 
497e28a4053SRui Paulo 	/**
498e28a4053SRui Paulo 	 * WPS_EV_ER_AP_REMOVE - ER: AP removed
499e28a4053SRui Paulo 	 */
500e28a4053SRui Paulo 	WPS_EV_ER_AP_REMOVE,
501e28a4053SRui Paulo 
502e28a4053SRui Paulo 	/**
503e28a4053SRui Paulo 	 * WPS_EV_ER_ENROLLEE_ADD - ER: Enrollee added
504e28a4053SRui Paulo 	 */
505e28a4053SRui Paulo 	WPS_EV_ER_ENROLLEE_ADD,
506e28a4053SRui Paulo 
507e28a4053SRui Paulo 	/**
508e28a4053SRui Paulo 	 * WPS_EV_ER_ENROLLEE_REMOVE - ER: Enrollee removed
509e28a4053SRui Paulo 	 */
510f05cddf9SRui Paulo 	WPS_EV_ER_ENROLLEE_REMOVE,
511f05cddf9SRui Paulo 
512f05cddf9SRui Paulo 	/**
513f05cddf9SRui Paulo 	 * WPS_EV_ER_AP_SETTINGS - ER: AP Settings learned
514f05cddf9SRui Paulo 	 */
515f05cddf9SRui Paulo 	WPS_EV_ER_AP_SETTINGS,
516f05cddf9SRui Paulo 
517f05cddf9SRui Paulo 	/**
518f05cddf9SRui Paulo 	 * WPS_EV_ER_SET_SELECTED_REGISTRAR - ER: SetSelectedRegistrar event
519f05cddf9SRui Paulo 	 */
520f05cddf9SRui Paulo 	WPS_EV_ER_SET_SELECTED_REGISTRAR,
521f05cddf9SRui Paulo 
522f05cddf9SRui Paulo 	/**
523f05cddf9SRui Paulo 	 * WPS_EV_AP_PIN_SUCCESS - External Registrar used correct AP PIN
524f05cddf9SRui Paulo 	 */
525f05cddf9SRui Paulo 	WPS_EV_AP_PIN_SUCCESS
52639beb93cSSam Leffler };
52739beb93cSSam Leffler 
52839beb93cSSam Leffler /**
52939beb93cSSam Leffler  * union wps_event_data - WPS event data
53039beb93cSSam Leffler  */
53139beb93cSSam Leffler union wps_event_data {
53239beb93cSSam Leffler 	/**
53339beb93cSSam Leffler 	 * struct wps_event_m2d - M2D event data
53439beb93cSSam Leffler 	 */
53539beb93cSSam Leffler 	struct wps_event_m2d {
53639beb93cSSam Leffler 		u16 config_methods;
53739beb93cSSam Leffler 		const u8 *manufacturer;
53839beb93cSSam Leffler 		size_t manufacturer_len;
53939beb93cSSam Leffler 		const u8 *model_name;
54039beb93cSSam Leffler 		size_t model_name_len;
54139beb93cSSam Leffler 		const u8 *model_number;
54239beb93cSSam Leffler 		size_t model_number_len;
54339beb93cSSam Leffler 		const u8 *serial_number;
54439beb93cSSam Leffler 		size_t serial_number_len;
54539beb93cSSam Leffler 		const u8 *dev_name;
54639beb93cSSam Leffler 		size_t dev_name_len;
54739beb93cSSam Leffler 		const u8 *primary_dev_type; /* 8 octets */
54839beb93cSSam Leffler 		u16 config_error;
54939beb93cSSam Leffler 		u16 dev_password_id;
55039beb93cSSam Leffler 	} m2d;
55139beb93cSSam Leffler 
55239beb93cSSam Leffler 	/**
55339beb93cSSam Leffler 	 * struct wps_event_fail - Registration failure information
55439beb93cSSam Leffler 	 * @msg: enum wps_msg_type
55539beb93cSSam Leffler 	 */
55639beb93cSSam Leffler 	struct wps_event_fail {
55739beb93cSSam Leffler 		int msg;
558f05cddf9SRui Paulo 		u16 config_error;
559f05cddf9SRui Paulo 		u16 error_indication;
5605b9c547cSRui Paulo 		u8 peer_macaddr[ETH_ALEN];
56139beb93cSSam Leffler 	} fail;
56239beb93cSSam Leffler 
5635b9c547cSRui Paulo 	struct wps_event_success {
5645b9c547cSRui Paulo 		u8 peer_macaddr[ETH_ALEN];
5655b9c547cSRui Paulo 	} success;
5665b9c547cSRui Paulo 
56739beb93cSSam Leffler 	struct wps_event_pwd_auth_fail {
56839beb93cSSam Leffler 		int enrollee;
56939beb93cSSam Leffler 		int part;
5705b9c547cSRui Paulo 		u8 peer_macaddr[ETH_ALEN];
57139beb93cSSam Leffler 	} pwd_auth_fail;
572e28a4053SRui Paulo 
573e28a4053SRui Paulo 	struct wps_event_er_ap {
574e28a4053SRui Paulo 		const u8 *uuid;
575e28a4053SRui Paulo 		const u8 *mac_addr;
576e28a4053SRui Paulo 		const char *friendly_name;
577e28a4053SRui Paulo 		const char *manufacturer;
578e28a4053SRui Paulo 		const char *manufacturer_url;
579e28a4053SRui Paulo 		const char *model_description;
580e28a4053SRui Paulo 		const char *model_name;
581e28a4053SRui Paulo 		const char *model_number;
582e28a4053SRui Paulo 		const char *model_url;
583e28a4053SRui Paulo 		const char *serial_number;
584e28a4053SRui Paulo 		const char *upc;
585e28a4053SRui Paulo 		const u8 *pri_dev_type;
586e28a4053SRui Paulo 		u8 wps_state;
587e28a4053SRui Paulo 	} ap;
588e28a4053SRui Paulo 
589e28a4053SRui Paulo 	struct wps_event_er_enrollee {
590e28a4053SRui Paulo 		const u8 *uuid;
591e28a4053SRui Paulo 		const u8 *mac_addr;
592e28a4053SRui Paulo 		int m1_received;
593e28a4053SRui Paulo 		u16 config_methods;
594e28a4053SRui Paulo 		u16 dev_passwd_id;
595e28a4053SRui Paulo 		const u8 *pri_dev_type;
596e28a4053SRui Paulo 		const char *dev_name;
597e28a4053SRui Paulo 		const char *manufacturer;
598e28a4053SRui Paulo 		const char *model_name;
599e28a4053SRui Paulo 		const char *model_number;
600e28a4053SRui Paulo 		const char *serial_number;
601e28a4053SRui Paulo 	} enrollee;
602f05cddf9SRui Paulo 
603f05cddf9SRui Paulo 	struct wps_event_er_ap_settings {
604f05cddf9SRui Paulo 		const u8 *uuid;
605f05cddf9SRui Paulo 		const struct wps_credential *cred;
606f05cddf9SRui Paulo 	} ap_settings;
607f05cddf9SRui Paulo 
608f05cddf9SRui Paulo 	struct wps_event_er_set_selected_registrar {
609f05cddf9SRui Paulo 		const u8 *uuid;
610f05cddf9SRui Paulo 		int sel_reg;
611f05cddf9SRui Paulo 		u16 dev_passwd_id;
612f05cddf9SRui Paulo 		u16 sel_reg_config_methods;
613f05cddf9SRui Paulo 		enum {
614f05cddf9SRui Paulo 			WPS_ER_SET_SEL_REG_START,
615f05cddf9SRui Paulo 			WPS_ER_SET_SEL_REG_DONE,
616f05cddf9SRui Paulo 			WPS_ER_SET_SEL_REG_FAILED
617f05cddf9SRui Paulo 		} state;
618f05cddf9SRui Paulo 	} set_sel_reg;
61939beb93cSSam Leffler };
62039beb93cSSam Leffler 
62139beb93cSSam Leffler /**
62239beb93cSSam Leffler  * struct upnp_pending_message - Pending PutWLANResponse messages
62339beb93cSSam Leffler  * @next: Pointer to next pending message or %NULL
62439beb93cSSam Leffler  * @addr: NewWLANEventMAC
62539beb93cSSam Leffler  * @msg: NewMessage
62639beb93cSSam Leffler  * @type: Message Type
62739beb93cSSam Leffler  */
62839beb93cSSam Leffler struct upnp_pending_message {
62939beb93cSSam Leffler 	struct upnp_pending_message *next;
63039beb93cSSam Leffler 	u8 addr[ETH_ALEN];
63139beb93cSSam Leffler 	struct wpabuf *msg;
63239beb93cSSam Leffler 	enum wps_msg_type type;
63339beb93cSSam Leffler };
63439beb93cSSam Leffler 
63539beb93cSSam Leffler /**
63639beb93cSSam Leffler  * struct wps_context - Long term WPS context data
63739beb93cSSam Leffler  *
63839beb93cSSam Leffler  * This data is stored at the higher layer Authenticator or Supplicant data
63939beb93cSSam Leffler  * structures and it is maintained over multiple registration protocol runs.
64039beb93cSSam Leffler  */
64139beb93cSSam Leffler struct wps_context {
64239beb93cSSam Leffler 	/**
64339beb93cSSam Leffler 	 * ap - Whether the local end is an access point
64439beb93cSSam Leffler 	 */
64539beb93cSSam Leffler 	int ap;
64639beb93cSSam Leffler 
64739beb93cSSam Leffler 	/**
64839beb93cSSam Leffler 	 * registrar - Pointer to WPS registrar data from wps_registrar_init()
64939beb93cSSam Leffler 	 */
65039beb93cSSam Leffler 	struct wps_registrar *registrar;
65139beb93cSSam Leffler 
65239beb93cSSam Leffler 	/**
65339beb93cSSam Leffler 	 * wps_state - Current WPS state
65439beb93cSSam Leffler 	 */
65539beb93cSSam Leffler 	enum wps_state wps_state;
65639beb93cSSam Leffler 
65739beb93cSSam Leffler 	/**
65839beb93cSSam Leffler 	 * ap_setup_locked - Whether AP setup is locked (only used at AP)
65939beb93cSSam Leffler 	 */
66039beb93cSSam Leffler 	int ap_setup_locked;
66139beb93cSSam Leffler 
66239beb93cSSam Leffler 	/**
66339beb93cSSam Leffler 	 * uuid - Own UUID
66439beb93cSSam Leffler 	 */
66539beb93cSSam Leffler 	u8 uuid[16];
66639beb93cSSam Leffler 
66739beb93cSSam Leffler 	/**
66839beb93cSSam Leffler 	 * ssid - SSID
66939beb93cSSam Leffler 	 *
67039beb93cSSam Leffler 	 * This SSID is used by the Registrar to fill in information for
67139beb93cSSam Leffler 	 * Credentials. In addition, AP uses it when acting as an Enrollee to
67239beb93cSSam Leffler 	 * notify Registrar of the current configuration.
67339beb93cSSam Leffler 	 */
674325151a3SRui Paulo 	u8 ssid[SSID_MAX_LEN];
67539beb93cSSam Leffler 
67639beb93cSSam Leffler 	/**
67739beb93cSSam Leffler 	 * ssid_len - Length of ssid in octets
67839beb93cSSam Leffler 	 */
67939beb93cSSam Leffler 	size_t ssid_len;
68039beb93cSSam Leffler 
68139beb93cSSam Leffler 	/**
68239beb93cSSam Leffler 	 * dev - Own WPS device data
68339beb93cSSam Leffler 	 */
68439beb93cSSam Leffler 	struct wps_device_data dev;
68539beb93cSSam Leffler 
68639beb93cSSam Leffler 	/**
687e28a4053SRui Paulo 	 * dh_ctx - Context data for Diffie-Hellman operation
688e28a4053SRui Paulo 	 */
689e28a4053SRui Paulo 	void *dh_ctx;
690e28a4053SRui Paulo 
691e28a4053SRui Paulo 	/**
692e28a4053SRui Paulo 	 * dh_privkey - Diffie-Hellman private key
693e28a4053SRui Paulo 	 */
694e28a4053SRui Paulo 	struct wpabuf *dh_privkey;
695e28a4053SRui Paulo 
696e28a4053SRui Paulo 	/**
697e28a4053SRui Paulo 	 * dh_pubkey_oob - Diffie-Hellman public key
698e28a4053SRui Paulo 	 */
699e28a4053SRui Paulo 	struct wpabuf *dh_pubkey;
700e28a4053SRui Paulo 
701e28a4053SRui Paulo 	/**
70239beb93cSSam Leffler 	 * config_methods - Enabled configuration methods
70339beb93cSSam Leffler 	 *
70439beb93cSSam Leffler 	 * Bit field of WPS_CONFIG_*
70539beb93cSSam Leffler 	 */
70639beb93cSSam Leffler 	u16 config_methods;
70739beb93cSSam Leffler 
70839beb93cSSam Leffler 	/**
70939beb93cSSam Leffler 	 * encr_types - Enabled encryption types (bit field of WPS_ENCR_*)
71039beb93cSSam Leffler 	 */
71139beb93cSSam Leffler 	u16 encr_types;
71239beb93cSSam Leffler 
71339beb93cSSam Leffler 	/**
714780fb4a2SCy Schubert 	 * encr_types_rsn - Enabled encryption types for RSN (WPS_ENCR_*)
715780fb4a2SCy Schubert 	 */
716780fb4a2SCy Schubert 	u16 encr_types_rsn;
717780fb4a2SCy Schubert 
718780fb4a2SCy Schubert 	/**
719780fb4a2SCy Schubert 	 * encr_types_wpa - Enabled encryption types for WPA (WPS_ENCR_*)
720780fb4a2SCy Schubert 	 */
721780fb4a2SCy Schubert 	u16 encr_types_wpa;
722780fb4a2SCy Schubert 
723780fb4a2SCy Schubert 	/**
72439beb93cSSam Leffler 	 * auth_types - Authentication types (bit field of WPS_AUTH_*)
72539beb93cSSam Leffler 	 */
72639beb93cSSam Leffler 	u16 auth_types;
72739beb93cSSam Leffler 
72839beb93cSSam Leffler 	/**
7295b9c547cSRui Paulo 	 * encr_types - Current AP encryption type (WPS_ENCR_*)
7305b9c547cSRui Paulo 	 */
7315b9c547cSRui Paulo 	u16 ap_encr_type;
7325b9c547cSRui Paulo 
7335b9c547cSRui Paulo 	/**
7345b9c547cSRui Paulo 	 * ap_auth_type - Current AP authentication types (WPS_AUTH_*)
7355b9c547cSRui Paulo 	 */
7365b9c547cSRui Paulo 	u16 ap_auth_type;
7375b9c547cSRui Paulo 
7385b9c547cSRui Paulo 	/**
73939beb93cSSam Leffler 	 * network_key - The current Network Key (PSK) or %NULL to generate new
74039beb93cSSam Leffler 	 *
74139beb93cSSam Leffler 	 * If %NULL, Registrar will generate per-device PSK. In addition, AP
74239beb93cSSam Leffler 	 * uses this when acting as an Enrollee to notify Registrar of the
74339beb93cSSam Leffler 	 * current configuration.
744e28a4053SRui Paulo 	 *
745206b73d0SCy Schubert 	 * When using WPA/WPA2-Personal, this key can be either the ASCII
746e28a4053SRui Paulo 	 * passphrase (8..63 characters) or the 32-octet PSK (64 hex
747e28a4053SRui Paulo 	 * characters). When this is set to the ASCII passphrase, the PSK can
748e28a4053SRui Paulo 	 * be provided in the psk buffer and used per-Enrollee to control which
749e28a4053SRui Paulo 	 * key type is included in the Credential (e.g., to reduce calculation
750e28a4053SRui Paulo 	 * need on low-powered devices by provisioning PSK while still allowing
751e28a4053SRui Paulo 	 * other devices to get the passphrase).
75239beb93cSSam Leffler 	 */
75339beb93cSSam Leffler 	u8 *network_key;
75439beb93cSSam Leffler 
75539beb93cSSam Leffler 	/**
75639beb93cSSam Leffler 	 * network_key_len - Length of network_key in octets
75739beb93cSSam Leffler 	 */
75839beb93cSSam Leffler 	size_t network_key_len;
75939beb93cSSam Leffler 
76039beb93cSSam Leffler 	/**
761e28a4053SRui Paulo 	 * psk - The current network PSK
762e28a4053SRui Paulo 	 *
763e28a4053SRui Paulo 	 * This optional value can be used to provide the current PSK if
764e28a4053SRui Paulo 	 * network_key is set to the ASCII passphrase.
765e28a4053SRui Paulo 	 */
766e28a4053SRui Paulo 	u8 psk[32];
767e28a4053SRui Paulo 
768e28a4053SRui Paulo 	/**
769e28a4053SRui Paulo 	 * psk_set - Whether psk value is set
770e28a4053SRui Paulo 	 */
771e28a4053SRui Paulo 	int psk_set;
772e28a4053SRui Paulo 
773e28a4053SRui Paulo 	/**
77439beb93cSSam Leffler 	 * ap_settings - AP Settings override for M7 (only used at AP)
77539beb93cSSam Leffler 	 *
77639beb93cSSam Leffler 	 * If %NULL, AP Settings attributes will be generated based on the
77739beb93cSSam Leffler 	 * current network configuration.
77839beb93cSSam Leffler 	 */
77939beb93cSSam Leffler 	u8 *ap_settings;
78039beb93cSSam Leffler 
78139beb93cSSam Leffler 	/**
78239beb93cSSam Leffler 	 * ap_settings_len - Length of ap_settings in octets
78339beb93cSSam Leffler 	 */
78439beb93cSSam Leffler 	size_t ap_settings_len;
78539beb93cSSam Leffler 
78639beb93cSSam Leffler 	/**
78739beb93cSSam Leffler 	 * friendly_name - Friendly Name (required for UPnP)
78839beb93cSSam Leffler 	 */
78939beb93cSSam Leffler 	char *friendly_name;
79039beb93cSSam Leffler 
79139beb93cSSam Leffler 	/**
79239beb93cSSam Leffler 	 * manufacturer_url - Manufacturer URL (optional for UPnP)
79339beb93cSSam Leffler 	 */
79439beb93cSSam Leffler 	char *manufacturer_url;
79539beb93cSSam Leffler 
79639beb93cSSam Leffler 	/**
79739beb93cSSam Leffler 	 * model_description - Model Description (recommended for UPnP)
79839beb93cSSam Leffler 	 */
79939beb93cSSam Leffler 	char *model_description;
80039beb93cSSam Leffler 
80139beb93cSSam Leffler 	/**
80239beb93cSSam Leffler 	 * model_url - Model URL (optional for UPnP)
80339beb93cSSam Leffler 	 */
80439beb93cSSam Leffler 	char *model_url;
80539beb93cSSam Leffler 
80639beb93cSSam Leffler 	/**
80739beb93cSSam Leffler 	 * upc - Universal Product Code (optional for UPnP)
80839beb93cSSam Leffler 	 */
80939beb93cSSam Leffler 	char *upc;
81039beb93cSSam Leffler 
81139beb93cSSam Leffler 	/**
81239beb93cSSam Leffler 	 * cred_cb - Callback to notify that new Credentials were received
81339beb93cSSam Leffler 	 * @ctx: Higher layer context data (cb_ctx)
81439beb93cSSam Leffler 	 * @cred: The received Credential
81539beb93cSSam Leffler 	 * Return: 0 on success, -1 on failure
81639beb93cSSam Leffler 	 */
81739beb93cSSam Leffler 	int (*cred_cb)(void *ctx, const struct wps_credential *cred);
81839beb93cSSam Leffler 
81939beb93cSSam Leffler 	/**
82039beb93cSSam Leffler 	 * event_cb - Event callback (state information about progress)
82139beb93cSSam Leffler 	 * @ctx: Higher layer context data (cb_ctx)
82239beb93cSSam Leffler 	 * @event: Event type
82339beb93cSSam Leffler 	 * @data: Event data
82439beb93cSSam Leffler 	 */
82539beb93cSSam Leffler 	void (*event_cb)(void *ctx, enum wps_event event,
82639beb93cSSam Leffler 			 union wps_event_data *data);
82739beb93cSSam Leffler 
82839beb93cSSam Leffler 	/**
8295b9c547cSRui Paulo 	 * rf_band_cb - Fetch currently used RF band
8305b9c547cSRui Paulo 	 * @ctx: Higher layer context data (cb_ctx)
8315b9c547cSRui Paulo 	 * Return: Current used RF band or 0 if not known
8325b9c547cSRui Paulo 	 */
8335b9c547cSRui Paulo 	int (*rf_band_cb)(void *ctx);
8345b9c547cSRui Paulo 
8355b9c547cSRui Paulo 	/**
83639beb93cSSam Leffler 	 * cb_ctx: Higher layer context data for callbacks
83739beb93cSSam Leffler 	 */
83839beb93cSSam Leffler 	void *cb_ctx;
83939beb93cSSam Leffler 
84039beb93cSSam Leffler 	struct upnp_wps_device_sm *wps_upnp;
84139beb93cSSam Leffler 
84239beb93cSSam Leffler 	/* Pending messages from UPnP PutWLANResponse */
84339beb93cSSam Leffler 	struct upnp_pending_message *upnp_msgs;
84439beb93cSSam Leffler 
845f05cddf9SRui Paulo 	u16 ap_nfc_dev_pw_id;
846f05cddf9SRui Paulo 	struct wpabuf *ap_nfc_dh_pubkey;
847f05cddf9SRui Paulo 	struct wpabuf *ap_nfc_dh_privkey;
848f05cddf9SRui Paulo 	struct wpabuf *ap_nfc_dev_pw;
849c1d255d3SCy Schubert 
850c1d255d3SCy Schubert 	/* Whether to send WPA2-PSK passphrase as a passphrase instead of PSK
851c1d255d3SCy Schubert 	 * for WPA3-Personal transition mode needs. */
852c1d255d3SCy Schubert 	bool use_passphrase;
853e28a4053SRui Paulo };
85439beb93cSSam Leffler 
85539beb93cSSam Leffler struct wps_registrar *
85639beb93cSSam Leffler wps_registrar_init(struct wps_context *wps,
85739beb93cSSam Leffler 		   const struct wps_registrar_config *cfg);
85839beb93cSSam Leffler void wps_registrar_deinit(struct wps_registrar *reg);
859f05cddf9SRui Paulo int wps_registrar_add_pin(struct wps_registrar *reg, const u8 *addr,
860f05cddf9SRui Paulo 			  const u8 *uuid, const u8 *pin, size_t pin_len,
861f05cddf9SRui Paulo 			  int timeout);
86239beb93cSSam Leffler int wps_registrar_invalidate_pin(struct wps_registrar *reg, const u8 *uuid);
863f05cddf9SRui Paulo int wps_registrar_wps_cancel(struct wps_registrar *reg);
86439beb93cSSam Leffler int wps_registrar_unlock_pin(struct wps_registrar *reg, const u8 *uuid);
865f05cddf9SRui Paulo int wps_registrar_button_pushed(struct wps_registrar *reg,
866f05cddf9SRui Paulo 				const u8 *p2p_dev_addr);
867f05cddf9SRui Paulo void wps_registrar_complete(struct wps_registrar *registrar, const u8 *uuid_e,
868f05cddf9SRui Paulo 			    const u8 *dev_pw, size_t dev_pw_len);
86939beb93cSSam Leffler void wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr,
870f05cddf9SRui Paulo 				const struct wpabuf *wps_data,
871f05cddf9SRui Paulo 				int p2p_wildcard);
87239beb93cSSam Leffler int wps_registrar_update_ie(struct wps_registrar *reg);
873e28a4053SRui Paulo int wps_registrar_get_info(struct wps_registrar *reg, const u8 *addr,
874e28a4053SRui Paulo 			   char *buf, size_t buflen);
875f05cddf9SRui Paulo int wps_registrar_config_ap(struct wps_registrar *reg,
876f05cddf9SRui Paulo 			    struct wps_credential *cred);
877f05cddf9SRui Paulo int wps_registrar_add_nfc_pw_token(struct wps_registrar *reg,
878f05cddf9SRui Paulo 				   const u8 *pubkey_hash, u16 pw_id,
8795b9c547cSRui Paulo 				   const u8 *dev_pw, size_t dev_pw_len,
8805b9c547cSRui Paulo 				   int pk_hash_provided_oob);
881f05cddf9SRui Paulo int wps_registrar_add_nfc_password_token(struct wps_registrar *reg,
882f05cddf9SRui Paulo 					 const u8 *oob_dev_pw,
883f05cddf9SRui Paulo 					 size_t oob_dev_pw_len);
8845b9c547cSRui Paulo void wps_registrar_flush(struct wps_registrar *reg);
885c1d255d3SCy Schubert int wps_registrar_update_multi_ap(struct wps_registrar *reg,
886c1d255d3SCy Schubert 				  const u8 *multi_ap_backhaul_ssid,
887c1d255d3SCy Schubert 				  size_t multi_ap_backhaul_ssid_len,
888c1d255d3SCy Schubert 				  const u8 *multi_ap_backhaul_network_key,
889c1d255d3SCy Schubert 				  size_t multi_ap_backhaul_network_key_len);
890f05cddf9SRui Paulo 
891f05cddf9SRui Paulo int wps_build_credential_wrap(struct wpabuf *msg,
892f05cddf9SRui Paulo 			      const struct wps_credential *cred);
89339beb93cSSam Leffler 
89439beb93cSSam Leffler unsigned int wps_pin_checksum(unsigned int pin);
89539beb93cSSam Leffler unsigned int wps_pin_valid(unsigned int pin);
896780fb4a2SCy Schubert int wps_generate_pin(unsigned int *pin);
897f05cddf9SRui Paulo int wps_pin_str_valid(const char *pin);
89839beb93cSSam Leffler void wps_free_pending_msgs(struct upnp_pending_message *msgs);
89939beb93cSSam Leffler 
9005b9c547cSRui Paulo struct wpabuf * wps_get_oob_cred(struct wps_context *wps, int rf_band,
9015b9c547cSRui Paulo 				 int channel);
902f05cddf9SRui Paulo int wps_oob_use_cred(struct wps_context *wps, struct wps_parse_attr *attr);
903e28a4053SRui Paulo int wps_attr_text(struct wpabuf *data, char *buf, char *end);
9045b9c547cSRui Paulo const char * wps_ei_str(enum wps_error_indication ei);
905e28a4053SRui Paulo 
906f05cddf9SRui Paulo struct wps_er * wps_er_init(struct wps_context *wps, const char *ifname,
907f05cddf9SRui Paulo 			    const char *filter);
908e28a4053SRui Paulo void wps_er_refresh(struct wps_er *er);
909e28a4053SRui Paulo void wps_er_deinit(struct wps_er *er, void (*cb)(void *ctx), void *ctx);
910e28a4053SRui Paulo void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
911e28a4053SRui Paulo 			u16 sel_reg_config_methods);
9125b9c547cSRui Paulo int wps_er_pbc(struct wps_er *er, const u8 *uuid, const u8 *addr);
9135b9c547cSRui Paulo const u8 * wps_er_get_sta_uuid(struct wps_er *er, const u8 *addr);
9145b9c547cSRui Paulo int wps_er_learn(struct wps_er *er, const u8 *uuid, const u8 *addr,
9155b9c547cSRui Paulo 		 const u8 *pin, size_t pin_len);
9165b9c547cSRui Paulo int wps_er_set_config(struct wps_er *er, const u8 *uuid, const u8 *addr,
917f05cddf9SRui Paulo 		      const struct wps_credential *cred);
9185b9c547cSRui Paulo int wps_er_config(struct wps_er *er, const u8 *uuid, const u8 *addr,
9195b9c547cSRui Paulo 		  const u8 *pin, size_t pin_len,
9205b9c547cSRui Paulo 		  const struct wps_credential *cred);
9215b9c547cSRui Paulo struct wpabuf * wps_er_config_token_from_cred(struct wps_context *wps,
9225b9c547cSRui Paulo 					      struct wps_credential *cred);
9235b9c547cSRui Paulo struct wpabuf * wps_er_nfc_config_token(struct wps_er *er, const u8 *uuid,
9245b9c547cSRui Paulo 					const u8 *addr);
9255b9c547cSRui Paulo struct wpabuf * wps_er_nfc_handover_sel(struct wps_er *er,
9265b9c547cSRui Paulo 					struct wps_context *wps, const u8 *uuid,
9275b9c547cSRui Paulo 					const u8 *addr, struct wpabuf *pubkey);
928e28a4053SRui Paulo 
929e28a4053SRui Paulo int wps_dev_type_str2bin(const char *str, u8 dev_type[WPS_DEV_TYPE_LEN]);
930e28a4053SRui Paulo char * wps_dev_type_bin2str(const u8 dev_type[WPS_DEV_TYPE_LEN], char *buf,
931e28a4053SRui Paulo 			    size_t buf_len);
932e28a4053SRui Paulo void uuid_gen_mac_addr(const u8 *mac_addr, u8 *uuid);
933e28a4053SRui Paulo u16 wps_config_methods_str2bin(const char *str);
934f05cddf9SRui Paulo struct wpabuf * wps_build_nfc_pw_token(u16 dev_pw_id,
935f05cddf9SRui Paulo 				       const struct wpabuf *pubkey,
936f05cddf9SRui Paulo 				       const struct wpabuf *dev_pw);
9375b9c547cSRui Paulo struct wpabuf * wps_nfc_token_build(int ndef, int id, struct wpabuf *pubkey,
9385b9c547cSRui Paulo 				    struct wpabuf *dev_pw);
9395b9c547cSRui Paulo int wps_nfc_gen_dh(struct wpabuf **pubkey, struct wpabuf **privkey);
940f05cddf9SRui Paulo struct wpabuf * wps_nfc_token_gen(int ndef, int *id, struct wpabuf **pubkey,
941f05cddf9SRui Paulo 				  struct wpabuf **privkey,
942f05cddf9SRui Paulo 				  struct wpabuf **dev_pw);
9435b9c547cSRui Paulo struct wpabuf * wps_build_nfc_handover_req(struct wps_context *ctx,
9445b9c547cSRui Paulo 					   struct wpabuf *nfc_dh_pubkey);
9455b9c547cSRui Paulo struct wpabuf * wps_build_nfc_handover_sel(struct wps_context *ctx,
9465b9c547cSRui Paulo 					   struct wpabuf *nfc_dh_pubkey,
9475b9c547cSRui Paulo 					   const u8 *bssid, int freq);
9485b9c547cSRui Paulo struct wpabuf * wps_build_nfc_handover_req_p2p(struct wps_context *ctx,
9495b9c547cSRui Paulo 					       struct wpabuf *nfc_dh_pubkey);
9505b9c547cSRui Paulo struct wpabuf * wps_build_nfc_handover_sel_p2p(struct wps_context *ctx,
9515b9c547cSRui Paulo 					       int nfc_dev_pw_id,
9525b9c547cSRui Paulo 					       struct wpabuf *nfc_dh_pubkey,
9535b9c547cSRui Paulo 					       struct wpabuf *nfc_dev_pw);
954f05cddf9SRui Paulo 
955f05cddf9SRui Paulo /* ndef.c */
956f05cddf9SRui Paulo struct wpabuf * ndef_parse_wifi(const struct wpabuf *buf);
957f05cddf9SRui Paulo struct wpabuf * ndef_build_wifi(const struct wpabuf *buf);
9585b9c547cSRui Paulo struct wpabuf * ndef_parse_p2p(const struct wpabuf *buf);
9595b9c547cSRui Paulo struct wpabuf * ndef_build_p2p(const struct wpabuf *buf);
960f05cddf9SRui Paulo 
961f05cddf9SRui Paulo #ifdef CONFIG_WPS_STRICT
962f05cddf9SRui Paulo int wps_validate_beacon(const struct wpabuf *wps_ie);
963f05cddf9SRui Paulo int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe,
964f05cddf9SRui Paulo 				   const u8 *addr);
965f05cddf9SRui Paulo int wps_validate_probe_req(const struct wpabuf *wps_ie, const u8 *addr);
966f05cddf9SRui Paulo int wps_validate_assoc_req(const struct wpabuf *wps_ie);
967f05cddf9SRui Paulo int wps_validate_assoc_resp(const struct wpabuf *wps_ie);
968f05cddf9SRui Paulo int wps_validate_m1(const struct wpabuf *tlvs);
969f05cddf9SRui Paulo int wps_validate_m2(const struct wpabuf *tlvs);
970f05cddf9SRui Paulo int wps_validate_m2d(const struct wpabuf *tlvs);
971f05cddf9SRui Paulo int wps_validate_m3(const struct wpabuf *tlvs);
972f05cddf9SRui Paulo int wps_validate_m4(const struct wpabuf *tlvs);
973f05cddf9SRui Paulo int wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2);
974f05cddf9SRui Paulo int wps_validate_m5(const struct wpabuf *tlvs);
975f05cddf9SRui Paulo int wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2);
976f05cddf9SRui Paulo int wps_validate_m6(const struct wpabuf *tlvs);
977f05cddf9SRui Paulo int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2);
978f05cddf9SRui Paulo int wps_validate_m7(const struct wpabuf *tlvs);
979f05cddf9SRui Paulo int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap, int wps2);
980f05cddf9SRui Paulo int wps_validate_m8(const struct wpabuf *tlvs);
981f05cddf9SRui Paulo int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap, int wps2);
982f05cddf9SRui Paulo int wps_validate_wsc_ack(const struct wpabuf *tlvs);
983f05cddf9SRui Paulo int wps_validate_wsc_nack(const struct wpabuf *tlvs);
984f05cddf9SRui Paulo int wps_validate_wsc_done(const struct wpabuf *tlvs);
985f05cddf9SRui Paulo int wps_validate_upnp_set_selected_registrar(const struct wpabuf *tlvs);
986f05cddf9SRui Paulo #else /* CONFIG_WPS_STRICT */
wps_validate_beacon(const struct wpabuf * wps_ie)987f05cddf9SRui Paulo static inline int wps_validate_beacon(const struct wpabuf *wps_ie){
988f05cddf9SRui Paulo 	return 0;
989f05cddf9SRui Paulo }
990f05cddf9SRui Paulo 
wps_validate_beacon_probe_resp(const struct wpabuf * wps_ie,int probe,const u8 * addr)991f05cddf9SRui Paulo static inline int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie,
992f05cddf9SRui Paulo 						 int probe, const u8 *addr)
993f05cddf9SRui Paulo {
994f05cddf9SRui Paulo 	return 0;
995f05cddf9SRui Paulo }
996f05cddf9SRui Paulo 
wps_validate_probe_req(const struct wpabuf * wps_ie,const u8 * addr)997f05cddf9SRui Paulo static inline int wps_validate_probe_req(const struct wpabuf *wps_ie,
998f05cddf9SRui Paulo 					 const u8 *addr)
999f05cddf9SRui Paulo {
1000f05cddf9SRui Paulo 	return 0;
1001f05cddf9SRui Paulo }
1002f05cddf9SRui Paulo 
wps_validate_assoc_req(const struct wpabuf * wps_ie)1003f05cddf9SRui Paulo static inline int wps_validate_assoc_req(const struct wpabuf *wps_ie)
1004f05cddf9SRui Paulo {
1005f05cddf9SRui Paulo 	return 0;
1006f05cddf9SRui Paulo }
1007f05cddf9SRui Paulo 
wps_validate_assoc_resp(const struct wpabuf * wps_ie)1008f05cddf9SRui Paulo static inline int wps_validate_assoc_resp(const struct wpabuf *wps_ie)
1009f05cddf9SRui Paulo {
1010f05cddf9SRui Paulo 	return 0;
1011f05cddf9SRui Paulo }
1012f05cddf9SRui Paulo 
wps_validate_m1(const struct wpabuf * tlvs)1013f05cddf9SRui Paulo static inline int wps_validate_m1(const struct wpabuf *tlvs)
1014f05cddf9SRui Paulo {
1015f05cddf9SRui Paulo 	return 0;
1016f05cddf9SRui Paulo }
1017f05cddf9SRui Paulo 
wps_validate_m2(const struct wpabuf * tlvs)1018f05cddf9SRui Paulo static inline int wps_validate_m2(const struct wpabuf *tlvs)
1019f05cddf9SRui Paulo {
1020f05cddf9SRui Paulo 	return 0;
1021f05cddf9SRui Paulo }
1022f05cddf9SRui Paulo 
wps_validate_m2d(const struct wpabuf * tlvs)1023f05cddf9SRui Paulo static inline int wps_validate_m2d(const struct wpabuf *tlvs)
1024f05cddf9SRui Paulo {
1025f05cddf9SRui Paulo 	return 0;
1026f05cddf9SRui Paulo }
1027f05cddf9SRui Paulo 
wps_validate_m3(const struct wpabuf * tlvs)1028f05cddf9SRui Paulo static inline int wps_validate_m3(const struct wpabuf *tlvs)
1029f05cddf9SRui Paulo {
1030f05cddf9SRui Paulo 	return 0;
1031f05cddf9SRui Paulo }
1032f05cddf9SRui Paulo 
wps_validate_m4(const struct wpabuf * tlvs)1033f05cddf9SRui Paulo static inline int wps_validate_m4(const struct wpabuf *tlvs)
1034f05cddf9SRui Paulo {
1035f05cddf9SRui Paulo 	return 0;
1036f05cddf9SRui Paulo }
1037f05cddf9SRui Paulo 
wps_validate_m4_encr(const struct wpabuf * tlvs,int wps2)1038f05cddf9SRui Paulo static inline int wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2)
1039f05cddf9SRui Paulo {
1040f05cddf9SRui Paulo 	return 0;
1041f05cddf9SRui Paulo }
1042f05cddf9SRui Paulo 
wps_validate_m5(const struct wpabuf * tlvs)1043f05cddf9SRui Paulo static inline int wps_validate_m5(const struct wpabuf *tlvs)
1044f05cddf9SRui Paulo {
1045f05cddf9SRui Paulo 	return 0;
1046f05cddf9SRui Paulo }
1047f05cddf9SRui Paulo 
wps_validate_m5_encr(const struct wpabuf * tlvs,int wps2)1048f05cddf9SRui Paulo static inline int wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2)
1049f05cddf9SRui Paulo {
1050f05cddf9SRui Paulo 	return 0;
1051f05cddf9SRui Paulo }
1052f05cddf9SRui Paulo 
wps_validate_m6(const struct wpabuf * tlvs)1053f05cddf9SRui Paulo static inline int wps_validate_m6(const struct wpabuf *tlvs)
1054f05cddf9SRui Paulo {
1055f05cddf9SRui Paulo 	return 0;
1056f05cddf9SRui Paulo }
1057f05cddf9SRui Paulo 
wps_validate_m6_encr(const struct wpabuf * tlvs,int wps2)1058f05cddf9SRui Paulo static inline int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2)
1059f05cddf9SRui Paulo {
1060f05cddf9SRui Paulo 	return 0;
1061f05cddf9SRui Paulo }
1062f05cddf9SRui Paulo 
wps_validate_m7(const struct wpabuf * tlvs)1063f05cddf9SRui Paulo static inline int wps_validate_m7(const struct wpabuf *tlvs)
1064f05cddf9SRui Paulo {
1065f05cddf9SRui Paulo 	return 0;
1066f05cddf9SRui Paulo }
1067f05cddf9SRui Paulo 
wps_validate_m7_encr(const struct wpabuf * tlvs,int ap,int wps2)1068f05cddf9SRui Paulo static inline int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap,
1069f05cddf9SRui Paulo 				       int wps2)
1070f05cddf9SRui Paulo {
1071f05cddf9SRui Paulo 	return 0;
1072f05cddf9SRui Paulo }
1073f05cddf9SRui Paulo 
wps_validate_m8(const struct wpabuf * tlvs)1074f05cddf9SRui Paulo static inline int wps_validate_m8(const struct wpabuf *tlvs)
1075f05cddf9SRui Paulo {
1076f05cddf9SRui Paulo 	return 0;
1077f05cddf9SRui Paulo }
1078f05cddf9SRui Paulo 
wps_validate_m8_encr(const struct wpabuf * tlvs,int ap,int wps2)1079f05cddf9SRui Paulo static inline int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap,
1080f05cddf9SRui Paulo 				       int wps2)
1081f05cddf9SRui Paulo {
1082f05cddf9SRui Paulo 	return 0;
1083f05cddf9SRui Paulo }
1084f05cddf9SRui Paulo 
wps_validate_wsc_ack(const struct wpabuf * tlvs)1085f05cddf9SRui Paulo static inline int wps_validate_wsc_ack(const struct wpabuf *tlvs)
1086f05cddf9SRui Paulo {
1087f05cddf9SRui Paulo 	return 0;
1088f05cddf9SRui Paulo }
1089f05cddf9SRui Paulo 
wps_validate_wsc_nack(const struct wpabuf * tlvs)1090f05cddf9SRui Paulo static inline int wps_validate_wsc_nack(const struct wpabuf *tlvs)
1091f05cddf9SRui Paulo {
1092f05cddf9SRui Paulo 	return 0;
1093f05cddf9SRui Paulo }
1094f05cddf9SRui Paulo 
wps_validate_wsc_done(const struct wpabuf * tlvs)1095f05cddf9SRui Paulo static inline int wps_validate_wsc_done(const struct wpabuf *tlvs)
1096f05cddf9SRui Paulo {
1097f05cddf9SRui Paulo 	return 0;
1098f05cddf9SRui Paulo }
1099f05cddf9SRui Paulo 
wps_validate_upnp_set_selected_registrar(const struct wpabuf * tlvs)1100f05cddf9SRui Paulo static inline int wps_validate_upnp_set_selected_registrar(
1101f05cddf9SRui Paulo 	const struct wpabuf *tlvs)
1102f05cddf9SRui Paulo {
1103f05cddf9SRui Paulo 	return 0;
1104f05cddf9SRui Paulo }
1105f05cddf9SRui Paulo #endif /* CONFIG_WPS_STRICT */
1106e28a4053SRui Paulo 
110739beb93cSSam Leffler #endif /* WPS_H */
1108