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

Lines Matching refs:wps

21 int wps_build_public_key(struct wps_data *wps, struct wpabuf *msg)
26 wpabuf_clear_free(wps->dh_privkey);
27 wps->dh_privkey = NULL;
28 if (wps->dev_pw_id != DEV_PW_DEFAULT && wps->wps->dh_privkey &&
29 wps->wps->dh_ctx) {
31 if (wps->wps->dh_pubkey == NULL) {
33 "WPS: wps->wps->dh_pubkey == NULL");
36 wps->dh_privkey = wpabuf_dup(wps->wps->dh_privkey);
37 wps->dh_ctx = wps->wps->dh_ctx;
38 wps->wps->dh_ctx = NULL;
39 pubkey = wpabuf_dup(wps->wps->dh_pubkey);
41 } else if ((wps->dev_pw_id >= 0x10 ||
42 wps->dev_pw_id == DEV_PW_NFC_CONNECTION_HANDOVER) &&
43 (wps->wps->ap ||
44 (wps->wps->ap_nfc_dh_pubkey &&
45 wps->wps->ap_nfc_dev_pw_id ==
47 wps->dev_pw_id == DEV_PW_NFC_CONNECTION_HANDOVER)) &&
48 (wps->dev_pw_id == wps->wps->ap_nfc_dev_pw_id ||
49 wps->wps->ap_nfc_dh_pubkey)) {
51 if (wps->wps->ap_nfc_dh_privkey == NULL) {
53 "WPS: wps->wps->ap_nfc_dh_privkey == NULL");
56 if (wps->wps->ap_nfc_dh_pubkey == NULL) {
58 "WPS: wps->wps->ap_nfc_dh_pubkey == NULL");
61 wps->dh_privkey = wpabuf_dup(wps->wps->ap_nfc_dh_privkey);
62 pubkey = wpabuf_dup(wps->wps->ap_nfc_dh_pubkey);
63 if (wps->dh_privkey && pubkey)
64 wps->dh_ctx = dh5_init_fixed(wps->dh_privkey, pubkey);
68 dh5_free(wps->dh_ctx);
69 wps->dh_ctx = dh5_init(&wps->dh_privkey, &pubkey);
72 if (wps->dh_ctx == NULL || wps->dh_privkey == NULL || pubkey == NULL) {
78 wpa_hexdump_buf_key(MSG_DEBUG, "WPS: DH Private Key", wps->dh_privkey);
85 if (wps->registrar) {
86 wpabuf_free(wps->dh_pubkey_r);
87 wps->dh_pubkey_r = pubkey;
89 wpabuf_free(wps->dh_pubkey_e);
90 wps->dh_pubkey_e = pubkey;
159 int wps_build_authenticator(struct wps_data *wps, struct wpabuf *msg)
165 if (wps->last_msg == NULL) {
174 addr[0] = wpabuf_head(wps->last_msg);
175 len[0] = wpabuf_len(wps->last_msg);
178 hmac_sha256_vector(wps->authkey, WPS_AUTHKEY_LEN, 2, addr, len, hash);
284 int wps_build_enrollee_nonce(struct wps_data *wps, struct wpabuf *msg)
289 wpabuf_put_data(msg, wps->nonce_e, WPS_NONCE_LEN);
294 int wps_build_registrar_nonce(struct wps_data *wps, struct wpabuf *msg)
299 wpabuf_put_data(msg, wps->nonce_r, WPS_NONCE_LEN);
304 int wps_build_auth_type_flags(struct wps_data *wps, struct wpabuf *msg)
328 int wps_build_encr_type_flags(struct wps_data *wps, struct wpabuf *msg)
349 int wps_build_conn_type_flags(struct wps_data *wps, struct wpabuf *msg)
359 int wps_build_assoc_state(struct wps_data *wps, struct wpabuf *msg)
369 int wps_build_key_wrap_auth(struct wps_data *wps, struct wpabuf *msg)
374 hmac_sha256(wps->authkey, WPS_AUTHKEY_LEN, wpabuf_head(msg),
384 int wps_build_encr_settings(struct wps_data *wps, struct wpabuf *msg,
406 if (aes_128_cbc_encrypt(wps->keywrapkey, iv, data, wpabuf_len(plain)))