• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/wpa/src/wps/

Lines Matching refs:wps

62 int wps_derive_keys(struct wps_data *wps)
70 if (wps->dh_privkey == NULL) {
75 pubkey = wps->registrar ? wps->dh_pubkey_e : wps->dh_pubkey_r;
81 wpa_hexdump_buf_key(MSG_DEBUG, "WPS: DH Private Key", wps->dh_privkey);
83 dh_shared = dh5_derive_shared(wps->dh_ctx, pubkey, wps->dh_privkey);
84 dh5_free(wps->dh_ctx);
85 wps->dh_ctx = NULL;
93 wpabuf_clear_free(wps->dh_privkey);
94 wps->dh_privkey = NULL;
106 addr[0] = wps->nonce_e;
108 addr[1] = wps->mac_addr_e;
110 addr[2] = wps->nonce_r;
117 os_memcpy(wps->authkey, keys, WPS_AUTHKEY_LEN);
118 os_memcpy(wps->keywrapkey, keys + WPS_AUTHKEY_LEN, WPS_KEYWRAPKEY_LEN);
119 os_memcpy(wps->emsk, keys + WPS_AUTHKEY_LEN + WPS_KEYWRAPKEY_LEN,
123 wps->authkey, WPS_AUTHKEY_LEN);
125 wps->keywrapkey, WPS_KEYWRAPKEY_LEN);
126 wpa_hexdump_key(MSG_DEBUG, "WPS: EMSK", wps->emsk, WPS_EMSK_LEN);
132 int wps_derive_psk(struct wps_data *wps, const u8 *dev_passwd,
137 if (hmac_sha256(wps->authkey, WPS_AUTHKEY_LEN, dev_passwd,
140 os_memcpy(wps->psk1, hash, WPS_PSK_LEN);
141 if (hmac_sha256(wps->authkey, WPS_AUTHKEY_LEN,
145 os_memcpy(wps->psk2, hash, WPS_PSK_LEN);
149 wpa_hexdump_key(MSG_DEBUG, "WPS: PSK1", wps->psk1, WPS_PSK_LEN);
150 wpa_hexdump_key(MSG_DEBUG, "WPS: PSK2", wps->psk2, WPS_PSK_LEN);
155 struct wpabuf * wps_decrypt_encr_settings(struct wps_data *wps, const u8 *encr,
177 if (aes_128_cbc_decrypt(wps->keywrapkey, encr, wpabuf_mhead(decrypted),
272 void wps_fail_event(struct wps_context *wps, enum wps_msg_type msg,
277 if (wps->event_cb == NULL)
285 wps->event_cb(wps->cb_ctx, WPS_EV_FAIL, &data);
289 void wps_success_event(struct wps_context *wps, const u8 *mac_addr)
293 if (wps->event_cb == NULL)
298 wps->event_cb(wps->cb_ctx, WPS_EV_SUCCESS, &data);
302 void wps_pwd_auth_fail_event(struct wps_context *wps, int enrollee, int part,
307 if (wps->event_cb == NULL)
314 wps->event_cb(wps->cb_ctx, WPS_EV_PWD_AUTH_FAIL, &data);
318 void wps_pbc_overlap_event(struct wps_context *wps)
320 if (wps->event_cb == NULL)
323 wps->event_cb(wps->cb_ctx, WPS_EV_PBC_OVERLAP, NULL);
327 void wps_pbc_timeout_event(struct wps_context *wps)
329 if (wps->event_cb == NULL)
332 wps->event_cb(wps->cb_ctx, WPS_EV_PBC_TIMEOUT, NULL);
336 void wps_pbc_active_event(struct wps_context *wps)
338 if (wps->event_cb == NULL)
341 wps->event_cb(wps->cb_ctx, WPS_EV_PBC_ACTIVE, NULL);
345 void wps_pbc_disable_event(struct wps_context *wps)
347 if (wps->event_cb == NULL)
350 wps->event_cb(wps->cb_ctx, WPS_EV_PBC_DISABLE, NULL);
356 struct wpabuf * wps_get_oob_cred(struct wps_context *wps, int rf_band,
370 data.wps = wps;
371 data.auth_type = wps->auth_types;
372 data.encr_type = wps->encr_types;
376 wps_build_mac_addr(plain, wps->dev.mac_addr) ||
383 if (wps->wps_state == WPS_STATE_NOT_CONFIGURED && data.new_psk &&
384 wps->ap) {
391 os_memcpy(cred.ssid, wps->ssid, wps->ssid_len);
392 cred.ssid_len = wps->ssid_len;
398 wps->wps_state = WPS_STATE_CONFIGURED;
402 if (wps->cred_cb)
403 wps->cred_cb(wps->cb_ctx, &cred);
435 int wps_oob_use_cred(struct wps_context *wps, struct wps_parse_attr *attr)
452 wps->cred_cb(wps->cb_ctx, &local_cred);
575 struct wpabuf * wps_build_wsc_ack(struct wps_data *wps)
587 wps_build_enrollee_nonce(wps, msg) ||
588 wps_build_registrar_nonce(wps, msg) ||
598 struct wpabuf * wps_build_wsc_nack(struct wps_data *wps)
610 wps_build_enrollee_nonce(wps, msg) ||
611 wps_build_registrar_nonce(wps, msg) ||
612 wps_build_config_error(msg, wps->config_error) ||
740 static int wps_build_ssid(struct wpabuf *msg, struct wps_context *wps)
744 wps->ssid, wps->ssid_len);
746 wpabuf_put_be16(msg, wps->ssid_len);
747 wpabuf_put_data(msg, wps->ssid, wps->ssid_len);