Home
last modified time | relevance | path

Searched refs:ptk (Results 1 – 25 of 35) sorted by relevance

12

/hostap-latest/wlantest/
Dwlantest.c61 dl_list_init(&wt->ptk); in wlantest_init()
73 static void ptk_deinit(struct wlantest_ptk *ptk) in ptk_deinit() argument
75 dl_list_del(&ptk->list); in ptk_deinit()
76 os_free(ptk); in ptk_deinit()
93 struct wlantest_ptk *ptk, *npt; in wlantest_deinit() local
111 dl_list_for_each_safe(ptk, npt, &wt->ptk, struct wlantest_ptk, list) in wlantest_deinit()
112 ptk_deinit(ptk); in wlantest_deinit()
210 u8 ptk[64]; in add_ptk_file() local
233 if (hexstr2bin(buf, ptk, ptk_len) < 0) in add_ptk_file()
239 os_memcpy(p->ptk.tk, ptk, ptk_len); in add_ptk_file()
[all …]
Dsta.c309 static void sta_copy_ptk(struct wlantest_sta *sta, struct wpa_ptk *ptk) in sta_copy_ptk() argument
311 os_memcpy(&sta->ptk, ptk, sizeof(*ptk)); in sta_copy_ptk()
319 struct wpa_ptk *ptk) in sta_new_ptk() argument
325 sta_copy_ptk(sta, ptk); in sta_new_ptk()
326 wpa_hexdump(MSG_DEBUG, "PTK:KCK", sta->ptk.kck, sta->ptk.kck_len); in sta_new_ptk()
327 wpa_hexdump(MSG_DEBUG, "PTK:KEK", sta->ptk.kek, sta->ptk.kek_len); in sta_new_ptk()
328 wpa_hexdump(MSG_DEBUG, "PTK:TK", sta->ptk.tk, sta->ptk.tk_len); in sta_new_ptk()
361 sta_copy_ptk(osta, ptk); in sta_new_ptk()
Drx_eapol.c182 struct wpa_ptk ptk; in try_pmk() local
235 &ptk, ptk_name, sta->key_mgmt, in try_pmk()
237 check_mic(sta, ptk.kck, ptk.kck_len, ver, data, len) < 0) in try_pmk()
242 sta->snonce, &ptk, sta->key_mgmt, in try_pmk()
244 check_mic(sta, ptk.kck, ptk.kck_len, ver, data, len) < 0) { in try_pmk()
265 os_memcpy(&sta->tptk, &ptk, sizeof(ptk)); in try_pmk()
275 sta_new_ptk(wt, sta, &ptk); in try_pmk()
302 struct wlantest_ptk *ptk; in derive_ptk() local
306 dl_list_for_each(ptk, &wt->ptk, struct wlantest_ptk, list) { in derive_ptk()
307 if (check_mic(sta, ptk->ptk.kck, ptk->ptk.kck_len, in derive_ptk()
[all …]
Drx_data.c154 struct wpa_ptk *ptk, const struct ieee80211_hdr *hdr, in try_ptk() argument
159 unsigned int tk_len = ptk->tk_len; in try_ptk()
164 decrypted = ccmp_decrypt(ptk->tk, hdr, a1, a2, a3, data, in try_ptk()
168 decrypted = ccmp_256_decrypt(ptk->tk, hdr, a1, a2, a3, data, in try_ptk()
174 decrypted = gcmp_decrypt(ptk->tk, tk_len, hdr, a1, a2, a3, in try_ptk()
180 decrypted = tkip_decrypt(ptk->tk, hdr, data, data_len, in try_ptk()
198 struct wlantest_ptk *ptk; in try_all_ptk() local
203 dl_list_for_each(ptk, &wt->ptk, struct wlantest_ptk, list) { in try_all_ptk()
204 decrypted = try_ptk(wt, pairwise_cipher, &ptk->ptk, hdr, a1, a2, in try_all_ptk()
210 write_decrypted_note(wt, decrypted, ptk->ptk.tk, in try_all_ptk()
[all …]
Drx_mgmt.c720 struct wpa_ptk ptk; in process_ft_auth() local
816 sta->pmk_r1_name, &ptk, ptk_name, sta->key_mgmt, in process_ft_auth()
820 sta_new_ptk(wt, sta, &ptk); in process_ft_auth()
1034 struct wpa_ptk ptk; in try_rmsk() local
1048 &ptk, ick, &ick_len, in try_rmsk()
1079 if (aes_siv_decrypt(ptk.kek, ptk.kek_len, in try_rmsk()
1088 os_memcpy(&sta->ptk, &ptk, sizeof(ptk)); in try_rmsk()
1300 if (aes_siv_decrypt(sta->ptk.kek, sta->ptk.kek_len, in decrypt_fils_assoc_resp()
1705 kck = sta->ptk.kck2; in rx_mgmt_reassoc_req()
1706 kck_len = sta->ptk.kck2_len; in rx_mgmt_reassoc_req()
[all …]
Dwlantest.h44 struct wpa_ptk ptk; member
87 struct wpa_ptk ptk; /* Derived PTK */ member
223 struct dl_list ptk; /* struct wlantest_ptk */ member
323 struct wpa_ptk *ptk);
Dinject.c252 crypt = tkip_encrypt(incorrect_key ? stub : sta->ptk.tk, in wlantest_inject_prot()
256 crypt = ccmp_encrypt(incorrect_key ? stub : sta->ptk.tk, in wlantest_inject_prot()
/hostap-latest/src/common/
Dwpa_common.c396 struct wpa_ptk *ptk, int akmp, int cipher, in wpa_pmk_to_ptk() argument
452 ptk->kck_len = wpa_kck_len(akmp, pmk_len); in wpa_pmk_to_ptk()
453 ptk->kek_len = wpa_kek_len(akmp, pmk_len); in wpa_pmk_to_ptk()
454 ptk->tk_len = wpa_cipher_key_len(cipher); in wpa_pmk_to_ptk()
455 ptk->kdk_len = kdk_len; in wpa_pmk_to_ptk()
456 if (ptk->tk_len == 0) { in wpa_pmk_to_ptk()
462 ptk_len = ptk->kck_len + ptk->kek_len + ptk->tk_len + ptk->kdk_len; in wpa_pmk_to_ptk()
567 os_memcpy(ptk->kck, tmp, ptk->kck_len); in wpa_pmk_to_ptk()
568 wpa_hexdump_key(MSG_DEBUG, "WPA: KCK", ptk->kck, ptk->kck_len); in wpa_pmk_to_ptk()
570 os_memcpy(ptk->kek, tmp + ptk->kck_len, ptk->kek_len); in wpa_pmk_to_ptk()
[all …]
Dcommon_module_tests.c647 struct wpa_ptk ptk; in pasn_test_pasn_auth() local
653 &ptk, WPA_KEY_MGMT_PASN, WPA_CIPHER_CCMP, in pasn_test_pasn_auth()
659 if (ptk.kck_len != sizeof(kck) || in pasn_test_pasn_auth()
660 os_memcmp(kck, ptk.kck, sizeof(kck)) != 0) { in pasn_test_pasn_auth()
665 if (ptk.tk_len != sizeof(tk) || in pasn_test_pasn_auth()
666 os_memcmp(tk, ptk.tk, sizeof(tk)) != 0) { in pasn_test_pasn_auth()
671 if (ptk.kdk_len != sizeof(kdk) || in pasn_test_pasn_auth()
672 os_memcmp(kdk, ptk.kdk, sizeof(kdk)) != 0) { in pasn_test_pasn_auth()
726 struct wpa_ptk ptk; in pasn_test_no_pasn_auth() local
732 &ptk, WPA_KEY_MGMT_SAE, WPA_CIPHER_CCMP, in pasn_test_no_pasn_auth()
[all …]
Dptksa_cache.c197 ret = wpa_snprintf_hex(pos, buf + len - pos, e->ptk.tk, in ptksa_cache_list()
198 e->ptk.tk_len); in ptksa_cache_list()
208 ret = wpa_snprintf_hex(pos, buf + len - pos, e->ptk.kdk, in ptksa_cache_list()
209 e->ptk.kdk_len); in ptksa_cache_list()
280 const struct wpa_ptk *ptk, in ptksa_cache_add() argument
289 if (!ptksa || !ptk || !addr || !life_time || cipher == WPA_CIPHER_NONE) in ptksa_cache_add()
313 os_memcpy(&entry->ptk, ptk, sizeof(entry->ptk)); in ptksa_cache_add()
376 u32 cipher, u32 life_time, const struct wpa_ptk *ptk, in ptksa_cache_add() argument
Dptksa_cache.h22 struct wpa_ptk ptk; member
44 const struct wpa_ptk *ptk,
Dwpa_common.h467 struct wpa_ptk *ptk, int akmp, int cipher,
476 size_t dhss_len, struct wpa_ptk *ptk,
511 struct wpa_ptk *ptk, u8 *ptk_name, int akmp, int cipher,
772 struct wpa_ptk *ptk, int akmp, int cipher,
782 int wpa_ltf_keyseed(struct wpa_ptk *ptk, int akmp, int cipher);
/hostap-latest/src/rsn_supp/
Dwpa_ft.c38 const struct wpa_eapol_key *key, struct wpa_ptk *ptk) in wpa_derive_ptk_ft() argument
85 sm->pmk_r1_name, ptk, ptk_name, sm->key_mgmt, in wpa_derive_ptk_ft()
98 ret = wpa_ltf_keyseed(ptk, sm->key_mgmt, sm->pairwise_cipher); in wpa_derive_ptk_ft()
511 (u8 *) sm->ptk.tk, keylen, in wpa_ft_install_ptk()
519 sm->dot11RSNAConfigPMKLifetime, &sm->ptk); in wpa_ft_install_ptk()
713 sm->pmk_r1_name, &sm->ptk, ptk_name, sm->key_mgmt, in wpa_ft_process_response()
727 wpa_ltf_keyseed(&sm->ptk, sm->key_mgmt, sm->pairwise_cipher)) { in wpa_ft_process_response()
734 kck = sm->ptk.kck2; in wpa_ft_process_response()
735 kck_len = sm->ptk.kck2_len; in wpa_ft_process_response()
737 kck = sm->ptk.kck; in wpa_ft_process_response()
[all …]
Dwpa.c91 int wpa_eapol_key_send(struct wpa_sm *sm, struct wpa_ptk *ptk, in wpa_eapol_key_send() argument
120 if (key_mic && (!ptk || !ptk->kck_len)) in wpa_eapol_key_send()
124 wpa_eapol_key_mic(ptk->kck, ptk->kck_len, sm->key_mgmt, ver, in wpa_eapol_key_send()
131 if (ptk) in wpa_eapol_key_send()
133 ptk->kck, ptk->kck_len); in wpa_eapol_key_send()
148 if (!ptk || !ptk->kek_len) in wpa_eapol_key_send()
178 wpa_hexdump_key(MSG_DEBUG, "WPA: KEK", ptk->kek, ptk->kek_len); in wpa_eapol_key_send()
183 if (aes_siv_encrypt(ptk->kek, ptk->kek_len, in wpa_eapol_key_send()
288 wpa_eapol_key_send(sm, &sm->ptk, ver, wpa_sm_get_auth_addr(sm), in wpa_sm_key_request()
529 struct wpa_ptk *ptk) in wpa_supplicant_send_2_of_4() argument
[all …]
Dwpa_i.h28 struct wpa_ptk ptk, tptk; member
375 sm->ctx->set_rekey_offload(sm->ctx->ctx, sm->ptk.kek, sm->ptk.kek_len, in wpa_sm_set_rekey_offload()
376 sm->ptk.kck, sm->ptk.kck_len, in wpa_sm_set_rekey_offload()
500 u32 life_time, struct wpa_ptk *ptk) in wpa_sm_store_ptk() argument
504 ptk); in wpa_sm_store_ptk()
533 int wpa_eapol_key_send(struct wpa_sm *sm, struct wpa_ptk *ptk,
540 struct wpa_ptk *ptk);
544 struct wpa_ptk *ptk);
547 const struct wpa_eapol_key *key, struct wpa_ptk *ptk);
/hostap-latest/tests/hwsim/
Dtest_erp.py384 ptk = None
405 ptk = binascii.unhexlify(val)
409 if not msk or not emsk or not rIK or not rRK or not pmk or not ptk or not gtk:
414 kck = ptk[0:16]
415 kek = ptk[16:32]
416 tk = ptk[32:48]
471 ptk = None
480 ptk = binascii.unhexlify(val)
484 if not pmk or not ptk or not gtk:
487 kck = ptk[0:16]
[all …]
Dtest_ap_psk.py1471 ptk = sha1_prf(pmk, label, data, 48)
1472 kck = ptk[0:16]
1473 kek = ptk[16:32]
1474 return (ptk, kck, kek)
1556 (ptk, kck, kek) = pmk_to_ptk(pmk, addr, bssid, snonce, anonce)
1587 (ptk, kck, kek) = pmk_to_ptk(pmk, addr, bssid, snonce, anonce)
1614 (ptk, kck, kek) = pmk_to_ptk(pmk, addr, bssid, snonce, anonce)
1637 (ptk, kck, kek) = pmk_to_ptk(pmk, addr, bssid, snonce, anonce)
1641 (ptk, kck, kek) = pmk_to_ptk(pmk, addr, bssid, snonce2, anonce)
1662 (ptk, kck, kek) = pmk_to_ptk(pmk, addr, bssid, snonce, anonce)
[all …]
Dtest_wpas_ap.py1112 ptk = None
1118 ptk = binascii.unhexlify(val)
1122 if not pmk or not ptk or not gtk:
1127 kck = ptk[0:16]
1128 kek = ptk[16:32]
1129 tk = ptk[32:48]
/hostap-latest/src/pasn/
Dpasn_initiator.c668 ret = pasn_mic(pasn->ptk.kck, pasn->akmp, pasn->cipher, in wpas_pasn_build_auth_3()
713 forced_memzero(&pasn->ptk, sizeof(pasn->ptk)); in wpa_pasn_reset()
1235 &pasn->ptk, pasn->akmp, pasn->cipher, in wpa_pasn_auth_rx()
1243 ret = wpa_ltf_keyseed(&pasn->ptk, pasn->akmp, pasn->cipher); in wpa_pasn_auth_rx()
1270 ret = pasn_mic(pasn->ptk.kck, pasn->akmp, pasn->cipher, in wpa_pasn_auth_rx()
1305 ret = pasn_mic(pasn->ptk.kck, pasn->akmp, pasn->cipher, in wpa_pasn_auth_rx()
Dpasn_responder.c351 &pasn->ptk, pasn->akmp, in pasn_derive_keys()
359 ret = wpa_ltf_keyseed(&pasn->ptk, pasn->akmp, in pasn_derive_keys()
558 ret = pasn_mic(pasn->ptk.kck, pasn->akmp, pasn->cipher, in handle_auth_pasn_resp()
976 ret = pasn_mic(pasn->ptk.kck, pasn->akmp, pasn->cipher, in handle_auth_pasn_3()
Dpasn_common.c231 return &pasn->ptk; in pasn_get_ptk()
Dpasn_common.h83 struct wpa_ptk ptk; member
/hostap-latest/wpa_supplicant/
Dpasn_supplicant.c334 entry->ptk.tk_len, in wpas_pasn_set_keys_from_cache()
335 entry->ptk.tk, in wpas_pasn_set_keys_from_cache()
336 entry->ptk.ltf_keyseed_len, in wpas_pasn_set_keys_from_cache()
337 entry->ptk.ltf_keyseed, 0); in wpas_pasn_set_keys_from_cache()
824 forced_memzero(pasn_get_ptk(pasn), sizeof(pasn->ptk)); in wpas_pasn_auth_rx()
/hostap-latest/src/ap/
Dwpa_auth_i.h330 u32 life_time, const struct wpa_ptk *ptk);
339 int wpa_auth_derive_ptk_ft(struct wpa_state_machine *sm, struct wpa_ptk *ptk,
Dwpa_auth.c48 static int wpa_aead_decrypt(struct wpa_state_machine *sm, struct wpa_ptk *ptk,
63 struct wpa_ptk *ptk, int force_sha256,
392 u32 life_time, const struct wpa_ptk *ptk) in wpa_auth_store_ptksa() argument
396 life_time, ptk); in wpa_auth_store_ptksa()
2863 struct wpa_ptk *ptk, int force_sha256, argument
2888 sm->pmk_r1_name, ptk,
2892 ret = wpa_auth_derive_ptk_ft(sm, ptk, pmk_r0, pmk_r1,
2905 ret = wpa_ltf_keyseed(ptk, sm->wpa_key_mgmt,
2929 sm->ANonce, snonce, ptk, akmp,
2940 ret = wpa_ltf_keyseed(ptk, sm->wpa_key_mgmt, sm->pairwise);
[all …]

12