1e5b75505Sopenharmony_ci/* 2e5b75505Sopenharmony_ci * Wi-Fi Protected Setup 3e5b75505Sopenharmony_ci * Copyright (c) 2007-2016, Jouni Malinen <j@w1.fi> 4e5b75505Sopenharmony_ci * 5e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license. 6e5b75505Sopenharmony_ci * See README for more details. 7e5b75505Sopenharmony_ci */ 8e5b75505Sopenharmony_ci 9e5b75505Sopenharmony_ci#ifndef WPS_H 10e5b75505Sopenharmony_ci#define WPS_H 11e5b75505Sopenharmony_ci 12e5b75505Sopenharmony_ci#include "common/ieee802_11_defs.h" 13e5b75505Sopenharmony_ci#include "wps_defs.h" 14e5b75505Sopenharmony_ci 15e5b75505Sopenharmony_ci/** 16e5b75505Sopenharmony_ci * enum wsc_op_code - EAP-WSC OP-Code values 17e5b75505Sopenharmony_ci */ 18e5b75505Sopenharmony_cienum wsc_op_code { 19e5b75505Sopenharmony_ci WSC_UPnP = 0 /* No OP Code in UPnP transport */, 20e5b75505Sopenharmony_ci WSC_Start = 0x01, 21e5b75505Sopenharmony_ci WSC_ACK = 0x02, 22e5b75505Sopenharmony_ci WSC_NACK = 0x03, 23e5b75505Sopenharmony_ci WSC_MSG = 0x04, 24e5b75505Sopenharmony_ci WSC_Done = 0x05, 25e5b75505Sopenharmony_ci WSC_FRAG_ACK = 0x06 26e5b75505Sopenharmony_ci}; 27e5b75505Sopenharmony_ci 28e5b75505Sopenharmony_cistruct wps_registrar; 29e5b75505Sopenharmony_cistruct upnp_wps_device_sm; 30e5b75505Sopenharmony_cistruct wps_er; 31e5b75505Sopenharmony_cistruct wps_parse_attr; 32e5b75505Sopenharmony_ci 33e5b75505Sopenharmony_ci/** 34e5b75505Sopenharmony_ci * struct wps_credential - WPS Credential 35e5b75505Sopenharmony_ci * @ssid: SSID 36e5b75505Sopenharmony_ci * @ssid_len: Length of SSID 37e5b75505Sopenharmony_ci * @auth_type: Authentication Type (WPS_AUTH_OPEN, .. flags) 38e5b75505Sopenharmony_ci * @encr_type: Encryption Type (WPS_ENCR_NONE, .. flags) 39e5b75505Sopenharmony_ci * @key_idx: Key index 40e5b75505Sopenharmony_ci * @key: Key 41e5b75505Sopenharmony_ci * @key_len: Key length in octets 42e5b75505Sopenharmony_ci * @mac_addr: MAC address of the Credential receiver 43e5b75505Sopenharmony_ci * @cred_attr: Unparsed Credential attribute data (used only in cred_cb()); 44e5b75505Sopenharmony_ci * this may be %NULL, if not used 45e5b75505Sopenharmony_ci * @cred_attr_len: Length of cred_attr in octets 46e5b75505Sopenharmony_ci */ 47e5b75505Sopenharmony_cistruct wps_credential { 48e5b75505Sopenharmony_ci u8 ssid[SSID_MAX_LEN]; 49e5b75505Sopenharmony_ci size_t ssid_len; 50e5b75505Sopenharmony_ci u16 auth_type; 51e5b75505Sopenharmony_ci u16 encr_type; 52e5b75505Sopenharmony_ci u8 key_idx; 53e5b75505Sopenharmony_ci u8 key[64]; 54e5b75505Sopenharmony_ci size_t key_len; 55e5b75505Sopenharmony_ci u8 mac_addr[ETH_ALEN]; 56e5b75505Sopenharmony_ci const u8 *cred_attr; 57e5b75505Sopenharmony_ci size_t cred_attr_len; 58e5b75505Sopenharmony_ci}; 59e5b75505Sopenharmony_ci 60e5b75505Sopenharmony_ci#define WPS_DEV_TYPE_LEN 8 61e5b75505Sopenharmony_ci#define WPS_DEV_TYPE_BUFSIZE 21 62e5b75505Sopenharmony_ci#define WPS_SEC_DEV_TYPE_MAX_LEN 128 63e5b75505Sopenharmony_ci/* maximum number of advertised WPS vendor extension attributes */ 64e5b75505Sopenharmony_ci#define MAX_WPS_VENDOR_EXTENSIONS 10 65e5b75505Sopenharmony_ci/* maximum size of WPS Vendor extension attribute */ 66e5b75505Sopenharmony_ci#define WPS_MAX_VENDOR_EXT_LEN 1024 67e5b75505Sopenharmony_ci/* maximum number of parsed WPS vendor extension attributes */ 68e5b75505Sopenharmony_ci#define MAX_WPS_PARSE_VENDOR_EXT 10 69e5b75505Sopenharmony_ci 70e5b75505Sopenharmony_ci/** 71e5b75505Sopenharmony_ci * struct wps_device_data - WPS Device Data 72e5b75505Sopenharmony_ci * @mac_addr: Device MAC address 73e5b75505Sopenharmony_ci * @device_name: Device Name (0..32 octets encoded in UTF-8) 74e5b75505Sopenharmony_ci * @manufacturer: Manufacturer (0..64 octets encoded in UTF-8) 75e5b75505Sopenharmony_ci * @model_name: Model Name (0..32 octets encoded in UTF-8) 76e5b75505Sopenharmony_ci * @model_number: Model Number (0..32 octets encoded in UTF-8) 77e5b75505Sopenharmony_ci * @serial_number: Serial Number (0..32 octets encoded in UTF-8) 78e5b75505Sopenharmony_ci * @pri_dev_type: Primary Device Type 79e5b75505Sopenharmony_ci * @sec_dev_type: Array of secondary device types 80e5b75505Sopenharmony_ci * @num_sec_dev_type: Number of secondary device types 81e5b75505Sopenharmony_ci * @os_version: OS Version 82e5b75505Sopenharmony_ci * @rf_bands: RF bands (WPS_RF_24GHZ, WPS_RF_50GHZ, WPS_RF_60GHZ flags) 83e5b75505Sopenharmony_ci * @p2p: Whether the device is a P2P device 84e5b75505Sopenharmony_ci */ 85e5b75505Sopenharmony_cistruct wps_device_data { 86e5b75505Sopenharmony_ci u8 mac_addr[ETH_ALEN]; 87e5b75505Sopenharmony_ci char *device_name; 88e5b75505Sopenharmony_ci char *manufacturer; 89e5b75505Sopenharmony_ci char *model_name; 90e5b75505Sopenharmony_ci char *model_number; 91e5b75505Sopenharmony_ci char *serial_number; 92e5b75505Sopenharmony_ci u8 pri_dev_type[WPS_DEV_TYPE_LEN]; 93e5b75505Sopenharmony_ci#define WPS_SEC_DEVICE_TYPES 5 94e5b75505Sopenharmony_ci u8 sec_dev_type[WPS_SEC_DEVICE_TYPES][WPS_DEV_TYPE_LEN]; 95e5b75505Sopenharmony_ci u8 num_sec_dev_types; 96e5b75505Sopenharmony_ci u32 os_version; 97e5b75505Sopenharmony_ci u8 rf_bands; 98e5b75505Sopenharmony_ci u16 config_methods; 99e5b75505Sopenharmony_ci struct wpabuf *vendor_ext_m1; 100e5b75505Sopenharmony_ci struct wpabuf *vendor_ext[MAX_WPS_VENDOR_EXTENSIONS]; 101e5b75505Sopenharmony_ci 102e5b75505Sopenharmony_ci int p2p; 103e5b75505Sopenharmony_ci u8 multi_ap_ext; 104e5b75505Sopenharmony_ci}; 105e5b75505Sopenharmony_ci 106e5b75505Sopenharmony_ci/** 107e5b75505Sopenharmony_ci * struct wps_config - WPS configuration for a single registration protocol run 108e5b75505Sopenharmony_ci */ 109e5b75505Sopenharmony_cistruct wps_config { 110e5b75505Sopenharmony_ci /** 111e5b75505Sopenharmony_ci * wps - Pointer to long term WPS context 112e5b75505Sopenharmony_ci */ 113e5b75505Sopenharmony_ci struct wps_context *wps; 114e5b75505Sopenharmony_ci 115e5b75505Sopenharmony_ci /** 116e5b75505Sopenharmony_ci * registrar - Whether this end is a Registrar 117e5b75505Sopenharmony_ci */ 118e5b75505Sopenharmony_ci int registrar; 119e5b75505Sopenharmony_ci 120e5b75505Sopenharmony_ci /** 121e5b75505Sopenharmony_ci * pin - Enrollee Device Password (%NULL for Registrar or PBC) 122e5b75505Sopenharmony_ci */ 123e5b75505Sopenharmony_ci const u8 *pin; 124e5b75505Sopenharmony_ci 125e5b75505Sopenharmony_ci /** 126e5b75505Sopenharmony_ci * pin_len - Length on pin in octets 127e5b75505Sopenharmony_ci */ 128e5b75505Sopenharmony_ci size_t pin_len; 129e5b75505Sopenharmony_ci 130e5b75505Sopenharmony_ci /** 131e5b75505Sopenharmony_ci * pbc - Whether this is protocol run uses PBC 132e5b75505Sopenharmony_ci */ 133e5b75505Sopenharmony_ci int pbc; 134e5b75505Sopenharmony_ci 135e5b75505Sopenharmony_ci /** 136e5b75505Sopenharmony_ci * assoc_wps_ie: (Re)AssocReq WPS IE (in AP; %NULL if not AP) 137e5b75505Sopenharmony_ci */ 138e5b75505Sopenharmony_ci const struct wpabuf *assoc_wps_ie; 139e5b75505Sopenharmony_ci 140e5b75505Sopenharmony_ci /** 141e5b75505Sopenharmony_ci * new_ap_settings - New AP settings (%NULL if not used) 142e5b75505Sopenharmony_ci * 143e5b75505Sopenharmony_ci * This parameter provides new AP settings when using a wireless 144e5b75505Sopenharmony_ci * stations as a Registrar to configure the AP. %NULL means that AP 145e5b75505Sopenharmony_ci * will not be reconfigured, i.e., the station will only learn the 146e5b75505Sopenharmony_ci * current AP settings by using AP PIN. 147e5b75505Sopenharmony_ci */ 148e5b75505Sopenharmony_ci const struct wps_credential *new_ap_settings; 149e5b75505Sopenharmony_ci 150e5b75505Sopenharmony_ci /** 151e5b75505Sopenharmony_ci * peer_addr: MAC address of the peer in AP; %NULL if not AP 152e5b75505Sopenharmony_ci */ 153e5b75505Sopenharmony_ci const u8 *peer_addr; 154e5b75505Sopenharmony_ci 155e5b75505Sopenharmony_ci /** 156e5b75505Sopenharmony_ci * use_psk_key - Use PSK format key in Credential 157e5b75505Sopenharmony_ci * 158e5b75505Sopenharmony_ci * Force PSK format to be used instead of ASCII passphrase when 159e5b75505Sopenharmony_ci * building Credential for an Enrollee. The PSK value is set in 160e5b75505Sopenharmony_ci * struct wpa_context::psk. 161e5b75505Sopenharmony_ci */ 162e5b75505Sopenharmony_ci int use_psk_key; 163e5b75505Sopenharmony_ci 164e5b75505Sopenharmony_ci /** 165e5b75505Sopenharmony_ci * dev_pw_id - Device Password ID for Enrollee when PIN is used 166e5b75505Sopenharmony_ci */ 167e5b75505Sopenharmony_ci u16 dev_pw_id; 168e5b75505Sopenharmony_ci 169e5b75505Sopenharmony_ci /** 170e5b75505Sopenharmony_ci * p2p_dev_addr - P2P Device Address from (Re)Association Request 171e5b75505Sopenharmony_ci * 172e5b75505Sopenharmony_ci * On AP/GO, this is set to the P2P Device Address of the associating 173e5b75505Sopenharmony_ci * P2P client if a P2P IE is included in the (Re)Association Request 174e5b75505Sopenharmony_ci * frame and the P2P Device Address is included. Otherwise, this is set 175e5b75505Sopenharmony_ci * to %NULL to indicate the station does not have a P2P Device Address. 176e5b75505Sopenharmony_ci */ 177e5b75505Sopenharmony_ci const u8 *p2p_dev_addr; 178e5b75505Sopenharmony_ci 179e5b75505Sopenharmony_ci /** 180e5b75505Sopenharmony_ci * pbc_in_m1 - Do not remove PushButton config method in M1 (AP) 181e5b75505Sopenharmony_ci * 182e5b75505Sopenharmony_ci * This can be used to enable a workaround to allow Windows 7 to use 183e5b75505Sopenharmony_ci * PBC with the AP. 184e5b75505Sopenharmony_ci */ 185e5b75505Sopenharmony_ci int pbc_in_m1; 186e5b75505Sopenharmony_ci 187e5b75505Sopenharmony_ci /** 188e5b75505Sopenharmony_ci * peer_pubkey_hash - Peer public key hash or %NULL if not known 189e5b75505Sopenharmony_ci */ 190e5b75505Sopenharmony_ci const u8 *peer_pubkey_hash; 191e5b75505Sopenharmony_ci 192e5b75505Sopenharmony_ci /** 193e5b75505Sopenharmony_ci * multi_ap_backhaul_sta - Whether this is a Multi-AP backhaul STA 194e5b75505Sopenharmony_ci * enrollee 195e5b75505Sopenharmony_ci */ 196e5b75505Sopenharmony_ci int multi_ap_backhaul_sta; 197e5b75505Sopenharmony_ci}; 198e5b75505Sopenharmony_ci 199e5b75505Sopenharmony_cistruct wps_data * wps_init(const struct wps_config *cfg); 200e5b75505Sopenharmony_ci 201e5b75505Sopenharmony_civoid wps_deinit(struct wps_data *data); 202e5b75505Sopenharmony_ci 203e5b75505Sopenharmony_ci/** 204e5b75505Sopenharmony_ci * enum wps_process_res - WPS message processing result 205e5b75505Sopenharmony_ci */ 206e5b75505Sopenharmony_cienum wps_process_res { 207e5b75505Sopenharmony_ci /** 208e5b75505Sopenharmony_ci * WPS_DONE - Processing done 209e5b75505Sopenharmony_ci */ 210e5b75505Sopenharmony_ci WPS_DONE, 211e5b75505Sopenharmony_ci 212e5b75505Sopenharmony_ci /** 213e5b75505Sopenharmony_ci * WPS_CONTINUE - Processing continues 214e5b75505Sopenharmony_ci */ 215e5b75505Sopenharmony_ci WPS_CONTINUE, 216e5b75505Sopenharmony_ci 217e5b75505Sopenharmony_ci /** 218e5b75505Sopenharmony_ci * WPS_FAILURE - Processing failed 219e5b75505Sopenharmony_ci */ 220e5b75505Sopenharmony_ci WPS_FAILURE, 221e5b75505Sopenharmony_ci 222e5b75505Sopenharmony_ci /** 223e5b75505Sopenharmony_ci * WPS_PENDING - Processing continues, but waiting for an external 224e5b75505Sopenharmony_ci * event (e.g., UPnP message from an external Registrar) 225e5b75505Sopenharmony_ci */ 226e5b75505Sopenharmony_ci WPS_PENDING 227e5b75505Sopenharmony_ci}; 228e5b75505Sopenharmony_cienum wps_process_res wps_process_msg(struct wps_data *wps, 229e5b75505Sopenharmony_ci enum wsc_op_code op_code, 230e5b75505Sopenharmony_ci const struct wpabuf *msg); 231e5b75505Sopenharmony_ci 232e5b75505Sopenharmony_cistruct wpabuf * wps_get_msg(struct wps_data *wps, enum wsc_op_code *op_code); 233e5b75505Sopenharmony_ci 234e5b75505Sopenharmony_ciint wps_is_selected_pbc_registrar(const struct wpabuf *msg); 235e5b75505Sopenharmony_ciint wps_is_selected_pin_registrar(const struct wpabuf *msg); 236e5b75505Sopenharmony_ciint wps_ap_priority_compar(const struct wpabuf *wps_a, 237e5b75505Sopenharmony_ci const struct wpabuf *wps_b); 238e5b75505Sopenharmony_ciint wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr, 239e5b75505Sopenharmony_ci int ver1_compat); 240e5b75505Sopenharmony_ciconst u8 * wps_get_uuid_e(const struct wpabuf *msg); 241e5b75505Sopenharmony_ciint wps_is_20(const struct wpabuf *msg); 242e5b75505Sopenharmony_ci 243e5b75505Sopenharmony_cistruct wpabuf * wps_build_assoc_req_ie(enum wps_request_type req_type); 244e5b75505Sopenharmony_cistruct wpabuf * wps_build_assoc_resp_ie(void); 245e5b75505Sopenharmony_cistruct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev, 246e5b75505Sopenharmony_ci const u8 *uuid, 247e5b75505Sopenharmony_ci enum wps_request_type req_type, 248e5b75505Sopenharmony_ci unsigned int num_req_dev_types, 249e5b75505Sopenharmony_ci const u8 *req_dev_types); 250e5b75505Sopenharmony_ci 251e5b75505Sopenharmony_ci 252e5b75505Sopenharmony_ci/** 253e5b75505Sopenharmony_ci * struct wps_registrar_config - WPS Registrar configuration 254e5b75505Sopenharmony_ci */ 255e5b75505Sopenharmony_cistruct wps_registrar_config { 256e5b75505Sopenharmony_ci /** 257e5b75505Sopenharmony_ci * new_psk_cb - Callback for new PSK 258e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 259e5b75505Sopenharmony_ci * @mac_addr: MAC address of the Enrollee 260e5b75505Sopenharmony_ci * @p2p_dev_addr: P2P Device Address of the Enrollee or all zeros if not 261e5b75505Sopenharmony_ci * @psk: The new PSK 262e5b75505Sopenharmony_ci * @psk_len: The length of psk in octets 263e5b75505Sopenharmony_ci * Returns: 0 on success, -1 on failure 264e5b75505Sopenharmony_ci * 265e5b75505Sopenharmony_ci * This callback is called when a new per-device PSK is provisioned. 266e5b75505Sopenharmony_ci */ 267e5b75505Sopenharmony_ci int (*new_psk_cb)(void *ctx, const u8 *mac_addr, const u8 *p2p_dev_addr, 268e5b75505Sopenharmony_ci const u8 *psk, size_t psk_len); 269e5b75505Sopenharmony_ci 270e5b75505Sopenharmony_ci /** 271e5b75505Sopenharmony_ci * set_ie_cb - Callback for WPS IE changes 272e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 273e5b75505Sopenharmony_ci * @beacon_ie: WPS IE for Beacon 274e5b75505Sopenharmony_ci * @probe_resp_ie: WPS IE for Probe Response 275e5b75505Sopenharmony_ci * Returns: 0 on success, -1 on failure 276e5b75505Sopenharmony_ci * 277e5b75505Sopenharmony_ci * This callback is called whenever the WPS IE in Beacon or Probe 278e5b75505Sopenharmony_ci * Response frames needs to be changed (AP only). Callee is responsible 279e5b75505Sopenharmony_ci * for freeing the buffers. 280e5b75505Sopenharmony_ci */ 281e5b75505Sopenharmony_ci int (*set_ie_cb)(void *ctx, struct wpabuf *beacon_ie, 282e5b75505Sopenharmony_ci struct wpabuf *probe_resp_ie); 283e5b75505Sopenharmony_ci 284e5b75505Sopenharmony_ci /** 285e5b75505Sopenharmony_ci * pin_needed_cb - Callback for requesting a PIN 286e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 287e5b75505Sopenharmony_ci * @uuid_e: UUID-E of the unknown Enrollee 288e5b75505Sopenharmony_ci * @dev: Device Data from the unknown Enrollee 289e5b75505Sopenharmony_ci * 290e5b75505Sopenharmony_ci * This callback is called whenever an unknown Enrollee requests to use 291e5b75505Sopenharmony_ci * PIN method and a matching PIN (Device Password) is not found in 292e5b75505Sopenharmony_ci * Registrar data. 293e5b75505Sopenharmony_ci */ 294e5b75505Sopenharmony_ci void (*pin_needed_cb)(void *ctx, const u8 *uuid_e, 295e5b75505Sopenharmony_ci const struct wps_device_data *dev); 296e5b75505Sopenharmony_ci 297e5b75505Sopenharmony_ci /** 298e5b75505Sopenharmony_ci * reg_success_cb - Callback for reporting successful registration 299e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 300e5b75505Sopenharmony_ci * @mac_addr: MAC address of the Enrollee 301e5b75505Sopenharmony_ci * @uuid_e: UUID-E of the Enrollee 302e5b75505Sopenharmony_ci * @dev_pw: Device Password (PIN) used during registration 303e5b75505Sopenharmony_ci * @dev_pw_len: Length of dev_pw in octets 304e5b75505Sopenharmony_ci * 305e5b75505Sopenharmony_ci * This callback is called whenever an Enrollee completes registration 306e5b75505Sopenharmony_ci * successfully. 307e5b75505Sopenharmony_ci */ 308e5b75505Sopenharmony_ci void (*reg_success_cb)(void *ctx, const u8 *mac_addr, 309e5b75505Sopenharmony_ci const u8 *uuid_e, const u8 *dev_pw, 310e5b75505Sopenharmony_ci size_t dev_pw_len); 311e5b75505Sopenharmony_ci 312e5b75505Sopenharmony_ci /** 313e5b75505Sopenharmony_ci * set_sel_reg_cb - Callback for reporting selected registrar changes 314e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 315e5b75505Sopenharmony_ci * @sel_reg: Whether the Registrar is selected 316e5b75505Sopenharmony_ci * @dev_passwd_id: Device Password ID to indicate with method or 317e5b75505Sopenharmony_ci * specific password the Registrar intends to use 318e5b75505Sopenharmony_ci * @sel_reg_config_methods: Bit field of active config methods 319e5b75505Sopenharmony_ci * 320e5b75505Sopenharmony_ci * This callback is called whenever the Selected Registrar state 321e5b75505Sopenharmony_ci * changes (e.g., a new PIN becomes available or PBC is invoked). This 322e5b75505Sopenharmony_ci * callback is only used by External Registrar implementation; 323e5b75505Sopenharmony_ci * set_ie_cb() is used by AP implementation in similar caes, but it 324e5b75505Sopenharmony_ci * provides the full WPS IE data instead of just the minimal Registrar 325e5b75505Sopenharmony_ci * state information. 326e5b75505Sopenharmony_ci */ 327e5b75505Sopenharmony_ci void (*set_sel_reg_cb)(void *ctx, int sel_reg, u16 dev_passwd_id, 328e5b75505Sopenharmony_ci u16 sel_reg_config_methods); 329e5b75505Sopenharmony_ci 330e5b75505Sopenharmony_ci /** 331e5b75505Sopenharmony_ci * enrollee_seen_cb - Callback for reporting Enrollee based on ProbeReq 332e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 333e5b75505Sopenharmony_ci * @addr: MAC address of the Enrollee 334e5b75505Sopenharmony_ci * @uuid_e: UUID of the Enrollee 335e5b75505Sopenharmony_ci * @pri_dev_type: Primary device type 336e5b75505Sopenharmony_ci * @config_methods: Config Methods 337e5b75505Sopenharmony_ci * @dev_password_id: Device Password ID 338e5b75505Sopenharmony_ci * @request_type: Request Type 339e5b75505Sopenharmony_ci * @dev_name: Device Name (if available) 340e5b75505Sopenharmony_ci */ 341e5b75505Sopenharmony_ci void (*enrollee_seen_cb)(void *ctx, const u8 *addr, const u8 *uuid_e, 342e5b75505Sopenharmony_ci const u8 *pri_dev_type, u16 config_methods, 343e5b75505Sopenharmony_ci u16 dev_password_id, u8 request_type, 344e5b75505Sopenharmony_ci const char *dev_name); 345e5b75505Sopenharmony_ci 346e5b75505Sopenharmony_ci /** 347e5b75505Sopenharmony_ci * cb_ctx: Higher layer context data for Registrar callbacks 348e5b75505Sopenharmony_ci */ 349e5b75505Sopenharmony_ci void *cb_ctx; 350e5b75505Sopenharmony_ci 351e5b75505Sopenharmony_ci /** 352e5b75505Sopenharmony_ci * skip_cred_build: Do not build credential 353e5b75505Sopenharmony_ci * 354e5b75505Sopenharmony_ci * This option can be used to disable internal code that builds 355e5b75505Sopenharmony_ci * Credential attribute into M8 based on the current network 356e5b75505Sopenharmony_ci * configuration and Enrollee capabilities. The extra_cred data will 357e5b75505Sopenharmony_ci * then be used as the Credential(s). 358e5b75505Sopenharmony_ci */ 359e5b75505Sopenharmony_ci int skip_cred_build; 360e5b75505Sopenharmony_ci 361e5b75505Sopenharmony_ci /** 362e5b75505Sopenharmony_ci * extra_cred: Additional Credential attribute(s) 363e5b75505Sopenharmony_ci * 364e5b75505Sopenharmony_ci * This optional data (set to %NULL to disable) can be used to add 365e5b75505Sopenharmony_ci * Credential attribute(s) for other networks into M8. If 366e5b75505Sopenharmony_ci * skip_cred_build is set, this will also override the automatically 367e5b75505Sopenharmony_ci * generated Credential attribute. 368e5b75505Sopenharmony_ci */ 369e5b75505Sopenharmony_ci const u8 *extra_cred; 370e5b75505Sopenharmony_ci 371e5b75505Sopenharmony_ci /** 372e5b75505Sopenharmony_ci * extra_cred_len: Length of extra_cred in octets 373e5b75505Sopenharmony_ci */ 374e5b75505Sopenharmony_ci size_t extra_cred_len; 375e5b75505Sopenharmony_ci 376e5b75505Sopenharmony_ci /** 377e5b75505Sopenharmony_ci * disable_auto_conf - Disable auto-configuration on first registration 378e5b75505Sopenharmony_ci * 379e5b75505Sopenharmony_ci * By default, the AP that is started in not configured state will 380e5b75505Sopenharmony_ci * generate a random PSK and move to configured state when the first 381e5b75505Sopenharmony_ci * registration protocol run is completed successfully. This option can 382e5b75505Sopenharmony_ci * be used to disable this functionality and leave it up to an external 383e5b75505Sopenharmony_ci * program to take care of configuration. This requires the extra_cred 384e5b75505Sopenharmony_ci * to be set with a suitable Credential and skip_cred_build being used. 385e5b75505Sopenharmony_ci */ 386e5b75505Sopenharmony_ci int disable_auto_conf; 387e5b75505Sopenharmony_ci 388e5b75505Sopenharmony_ci /** 389e5b75505Sopenharmony_ci * static_wep_only - Whether the BSS supports only static WEP 390e5b75505Sopenharmony_ci */ 391e5b75505Sopenharmony_ci int static_wep_only; 392e5b75505Sopenharmony_ci 393e5b75505Sopenharmony_ci /** 394e5b75505Sopenharmony_ci * dualband - Whether this is a concurrent dualband AP 395e5b75505Sopenharmony_ci */ 396e5b75505Sopenharmony_ci int dualband; 397e5b75505Sopenharmony_ci 398e5b75505Sopenharmony_ci /** 399e5b75505Sopenharmony_ci * force_per_enrollee_psk - Force per-Enrollee random PSK 400e5b75505Sopenharmony_ci * 401e5b75505Sopenharmony_ci * This forces per-Enrollee random PSK to be generated even if a default 402e5b75505Sopenharmony_ci * PSK is set for a network. 403e5b75505Sopenharmony_ci */ 404e5b75505Sopenharmony_ci int force_per_enrollee_psk; 405e5b75505Sopenharmony_ci 406e5b75505Sopenharmony_ci /** 407e5b75505Sopenharmony_ci * multi_ap_backhaul_ssid - SSID to supply to a Multi-AP backhaul 408e5b75505Sopenharmony_ci * enrollee 409e5b75505Sopenharmony_ci * 410e5b75505Sopenharmony_ci * This SSID is used by the Registrar to fill in information for 411e5b75505Sopenharmony_ci * Credentials when the enrollee advertises it is a Multi-AP backhaul 412e5b75505Sopenharmony_ci * STA. 413e5b75505Sopenharmony_ci */ 414e5b75505Sopenharmony_ci const u8 *multi_ap_backhaul_ssid; 415e5b75505Sopenharmony_ci 416e5b75505Sopenharmony_ci /** 417e5b75505Sopenharmony_ci * multi_ap_backhaul_ssid_len - Length of multi_ap_backhaul_ssid in 418e5b75505Sopenharmony_ci * octets 419e5b75505Sopenharmony_ci */ 420e5b75505Sopenharmony_ci size_t multi_ap_backhaul_ssid_len; 421e5b75505Sopenharmony_ci 422e5b75505Sopenharmony_ci /** 423e5b75505Sopenharmony_ci * multi_ap_backhaul_network_key - The Network Key (PSK) for the 424e5b75505Sopenharmony_ci * Multi-AP backhaul enrollee. 425e5b75505Sopenharmony_ci * 426e5b75505Sopenharmony_ci * This key can be either the ASCII passphrase (8..63 characters) or the 427e5b75505Sopenharmony_ci * 32-octet PSK (64 hex characters). 428e5b75505Sopenharmony_ci */ 429e5b75505Sopenharmony_ci const u8 *multi_ap_backhaul_network_key; 430e5b75505Sopenharmony_ci 431e5b75505Sopenharmony_ci /** 432e5b75505Sopenharmony_ci * multi_ap_backhaul_network_key_len - Length of 433e5b75505Sopenharmony_ci * multi_ap_backhaul_network_key in octets 434e5b75505Sopenharmony_ci */ 435e5b75505Sopenharmony_ci size_t multi_ap_backhaul_network_key_len; 436e5b75505Sopenharmony_ci}; 437e5b75505Sopenharmony_ci 438e5b75505Sopenharmony_ci 439e5b75505Sopenharmony_ci/** 440e5b75505Sopenharmony_ci * enum wps_event - WPS event types 441e5b75505Sopenharmony_ci */ 442e5b75505Sopenharmony_cienum wps_event { 443e5b75505Sopenharmony_ci /** 444e5b75505Sopenharmony_ci * WPS_EV_M2D - M2D received (Registrar did not know us) 445e5b75505Sopenharmony_ci */ 446e5b75505Sopenharmony_ci WPS_EV_M2D, 447e5b75505Sopenharmony_ci 448e5b75505Sopenharmony_ci /** 449e5b75505Sopenharmony_ci * WPS_EV_FAIL - Registration failed 450e5b75505Sopenharmony_ci */ 451e5b75505Sopenharmony_ci WPS_EV_FAIL, 452e5b75505Sopenharmony_ci 453e5b75505Sopenharmony_ci /** 454e5b75505Sopenharmony_ci * WPS_EV_SUCCESS - Registration succeeded 455e5b75505Sopenharmony_ci */ 456e5b75505Sopenharmony_ci WPS_EV_SUCCESS, 457e5b75505Sopenharmony_ci 458e5b75505Sopenharmony_ci /** 459e5b75505Sopenharmony_ci * WPS_EV_PWD_AUTH_FAIL - Password authentication failed 460e5b75505Sopenharmony_ci */ 461e5b75505Sopenharmony_ci WPS_EV_PWD_AUTH_FAIL, 462e5b75505Sopenharmony_ci 463e5b75505Sopenharmony_ci /** 464e5b75505Sopenharmony_ci * WPS_EV_PBC_OVERLAP - PBC session overlap detected 465e5b75505Sopenharmony_ci */ 466e5b75505Sopenharmony_ci WPS_EV_PBC_OVERLAP, 467e5b75505Sopenharmony_ci 468e5b75505Sopenharmony_ci /** 469e5b75505Sopenharmony_ci * WPS_EV_PBC_TIMEOUT - PBC walktime expired before protocol run start 470e5b75505Sopenharmony_ci */ 471e5b75505Sopenharmony_ci WPS_EV_PBC_TIMEOUT, 472e5b75505Sopenharmony_ci 473e5b75505Sopenharmony_ci /** 474e5b75505Sopenharmony_ci * WPS_EV_PBC_ACTIVE - PBC mode was activated 475e5b75505Sopenharmony_ci */ 476e5b75505Sopenharmony_ci WPS_EV_PBC_ACTIVE, 477e5b75505Sopenharmony_ci 478e5b75505Sopenharmony_ci /** 479e5b75505Sopenharmony_ci * WPS_EV_PBC_DISABLE - PBC mode was disabled 480e5b75505Sopenharmony_ci */ 481e5b75505Sopenharmony_ci WPS_EV_PBC_DISABLE, 482e5b75505Sopenharmony_ci 483e5b75505Sopenharmony_ci /** 484e5b75505Sopenharmony_ci * WPS_EV_ER_AP_ADD - ER: AP added 485e5b75505Sopenharmony_ci */ 486e5b75505Sopenharmony_ci WPS_EV_ER_AP_ADD, 487e5b75505Sopenharmony_ci 488e5b75505Sopenharmony_ci /** 489e5b75505Sopenharmony_ci * WPS_EV_ER_AP_REMOVE - ER: AP removed 490e5b75505Sopenharmony_ci */ 491e5b75505Sopenharmony_ci WPS_EV_ER_AP_REMOVE, 492e5b75505Sopenharmony_ci 493e5b75505Sopenharmony_ci /** 494e5b75505Sopenharmony_ci * WPS_EV_ER_ENROLLEE_ADD - ER: Enrollee added 495e5b75505Sopenharmony_ci */ 496e5b75505Sopenharmony_ci WPS_EV_ER_ENROLLEE_ADD, 497e5b75505Sopenharmony_ci 498e5b75505Sopenharmony_ci /** 499e5b75505Sopenharmony_ci * WPS_EV_ER_ENROLLEE_REMOVE - ER: Enrollee removed 500e5b75505Sopenharmony_ci */ 501e5b75505Sopenharmony_ci WPS_EV_ER_ENROLLEE_REMOVE, 502e5b75505Sopenharmony_ci 503e5b75505Sopenharmony_ci /** 504e5b75505Sopenharmony_ci * WPS_EV_ER_AP_SETTINGS - ER: AP Settings learned 505e5b75505Sopenharmony_ci */ 506e5b75505Sopenharmony_ci WPS_EV_ER_AP_SETTINGS, 507e5b75505Sopenharmony_ci 508e5b75505Sopenharmony_ci /** 509e5b75505Sopenharmony_ci * WPS_EV_ER_SET_SELECTED_REGISTRAR - ER: SetSelectedRegistrar event 510e5b75505Sopenharmony_ci */ 511e5b75505Sopenharmony_ci WPS_EV_ER_SET_SELECTED_REGISTRAR, 512e5b75505Sopenharmony_ci 513e5b75505Sopenharmony_ci /** 514e5b75505Sopenharmony_ci * WPS_EV_AP_PIN_SUCCESS - External Registrar used correct AP PIN 515e5b75505Sopenharmony_ci */ 516e5b75505Sopenharmony_ci WPS_EV_AP_PIN_SUCCESS 517e5b75505Sopenharmony_ci}; 518e5b75505Sopenharmony_ci 519e5b75505Sopenharmony_ci/** 520e5b75505Sopenharmony_ci * union wps_event_data - WPS event data 521e5b75505Sopenharmony_ci */ 522e5b75505Sopenharmony_ciunion wps_event_data { 523e5b75505Sopenharmony_ci /** 524e5b75505Sopenharmony_ci * struct wps_event_m2d - M2D event data 525e5b75505Sopenharmony_ci */ 526e5b75505Sopenharmony_ci struct wps_event_m2d { 527e5b75505Sopenharmony_ci u16 config_methods; 528e5b75505Sopenharmony_ci const u8 *manufacturer; 529e5b75505Sopenharmony_ci size_t manufacturer_len; 530e5b75505Sopenharmony_ci const u8 *model_name; 531e5b75505Sopenharmony_ci size_t model_name_len; 532e5b75505Sopenharmony_ci const u8 *model_number; 533e5b75505Sopenharmony_ci size_t model_number_len; 534e5b75505Sopenharmony_ci const u8 *serial_number; 535e5b75505Sopenharmony_ci size_t serial_number_len; 536e5b75505Sopenharmony_ci const u8 *dev_name; 537e5b75505Sopenharmony_ci size_t dev_name_len; 538e5b75505Sopenharmony_ci const u8 *primary_dev_type; /* 8 octets */ 539e5b75505Sopenharmony_ci u16 config_error; 540e5b75505Sopenharmony_ci u16 dev_password_id; 541e5b75505Sopenharmony_ci } m2d; 542e5b75505Sopenharmony_ci 543e5b75505Sopenharmony_ci /** 544e5b75505Sopenharmony_ci * struct wps_event_fail - Registration failure information 545e5b75505Sopenharmony_ci * @msg: enum wps_msg_type 546e5b75505Sopenharmony_ci */ 547e5b75505Sopenharmony_ci struct wps_event_fail { 548e5b75505Sopenharmony_ci int msg; 549e5b75505Sopenharmony_ci u16 config_error; 550e5b75505Sopenharmony_ci u16 error_indication; 551e5b75505Sopenharmony_ci u8 peer_macaddr[ETH_ALEN]; 552e5b75505Sopenharmony_ci } fail; 553e5b75505Sopenharmony_ci 554e5b75505Sopenharmony_ci struct wps_event_success { 555e5b75505Sopenharmony_ci u8 peer_macaddr[ETH_ALEN]; 556e5b75505Sopenharmony_ci } success; 557e5b75505Sopenharmony_ci 558e5b75505Sopenharmony_ci struct wps_event_pwd_auth_fail { 559e5b75505Sopenharmony_ci int enrollee; 560e5b75505Sopenharmony_ci int part; 561e5b75505Sopenharmony_ci u8 peer_macaddr[ETH_ALEN]; 562e5b75505Sopenharmony_ci } pwd_auth_fail; 563e5b75505Sopenharmony_ci 564e5b75505Sopenharmony_ci struct wps_event_er_ap { 565e5b75505Sopenharmony_ci const u8 *uuid; 566e5b75505Sopenharmony_ci const u8 *mac_addr; 567e5b75505Sopenharmony_ci const char *friendly_name; 568e5b75505Sopenharmony_ci const char *manufacturer; 569e5b75505Sopenharmony_ci const char *manufacturer_url; 570e5b75505Sopenharmony_ci const char *model_description; 571e5b75505Sopenharmony_ci const char *model_name; 572e5b75505Sopenharmony_ci const char *model_number; 573e5b75505Sopenharmony_ci const char *model_url; 574e5b75505Sopenharmony_ci const char *serial_number; 575e5b75505Sopenharmony_ci const char *upc; 576e5b75505Sopenharmony_ci const u8 *pri_dev_type; 577e5b75505Sopenharmony_ci u8 wps_state; 578e5b75505Sopenharmony_ci } ap; 579e5b75505Sopenharmony_ci 580e5b75505Sopenharmony_ci struct wps_event_er_enrollee { 581e5b75505Sopenharmony_ci const u8 *uuid; 582e5b75505Sopenharmony_ci const u8 *mac_addr; 583e5b75505Sopenharmony_ci int m1_received; 584e5b75505Sopenharmony_ci u16 config_methods; 585e5b75505Sopenharmony_ci u16 dev_passwd_id; 586e5b75505Sopenharmony_ci const u8 *pri_dev_type; 587e5b75505Sopenharmony_ci const char *dev_name; 588e5b75505Sopenharmony_ci const char *manufacturer; 589e5b75505Sopenharmony_ci const char *model_name; 590e5b75505Sopenharmony_ci const char *model_number; 591e5b75505Sopenharmony_ci const char *serial_number; 592e5b75505Sopenharmony_ci } enrollee; 593e5b75505Sopenharmony_ci 594e5b75505Sopenharmony_ci struct wps_event_er_ap_settings { 595e5b75505Sopenharmony_ci const u8 *uuid; 596e5b75505Sopenharmony_ci const struct wps_credential *cred; 597e5b75505Sopenharmony_ci } ap_settings; 598e5b75505Sopenharmony_ci 599e5b75505Sopenharmony_ci struct wps_event_er_set_selected_registrar { 600e5b75505Sopenharmony_ci const u8 *uuid; 601e5b75505Sopenharmony_ci int sel_reg; 602e5b75505Sopenharmony_ci u16 dev_passwd_id; 603e5b75505Sopenharmony_ci u16 sel_reg_config_methods; 604e5b75505Sopenharmony_ci enum { 605e5b75505Sopenharmony_ci WPS_ER_SET_SEL_REG_START, 606e5b75505Sopenharmony_ci WPS_ER_SET_SEL_REG_DONE, 607e5b75505Sopenharmony_ci WPS_ER_SET_SEL_REG_FAILED 608e5b75505Sopenharmony_ci } state; 609e5b75505Sopenharmony_ci } set_sel_reg; 610e5b75505Sopenharmony_ci}; 611e5b75505Sopenharmony_ci 612e5b75505Sopenharmony_ci/** 613e5b75505Sopenharmony_ci * struct upnp_pending_message - Pending PutWLANResponse messages 614e5b75505Sopenharmony_ci * @next: Pointer to next pending message or %NULL 615e5b75505Sopenharmony_ci * @addr: NewWLANEventMAC 616e5b75505Sopenharmony_ci * @msg: NewMessage 617e5b75505Sopenharmony_ci * @type: Message Type 618e5b75505Sopenharmony_ci */ 619e5b75505Sopenharmony_cistruct upnp_pending_message { 620e5b75505Sopenharmony_ci struct upnp_pending_message *next; 621e5b75505Sopenharmony_ci u8 addr[ETH_ALEN]; 622e5b75505Sopenharmony_ci struct wpabuf *msg; 623e5b75505Sopenharmony_ci enum wps_msg_type type; 624e5b75505Sopenharmony_ci}; 625e5b75505Sopenharmony_ci 626e5b75505Sopenharmony_ci/** 627e5b75505Sopenharmony_ci * struct wps_context - Long term WPS context data 628e5b75505Sopenharmony_ci * 629e5b75505Sopenharmony_ci * This data is stored at the higher layer Authenticator or Supplicant data 630e5b75505Sopenharmony_ci * structures and it is maintained over multiple registration protocol runs. 631e5b75505Sopenharmony_ci */ 632e5b75505Sopenharmony_cistruct wps_context { 633e5b75505Sopenharmony_ci /** 634e5b75505Sopenharmony_ci * ap - Whether the local end is an access point 635e5b75505Sopenharmony_ci */ 636e5b75505Sopenharmony_ci int ap; 637e5b75505Sopenharmony_ci 638e5b75505Sopenharmony_ci /** 639e5b75505Sopenharmony_ci * registrar - Pointer to WPS registrar data from wps_registrar_init() 640e5b75505Sopenharmony_ci */ 641e5b75505Sopenharmony_ci struct wps_registrar *registrar; 642e5b75505Sopenharmony_ci 643e5b75505Sopenharmony_ci /** 644e5b75505Sopenharmony_ci * wps_state - Current WPS state 645e5b75505Sopenharmony_ci */ 646e5b75505Sopenharmony_ci enum wps_state wps_state; 647e5b75505Sopenharmony_ci 648e5b75505Sopenharmony_ci /** 649e5b75505Sopenharmony_ci * ap_setup_locked - Whether AP setup is locked (only used at AP) 650e5b75505Sopenharmony_ci */ 651e5b75505Sopenharmony_ci int ap_setup_locked; 652e5b75505Sopenharmony_ci 653e5b75505Sopenharmony_ci /** 654e5b75505Sopenharmony_ci * uuid - Own UUID 655e5b75505Sopenharmony_ci */ 656e5b75505Sopenharmony_ci u8 uuid[16]; 657e5b75505Sopenharmony_ci 658e5b75505Sopenharmony_ci /** 659e5b75505Sopenharmony_ci * ssid - SSID 660e5b75505Sopenharmony_ci * 661e5b75505Sopenharmony_ci * This SSID is used by the Registrar to fill in information for 662e5b75505Sopenharmony_ci * Credentials. In addition, AP uses it when acting as an Enrollee to 663e5b75505Sopenharmony_ci * notify Registrar of the current configuration. 664e5b75505Sopenharmony_ci */ 665e5b75505Sopenharmony_ci u8 ssid[SSID_MAX_LEN]; 666e5b75505Sopenharmony_ci 667e5b75505Sopenharmony_ci /** 668e5b75505Sopenharmony_ci * ssid_len - Length of ssid in octets 669e5b75505Sopenharmony_ci */ 670e5b75505Sopenharmony_ci size_t ssid_len; 671e5b75505Sopenharmony_ci 672e5b75505Sopenharmony_ci /** 673e5b75505Sopenharmony_ci * dev - Own WPS device data 674e5b75505Sopenharmony_ci */ 675e5b75505Sopenharmony_ci struct wps_device_data dev; 676e5b75505Sopenharmony_ci 677e5b75505Sopenharmony_ci /** 678e5b75505Sopenharmony_ci * dh_ctx - Context data for Diffie-Hellman operation 679e5b75505Sopenharmony_ci */ 680e5b75505Sopenharmony_ci void *dh_ctx; 681e5b75505Sopenharmony_ci 682e5b75505Sopenharmony_ci /** 683e5b75505Sopenharmony_ci * dh_privkey - Diffie-Hellman private key 684e5b75505Sopenharmony_ci */ 685e5b75505Sopenharmony_ci struct wpabuf *dh_privkey; 686e5b75505Sopenharmony_ci 687e5b75505Sopenharmony_ci /** 688e5b75505Sopenharmony_ci * dh_pubkey_oob - Diffie-Hellman public key 689e5b75505Sopenharmony_ci */ 690e5b75505Sopenharmony_ci struct wpabuf *dh_pubkey; 691e5b75505Sopenharmony_ci 692e5b75505Sopenharmony_ci /** 693e5b75505Sopenharmony_ci * config_methods - Enabled configuration methods 694e5b75505Sopenharmony_ci * 695e5b75505Sopenharmony_ci * Bit field of WPS_CONFIG_* 696e5b75505Sopenharmony_ci */ 697e5b75505Sopenharmony_ci u16 config_methods; 698e5b75505Sopenharmony_ci 699e5b75505Sopenharmony_ci /** 700e5b75505Sopenharmony_ci * encr_types - Enabled encryption types (bit field of WPS_ENCR_*) 701e5b75505Sopenharmony_ci */ 702e5b75505Sopenharmony_ci u16 encr_types; 703e5b75505Sopenharmony_ci 704e5b75505Sopenharmony_ci /** 705e5b75505Sopenharmony_ci * encr_types_rsn - Enabled encryption types for RSN (WPS_ENCR_*) 706e5b75505Sopenharmony_ci */ 707e5b75505Sopenharmony_ci u16 encr_types_rsn; 708e5b75505Sopenharmony_ci 709e5b75505Sopenharmony_ci /** 710e5b75505Sopenharmony_ci * encr_types_wpa - Enabled encryption types for WPA (WPS_ENCR_*) 711e5b75505Sopenharmony_ci */ 712e5b75505Sopenharmony_ci u16 encr_types_wpa; 713e5b75505Sopenharmony_ci 714e5b75505Sopenharmony_ci /** 715e5b75505Sopenharmony_ci * auth_types - Authentication types (bit field of WPS_AUTH_*) 716e5b75505Sopenharmony_ci */ 717e5b75505Sopenharmony_ci u16 auth_types; 718e5b75505Sopenharmony_ci 719e5b75505Sopenharmony_ci /** 720e5b75505Sopenharmony_ci * encr_types - Current AP encryption type (WPS_ENCR_*) 721e5b75505Sopenharmony_ci */ 722e5b75505Sopenharmony_ci u16 ap_encr_type; 723e5b75505Sopenharmony_ci 724e5b75505Sopenharmony_ci /** 725e5b75505Sopenharmony_ci * ap_auth_type - Current AP authentication types (WPS_AUTH_*) 726e5b75505Sopenharmony_ci */ 727e5b75505Sopenharmony_ci u16 ap_auth_type; 728e5b75505Sopenharmony_ci 729e5b75505Sopenharmony_ci /** 730e5b75505Sopenharmony_ci * network_key - The current Network Key (PSK) or %NULL to generate new 731e5b75505Sopenharmony_ci * 732e5b75505Sopenharmony_ci * If %NULL, Registrar will generate per-device PSK. In addition, AP 733e5b75505Sopenharmony_ci * uses this when acting as an Enrollee to notify Registrar of the 734e5b75505Sopenharmony_ci * current configuration. 735e5b75505Sopenharmony_ci * 736e5b75505Sopenharmony_ci * When using WPA/WPA2-Personal, this key can be either the ASCII 737e5b75505Sopenharmony_ci * passphrase (8..63 characters) or the 32-octet PSK (64 hex 738e5b75505Sopenharmony_ci * characters). When this is set to the ASCII passphrase, the PSK can 739e5b75505Sopenharmony_ci * be provided in the psk buffer and used per-Enrollee to control which 740e5b75505Sopenharmony_ci * key type is included in the Credential (e.g., to reduce calculation 741e5b75505Sopenharmony_ci * need on low-powered devices by provisioning PSK while still allowing 742e5b75505Sopenharmony_ci * other devices to get the passphrase). 743e5b75505Sopenharmony_ci */ 744e5b75505Sopenharmony_ci u8 *network_key; 745e5b75505Sopenharmony_ci 746e5b75505Sopenharmony_ci /** 747e5b75505Sopenharmony_ci * network_key_len - Length of network_key in octets 748e5b75505Sopenharmony_ci */ 749e5b75505Sopenharmony_ci size_t network_key_len; 750e5b75505Sopenharmony_ci 751e5b75505Sopenharmony_ci /** 752e5b75505Sopenharmony_ci * psk - The current network PSK 753e5b75505Sopenharmony_ci * 754e5b75505Sopenharmony_ci * This optional value can be used to provide the current PSK if 755e5b75505Sopenharmony_ci * network_key is set to the ASCII passphrase. 756e5b75505Sopenharmony_ci */ 757e5b75505Sopenharmony_ci u8 psk[32]; 758e5b75505Sopenharmony_ci 759e5b75505Sopenharmony_ci /** 760e5b75505Sopenharmony_ci * psk_set - Whether psk value is set 761e5b75505Sopenharmony_ci */ 762e5b75505Sopenharmony_ci int psk_set; 763e5b75505Sopenharmony_ci 764e5b75505Sopenharmony_ci /** 765e5b75505Sopenharmony_ci * ap_settings - AP Settings override for M7 (only used at AP) 766e5b75505Sopenharmony_ci * 767e5b75505Sopenharmony_ci * If %NULL, AP Settings attributes will be generated based on the 768e5b75505Sopenharmony_ci * current network configuration. 769e5b75505Sopenharmony_ci */ 770e5b75505Sopenharmony_ci u8 *ap_settings; 771e5b75505Sopenharmony_ci 772e5b75505Sopenharmony_ci /** 773e5b75505Sopenharmony_ci * ap_settings_len - Length of ap_settings in octets 774e5b75505Sopenharmony_ci */ 775e5b75505Sopenharmony_ci size_t ap_settings_len; 776e5b75505Sopenharmony_ci 777e5b75505Sopenharmony_ci /** 778e5b75505Sopenharmony_ci * friendly_name - Friendly Name (required for UPnP) 779e5b75505Sopenharmony_ci */ 780e5b75505Sopenharmony_ci char *friendly_name; 781e5b75505Sopenharmony_ci 782e5b75505Sopenharmony_ci /** 783e5b75505Sopenharmony_ci * manufacturer_url - Manufacturer URL (optional for UPnP) 784e5b75505Sopenharmony_ci */ 785e5b75505Sopenharmony_ci char *manufacturer_url; 786e5b75505Sopenharmony_ci 787e5b75505Sopenharmony_ci /** 788e5b75505Sopenharmony_ci * model_description - Model Description (recommended for UPnP) 789e5b75505Sopenharmony_ci */ 790e5b75505Sopenharmony_ci char *model_description; 791e5b75505Sopenharmony_ci 792e5b75505Sopenharmony_ci /** 793e5b75505Sopenharmony_ci * model_url - Model URL (optional for UPnP) 794e5b75505Sopenharmony_ci */ 795e5b75505Sopenharmony_ci char *model_url; 796e5b75505Sopenharmony_ci 797e5b75505Sopenharmony_ci /** 798e5b75505Sopenharmony_ci * upc - Universal Product Code (optional for UPnP) 799e5b75505Sopenharmony_ci */ 800e5b75505Sopenharmony_ci char *upc; 801e5b75505Sopenharmony_ci 802e5b75505Sopenharmony_ci /** 803e5b75505Sopenharmony_ci * cred_cb - Callback to notify that new Credentials were received 804e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 805e5b75505Sopenharmony_ci * @cred: The received Credential 806e5b75505Sopenharmony_ci * Return: 0 on success, -1 on failure 807e5b75505Sopenharmony_ci */ 808e5b75505Sopenharmony_ci int (*cred_cb)(void *ctx, const struct wps_credential *cred); 809e5b75505Sopenharmony_ci 810e5b75505Sopenharmony_ci /** 811e5b75505Sopenharmony_ci * event_cb - Event callback (state information about progress) 812e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 813e5b75505Sopenharmony_ci * @event: Event type 814e5b75505Sopenharmony_ci * @data: Event data 815e5b75505Sopenharmony_ci */ 816e5b75505Sopenharmony_ci void (*event_cb)(void *ctx, enum wps_event event, 817e5b75505Sopenharmony_ci union wps_event_data *data); 818e5b75505Sopenharmony_ci 819e5b75505Sopenharmony_ci /** 820e5b75505Sopenharmony_ci * rf_band_cb - Fetch currently used RF band 821e5b75505Sopenharmony_ci * @ctx: Higher layer context data (cb_ctx) 822e5b75505Sopenharmony_ci * Return: Current used RF band or 0 if not known 823e5b75505Sopenharmony_ci */ 824e5b75505Sopenharmony_ci int (*rf_band_cb)(void *ctx); 825e5b75505Sopenharmony_ci 826e5b75505Sopenharmony_ci /** 827e5b75505Sopenharmony_ci * cb_ctx: Higher layer context data for callbacks 828e5b75505Sopenharmony_ci */ 829e5b75505Sopenharmony_ci void *cb_ctx; 830e5b75505Sopenharmony_ci 831e5b75505Sopenharmony_ci struct upnp_wps_device_sm *wps_upnp; 832e5b75505Sopenharmony_ci 833e5b75505Sopenharmony_ci /* Pending messages from UPnP PutWLANResponse */ 834e5b75505Sopenharmony_ci struct upnp_pending_message *upnp_msgs; 835e5b75505Sopenharmony_ci 836e5b75505Sopenharmony_ci u16 ap_nfc_dev_pw_id; 837e5b75505Sopenharmony_ci struct wpabuf *ap_nfc_dh_pubkey; 838e5b75505Sopenharmony_ci struct wpabuf *ap_nfc_dh_privkey; 839e5b75505Sopenharmony_ci struct wpabuf *ap_nfc_dev_pw; 840e5b75505Sopenharmony_ci}; 841e5b75505Sopenharmony_ci 842e5b75505Sopenharmony_cistruct wps_registrar * 843e5b75505Sopenharmony_ciwps_registrar_init(struct wps_context *wps, 844e5b75505Sopenharmony_ci const struct wps_registrar_config *cfg); 845e5b75505Sopenharmony_civoid wps_registrar_deinit(struct wps_registrar *reg); 846e5b75505Sopenharmony_ciint wps_registrar_add_pin(struct wps_registrar *reg, const u8 *addr, 847e5b75505Sopenharmony_ci const u8 *uuid, const u8 *pin, size_t pin_len, 848e5b75505Sopenharmony_ci int timeout); 849e5b75505Sopenharmony_ciint wps_registrar_invalidate_pin(struct wps_registrar *reg, const u8 *uuid); 850e5b75505Sopenharmony_ciint wps_registrar_wps_cancel(struct wps_registrar *reg); 851e5b75505Sopenharmony_ciint wps_registrar_unlock_pin(struct wps_registrar *reg, const u8 *uuid); 852e5b75505Sopenharmony_ciint wps_registrar_button_pushed(struct wps_registrar *reg, 853e5b75505Sopenharmony_ci const u8 *p2p_dev_addr); 854e5b75505Sopenharmony_civoid wps_registrar_complete(struct wps_registrar *registrar, const u8 *uuid_e, 855e5b75505Sopenharmony_ci const u8 *dev_pw, size_t dev_pw_len); 856e5b75505Sopenharmony_civoid wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr, 857e5b75505Sopenharmony_ci const struct wpabuf *wps_data, 858e5b75505Sopenharmony_ci int p2p_wildcard); 859e5b75505Sopenharmony_ciint wps_registrar_update_ie(struct wps_registrar *reg); 860e5b75505Sopenharmony_ciint wps_registrar_get_info(struct wps_registrar *reg, const u8 *addr, 861e5b75505Sopenharmony_ci char *buf, size_t buflen); 862e5b75505Sopenharmony_ciint wps_registrar_config_ap(struct wps_registrar *reg, 863e5b75505Sopenharmony_ci struct wps_credential *cred); 864e5b75505Sopenharmony_ciint wps_registrar_add_nfc_pw_token(struct wps_registrar *reg, 865e5b75505Sopenharmony_ci const u8 *pubkey_hash, u16 pw_id, 866e5b75505Sopenharmony_ci const u8 *dev_pw, size_t dev_pw_len, 867e5b75505Sopenharmony_ci int pk_hash_provided_oob); 868e5b75505Sopenharmony_ciint wps_registrar_add_nfc_password_token(struct wps_registrar *reg, 869e5b75505Sopenharmony_ci const u8 *oob_dev_pw, 870e5b75505Sopenharmony_ci size_t oob_dev_pw_len); 871e5b75505Sopenharmony_civoid wps_registrar_flush(struct wps_registrar *reg); 872e5b75505Sopenharmony_ci 873e5b75505Sopenharmony_ciint wps_build_credential_wrap(struct wpabuf *msg, 874e5b75505Sopenharmony_ci const struct wps_credential *cred); 875e5b75505Sopenharmony_ci 876e5b75505Sopenharmony_ciunsigned int wps_pin_checksum(unsigned int pin); 877e5b75505Sopenharmony_ciunsigned int wps_pin_valid(unsigned int pin); 878e5b75505Sopenharmony_ciint wps_generate_pin(unsigned int *pin); 879e5b75505Sopenharmony_ciint wps_pin_str_valid(const char *pin); 880e5b75505Sopenharmony_civoid wps_free_pending_msgs(struct upnp_pending_message *msgs); 881e5b75505Sopenharmony_ci 882e5b75505Sopenharmony_cistruct wpabuf * wps_get_oob_cred(struct wps_context *wps, int rf_band, 883e5b75505Sopenharmony_ci int channel); 884e5b75505Sopenharmony_ciint wps_oob_use_cred(struct wps_context *wps, struct wps_parse_attr *attr); 885e5b75505Sopenharmony_ciint wps_attr_text(struct wpabuf *data, char *buf, char *end); 886e5b75505Sopenharmony_ciconst char * wps_ei_str(enum wps_error_indication ei); 887e5b75505Sopenharmony_ci 888e5b75505Sopenharmony_cistruct wps_er * wps_er_init(struct wps_context *wps, const char *ifname, 889e5b75505Sopenharmony_ci const char *filter); 890e5b75505Sopenharmony_civoid wps_er_refresh(struct wps_er *er); 891e5b75505Sopenharmony_civoid wps_er_deinit(struct wps_er *er, void (*cb)(void *ctx), void *ctx); 892e5b75505Sopenharmony_civoid wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id, 893e5b75505Sopenharmony_ci u16 sel_reg_config_methods); 894e5b75505Sopenharmony_ciint wps_er_pbc(struct wps_er *er, const u8 *uuid, const u8 *addr); 895e5b75505Sopenharmony_ciconst u8 * wps_er_get_sta_uuid(struct wps_er *er, const u8 *addr); 896e5b75505Sopenharmony_ciint wps_er_learn(struct wps_er *er, const u8 *uuid, const u8 *addr, 897e5b75505Sopenharmony_ci const u8 *pin, size_t pin_len); 898e5b75505Sopenharmony_ciint wps_er_set_config(struct wps_er *er, const u8 *uuid, const u8 *addr, 899e5b75505Sopenharmony_ci const struct wps_credential *cred); 900e5b75505Sopenharmony_ciint wps_er_config(struct wps_er *er, const u8 *uuid, const u8 *addr, 901e5b75505Sopenharmony_ci const u8 *pin, size_t pin_len, 902e5b75505Sopenharmony_ci const struct wps_credential *cred); 903e5b75505Sopenharmony_cistruct wpabuf * wps_er_config_token_from_cred(struct wps_context *wps, 904e5b75505Sopenharmony_ci struct wps_credential *cred); 905e5b75505Sopenharmony_cistruct wpabuf * wps_er_nfc_config_token(struct wps_er *er, const u8 *uuid, 906e5b75505Sopenharmony_ci const u8 *addr); 907e5b75505Sopenharmony_cistruct wpabuf * wps_er_nfc_handover_sel(struct wps_er *er, 908e5b75505Sopenharmony_ci struct wps_context *wps, const u8 *uuid, 909e5b75505Sopenharmony_ci const u8 *addr, struct wpabuf *pubkey); 910e5b75505Sopenharmony_ci 911e5b75505Sopenharmony_ciint wps_dev_type_str2bin(const char *str, u8 dev_type[WPS_DEV_TYPE_LEN]); 912e5b75505Sopenharmony_cichar * wps_dev_type_bin2str(const u8 dev_type[WPS_DEV_TYPE_LEN], char *buf, 913e5b75505Sopenharmony_ci size_t buf_len); 914e5b75505Sopenharmony_civoid uuid_gen_mac_addr(const u8 *mac_addr, u8 *uuid); 915e5b75505Sopenharmony_ciu16 wps_config_methods_str2bin(const char *str); 916e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_pw_token(u16 dev_pw_id, 917e5b75505Sopenharmony_ci const struct wpabuf *pubkey, 918e5b75505Sopenharmony_ci const struct wpabuf *dev_pw); 919e5b75505Sopenharmony_cistruct wpabuf * wps_nfc_token_build(int ndef, int id, struct wpabuf *pubkey, 920e5b75505Sopenharmony_ci struct wpabuf *dev_pw); 921e5b75505Sopenharmony_ciint wps_nfc_gen_dh(struct wpabuf **pubkey, struct wpabuf **privkey); 922e5b75505Sopenharmony_cistruct wpabuf * wps_nfc_token_gen(int ndef, int *id, struct wpabuf **pubkey, 923e5b75505Sopenharmony_ci struct wpabuf **privkey, 924e5b75505Sopenharmony_ci struct wpabuf **dev_pw); 925e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_handover_req(struct wps_context *ctx, 926e5b75505Sopenharmony_ci struct wpabuf *nfc_dh_pubkey); 927e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_handover_sel(struct wps_context *ctx, 928e5b75505Sopenharmony_ci struct wpabuf *nfc_dh_pubkey, 929e5b75505Sopenharmony_ci const u8 *bssid, int freq); 930e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_handover_req_p2p(struct wps_context *ctx, 931e5b75505Sopenharmony_ci struct wpabuf *nfc_dh_pubkey); 932e5b75505Sopenharmony_cistruct wpabuf * wps_build_nfc_handover_sel_p2p(struct wps_context *ctx, 933e5b75505Sopenharmony_ci int nfc_dev_pw_id, 934e5b75505Sopenharmony_ci struct wpabuf *nfc_dh_pubkey, 935e5b75505Sopenharmony_ci struct wpabuf *nfc_dev_pw); 936e5b75505Sopenharmony_ci 937e5b75505Sopenharmony_ci/* ndef.c */ 938e5b75505Sopenharmony_cistruct wpabuf * ndef_parse_wifi(const struct wpabuf *buf); 939e5b75505Sopenharmony_cistruct wpabuf * ndef_build_wifi(const struct wpabuf *buf); 940e5b75505Sopenharmony_cistruct wpabuf * ndef_parse_p2p(const struct wpabuf *buf); 941e5b75505Sopenharmony_cistruct wpabuf * ndef_build_p2p(const struct wpabuf *buf); 942e5b75505Sopenharmony_ci 943e5b75505Sopenharmony_ci#ifdef CONFIG_WPS_STRICT 944e5b75505Sopenharmony_ciint wps_validate_beacon(const struct wpabuf *wps_ie); 945e5b75505Sopenharmony_ciint wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe, 946e5b75505Sopenharmony_ci const u8 *addr); 947e5b75505Sopenharmony_ciint wps_validate_probe_req(const struct wpabuf *wps_ie, const u8 *addr); 948e5b75505Sopenharmony_ciint wps_validate_assoc_req(const struct wpabuf *wps_ie); 949e5b75505Sopenharmony_ciint wps_validate_assoc_resp(const struct wpabuf *wps_ie); 950e5b75505Sopenharmony_ciint wps_validate_m1(const struct wpabuf *tlvs); 951e5b75505Sopenharmony_ciint wps_validate_m2(const struct wpabuf *tlvs); 952e5b75505Sopenharmony_ciint wps_validate_m2d(const struct wpabuf *tlvs); 953e5b75505Sopenharmony_ciint wps_validate_m3(const struct wpabuf *tlvs); 954e5b75505Sopenharmony_ciint wps_validate_m4(const struct wpabuf *tlvs); 955e5b75505Sopenharmony_ciint wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2); 956e5b75505Sopenharmony_ciint wps_validate_m5(const struct wpabuf *tlvs); 957e5b75505Sopenharmony_ciint wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2); 958e5b75505Sopenharmony_ciint wps_validate_m6(const struct wpabuf *tlvs); 959e5b75505Sopenharmony_ciint wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2); 960e5b75505Sopenharmony_ciint wps_validate_m7(const struct wpabuf *tlvs); 961e5b75505Sopenharmony_ciint wps_validate_m7_encr(const struct wpabuf *tlvs, int ap, int wps2); 962e5b75505Sopenharmony_ciint wps_validate_m8(const struct wpabuf *tlvs); 963e5b75505Sopenharmony_ciint wps_validate_m8_encr(const struct wpabuf *tlvs, int ap, int wps2); 964e5b75505Sopenharmony_ciint wps_validate_wsc_ack(const struct wpabuf *tlvs); 965e5b75505Sopenharmony_ciint wps_validate_wsc_nack(const struct wpabuf *tlvs); 966e5b75505Sopenharmony_ciint wps_validate_wsc_done(const struct wpabuf *tlvs); 967e5b75505Sopenharmony_ciint wps_validate_upnp_set_selected_registrar(const struct wpabuf *tlvs); 968e5b75505Sopenharmony_ci#else /* CONFIG_WPS_STRICT */ 969e5b75505Sopenharmony_cistatic inline int wps_validate_beacon(const struct wpabuf *wps_ie){ 970e5b75505Sopenharmony_ci return 0; 971e5b75505Sopenharmony_ci} 972e5b75505Sopenharmony_ci 973e5b75505Sopenharmony_cistatic inline int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, 974e5b75505Sopenharmony_ci int probe, const u8 *addr) 975e5b75505Sopenharmony_ci{ 976e5b75505Sopenharmony_ci return 0; 977e5b75505Sopenharmony_ci} 978e5b75505Sopenharmony_ci 979e5b75505Sopenharmony_cistatic inline int wps_validate_probe_req(const struct wpabuf *wps_ie, 980e5b75505Sopenharmony_ci const u8 *addr) 981e5b75505Sopenharmony_ci{ 982e5b75505Sopenharmony_ci return 0; 983e5b75505Sopenharmony_ci} 984e5b75505Sopenharmony_ci 985e5b75505Sopenharmony_cistatic inline int wps_validate_assoc_req(const struct wpabuf *wps_ie) 986e5b75505Sopenharmony_ci{ 987e5b75505Sopenharmony_ci return 0; 988e5b75505Sopenharmony_ci} 989e5b75505Sopenharmony_ci 990e5b75505Sopenharmony_cistatic inline int wps_validate_assoc_resp(const struct wpabuf *wps_ie) 991e5b75505Sopenharmony_ci{ 992e5b75505Sopenharmony_ci return 0; 993e5b75505Sopenharmony_ci} 994e5b75505Sopenharmony_ci 995e5b75505Sopenharmony_cistatic inline int wps_validate_m1(const struct wpabuf *tlvs) 996e5b75505Sopenharmony_ci{ 997e5b75505Sopenharmony_ci return 0; 998e5b75505Sopenharmony_ci} 999e5b75505Sopenharmony_ci 1000e5b75505Sopenharmony_cistatic inline int wps_validate_m2(const struct wpabuf *tlvs) 1001e5b75505Sopenharmony_ci{ 1002e5b75505Sopenharmony_ci return 0; 1003e5b75505Sopenharmony_ci} 1004e5b75505Sopenharmony_ci 1005e5b75505Sopenharmony_cistatic inline int wps_validate_m2d(const struct wpabuf *tlvs) 1006e5b75505Sopenharmony_ci{ 1007e5b75505Sopenharmony_ci return 0; 1008e5b75505Sopenharmony_ci} 1009e5b75505Sopenharmony_ci 1010e5b75505Sopenharmony_cistatic inline int wps_validate_m3(const struct wpabuf *tlvs) 1011e5b75505Sopenharmony_ci{ 1012e5b75505Sopenharmony_ci return 0; 1013e5b75505Sopenharmony_ci} 1014e5b75505Sopenharmony_ci 1015e5b75505Sopenharmony_cistatic inline int wps_validate_m4(const struct wpabuf *tlvs) 1016e5b75505Sopenharmony_ci{ 1017e5b75505Sopenharmony_ci return 0; 1018e5b75505Sopenharmony_ci} 1019e5b75505Sopenharmony_ci 1020e5b75505Sopenharmony_cistatic inline int wps_validate_m4_encr(const struct wpabuf *tlvs, int wps2) 1021e5b75505Sopenharmony_ci{ 1022e5b75505Sopenharmony_ci return 0; 1023e5b75505Sopenharmony_ci} 1024e5b75505Sopenharmony_ci 1025e5b75505Sopenharmony_cistatic inline int wps_validate_m5(const struct wpabuf *tlvs) 1026e5b75505Sopenharmony_ci{ 1027e5b75505Sopenharmony_ci return 0; 1028e5b75505Sopenharmony_ci} 1029e5b75505Sopenharmony_ci 1030e5b75505Sopenharmony_cistatic inline int wps_validate_m5_encr(const struct wpabuf *tlvs, int wps2) 1031e5b75505Sopenharmony_ci{ 1032e5b75505Sopenharmony_ci return 0; 1033e5b75505Sopenharmony_ci} 1034e5b75505Sopenharmony_ci 1035e5b75505Sopenharmony_cistatic inline int wps_validate_m6(const struct wpabuf *tlvs) 1036e5b75505Sopenharmony_ci{ 1037e5b75505Sopenharmony_ci return 0; 1038e5b75505Sopenharmony_ci} 1039e5b75505Sopenharmony_ci 1040e5b75505Sopenharmony_cistatic inline int wps_validate_m6_encr(const struct wpabuf *tlvs, int wps2) 1041e5b75505Sopenharmony_ci{ 1042e5b75505Sopenharmony_ci return 0; 1043e5b75505Sopenharmony_ci} 1044e5b75505Sopenharmony_ci 1045e5b75505Sopenharmony_cistatic inline int wps_validate_m7(const struct wpabuf *tlvs) 1046e5b75505Sopenharmony_ci{ 1047e5b75505Sopenharmony_ci return 0; 1048e5b75505Sopenharmony_ci} 1049e5b75505Sopenharmony_ci 1050e5b75505Sopenharmony_cistatic inline int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap, 1051e5b75505Sopenharmony_ci int wps2) 1052e5b75505Sopenharmony_ci{ 1053e5b75505Sopenharmony_ci return 0; 1054e5b75505Sopenharmony_ci} 1055e5b75505Sopenharmony_ci 1056e5b75505Sopenharmony_cistatic inline int wps_validate_m8(const struct wpabuf *tlvs) 1057e5b75505Sopenharmony_ci{ 1058e5b75505Sopenharmony_ci return 0; 1059e5b75505Sopenharmony_ci} 1060e5b75505Sopenharmony_ci 1061e5b75505Sopenharmony_cistatic inline int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap, 1062e5b75505Sopenharmony_ci int wps2) 1063e5b75505Sopenharmony_ci{ 1064e5b75505Sopenharmony_ci return 0; 1065e5b75505Sopenharmony_ci} 1066e5b75505Sopenharmony_ci 1067e5b75505Sopenharmony_cistatic inline int wps_validate_wsc_ack(const struct wpabuf *tlvs) 1068e5b75505Sopenharmony_ci{ 1069e5b75505Sopenharmony_ci return 0; 1070e5b75505Sopenharmony_ci} 1071e5b75505Sopenharmony_ci 1072e5b75505Sopenharmony_cistatic inline int wps_validate_wsc_nack(const struct wpabuf *tlvs) 1073e5b75505Sopenharmony_ci{ 1074e5b75505Sopenharmony_ci return 0; 1075e5b75505Sopenharmony_ci} 1076e5b75505Sopenharmony_ci 1077e5b75505Sopenharmony_cistatic inline int wps_validate_wsc_done(const struct wpabuf *tlvs) 1078e5b75505Sopenharmony_ci{ 1079e5b75505Sopenharmony_ci return 0; 1080e5b75505Sopenharmony_ci} 1081e5b75505Sopenharmony_ci 1082e5b75505Sopenharmony_cistatic inline int wps_validate_upnp_set_selected_registrar( 1083e5b75505Sopenharmony_ci const struct wpabuf *tlvs) 1084e5b75505Sopenharmony_ci{ 1085e5b75505Sopenharmony_ci return 0; 1086e5b75505Sopenharmony_ci} 1087e5b75505Sopenharmony_ci#endif /* CONFIG_WPS_STRICT */ 1088e5b75505Sopenharmony_ci 1089e5b75505Sopenharmony_ci#endif /* WPS_H */ 1090