Lines Matching refs:pos
139 u8 *buf, *pos;
147 pos = buf;
148 os_memcpy(pos, sta_addr, ETH_ALEN);
149 pos += ETH_ALEN;
150 os_memcpy(pos, ap_addr, ETH_ALEN);
151 pos += ETH_ALEN;
152 *pos++ = transaction_seqnum;
154 os_memcpy(pos, rsnie, rsnie_len);
155 pos += rsnie_len;
158 os_memcpy(pos, mdie, mdie_len);
159 pos += mdie_len;
163 os_memcpy(pos, ftie, ftie_len);
168 _ftie = (struct rsn_ftie *) (pos + 2);
170 pos += ftie_len;
173 os_memcpy(pos, ric, ric_len);
174 pos += ric_len;
177 wpa_hexdump(MSG_MSGDUMP, "FT: MIC data", buf, pos - buf);
178 if (omac1_aes_128(kck, buf, pos - buf, mic)) {
192 const u8 *end, *pos;
197 pos = ie + sizeof(struct rsn_ftie);
200 while (pos + 2 <= end && pos + 2 + pos[1] <= end) {
201 switch (pos[0]) {
203 if (pos[1] != FT_R1KH_ID_LEN) {
205 "length in FTIE: %d", pos[1]);
208 parse->r1kh_id = pos + 2;
211 parse->gtk = pos + 2;
212 parse->gtk_len = pos[1];
215 if (pos[1] < 1 || pos[1] > FT_R0KH_ID_MAX_LEN) {
217 "length in FTIE: %d", pos[1]);
220 parse->r0kh_id = pos + 2;
221 parse->r0kh_id_len = pos[1];
225 parse->igtk = pos + 2;
226 parse->igtk_len = pos[1];
231 pos += 2 + pos[1];
241 const u8 *end, *pos;
251 pos = ies;
253 while (pos + 2 <= end && pos + 2 + pos[1] <= end) {
254 switch (pos[0]) {
256 parse->rsn = pos + 2;
257 parse->rsn_len = pos[1];
270 parse->mdie = pos + 2;
271 parse->mdie_len = pos[1];
274 if (pos[1] < sizeof(*ftie))
276 ftie = (const struct rsn_ftie *) (pos + 2);
278 if (wpa_ft_parse_ftie(pos + 2, pos[1], parse) < 0)
282 parse->tie = pos + 2;
283 parse->tie_len = pos[1];
287 parse->ric = pos;
291 pos += 2 + pos[1];
320 pos = parse->ric;
321 while (pos && pos + 2 <= end && pos + 2 + pos[1] <= end &&
324 pos += 2 + pos[1];
326 parse->ric_len = pos - parse->ric;
399 const u8 *pos;
438 pos = (const u8 *) (hdr + 1);
442 data->group_cipher = rsn_selector_to_bitfield(pos);
450 pos += RSN_SELECTOR_LEN;
460 count = WPA_GET_LE16(pos);
461 pos += 2;
469 data->pairwise_cipher |= rsn_selector_to_bitfield(pos);
470 pos += RSN_SELECTOR_LEN;
488 count = WPA_GET_LE16(pos);
489 pos += 2;
497 data->key_mgmt |= rsn_key_mgmt_to_bitfield(pos);
498 pos += RSN_SELECTOR_LEN;
508 data->capabilities = WPA_GET_LE16(pos);
509 pos += 2;
514 data->num_pmkid = WPA_GET_LE16(pos);
515 pos += 2;
525 data->pmkid = pos;
526 pos += data->num_pmkid * PMKID_LEN;
533 data->mgmt_group_cipher = rsn_selector_to_bitfield(pos);
540 pos += RSN_SELECTOR_LEN;
586 const u8 *pos;
622 pos = (const u8 *) (hdr + 1);
626 data->group_cipher = wpa_selector_to_bitfield(pos);
627 pos += WPA_SELECTOR_LEN;
637 count = WPA_GET_LE16(pos);
638 pos += 2;
646 data->pairwise_cipher |= wpa_selector_to_bitfield(pos);
647 pos += WPA_SELECTOR_LEN;
658 count = WPA_GET_LE16(pos);
659 pos += 2;
667 data->key_mgmt |= wpa_key_mgmt_to_bitfield(pos);
668 pos += WPA_SELECTOR_LEN;
678 data->capabilities = WPA_GET_LE16(pos);
679 pos += 2;
706 u8 *pos, r0_key_data[48], hash[32];
720 pos = buf;
721 *pos++ = ssid_len;
722 os_memcpy(pos, ssid, ssid_len);
723 pos += ssid_len;
724 os_memcpy(pos, mdid, MOBILITY_DOMAIN_ID_LEN);
725 pos += MOBILITY_DOMAIN_ID_LEN;
726 *pos++ = r0kh_id_len;
727 os_memcpy(pos, r0kh_id, r0kh_id_len);
728 pos += r0kh_id_len;
729 os_memcpy(pos, s0kh_id, ETH_ALEN);
730 pos += ETH_ALEN;
732 sha256_prf(xxkey, xxkey_len, "FT-R0", buf, pos - buf,
789 u8 *pos;
792 pos = buf;
793 os_memcpy(pos, r1kh_id, FT_R1KH_ID_LEN);
794 pos += FT_R1KH_ID_LEN;
795 os_memcpy(pos, s1kh_id, ETH_ALEN);
796 pos += ETH_ALEN;
798 sha256_prf(pmk_r0, PMK_LEN, "FT-R1", buf, pos - buf, pmk_r1, PMK_LEN);
815 u8 *pos, hash[32];
823 pos = buf;
824 os_memcpy(pos, snonce, WPA_NONCE_LEN);
825 pos += WPA_NONCE_LEN;
826 os_memcpy(pos, anonce, WPA_NONCE_LEN);
827 pos += WPA_NONCE_LEN;
828 os_memcpy(pos, bssid, ETH_ALEN);
829 pos += ETH_ALEN;
830 os_memcpy(pos, sta_addr, ETH_ALEN);
831 pos += ETH_ALEN;
833 sha256_prf(pmk_r1, PMK_LEN, "FT-PTK", buf, pos - buf, ptk, ptk_len);
1180 int rsn_cipher_put_suites(u8 *pos, int ciphers)
1185 RSN_SELECTOR_PUT(pos, RSN_CIPHER_SUITE_CCMP);
1186 pos += RSN_SELECTOR_LEN;
1190 RSN_SELECTOR_PUT(pos, RSN_CIPHER_SUITE_GCMP);
1191 pos += RSN_SELECTOR_LEN;
1195 RSN_SELECTOR_PUT(pos, RSN_CIPHER_SUITE_TKIP);
1196 pos += RSN_SELECTOR_LEN;
1200 RSN_SELECTOR_PUT(pos, RSN_CIPHER_SUITE_NONE);
1201 pos += RSN_SELECTOR_LEN;
1209 int wpa_cipher_put_suites(u8 *pos, int ciphers)
1214 RSN_SELECTOR_PUT(pos, WPA_CIPHER_SUITE_CCMP);
1215 pos += WPA_SELECTOR_LEN;
1219 RSN_SELECTOR_PUT(pos, WPA_CIPHER_SUITE_TKIP);
1220 pos += WPA_SELECTOR_LEN;
1224 RSN_SELECTOR_PUT(pos, WPA_CIPHER_SUITE_NONE);
1225 pos += WPA_SELECTOR_LEN;
1312 char *pos = start;
1316 ret = os_snprintf(pos, end - pos, "%sCCMP",
1317 pos == start ? "" : delim);
1318 if (ret < 0 || ret >= end - pos)
1320 pos += ret;
1323 ret = os_snprintf(pos, end - pos, "%sGCMP",
1324 pos == start ? "" : delim);
1325 if (ret < 0 || ret >= end - pos)
1327 pos += ret;
1330 ret = os_snprintf(pos, end - pos, "%sTKIP",
1331 pos == start ? "" : delim);
1332 if (ret < 0 || ret >= end - pos)
1334 pos += ret;
1337 ret = os_snprintf(pos, end - pos, "%sWEP104",
1338 pos == start ? "" : delim);
1339 if (ret < 0 || ret >= end - pos)
1341 pos += ret;
1344 ret = os_snprintf(pos, end - pos, "%sWEP40",
1345 pos == start ? "" : delim);
1346 if (ret < 0 || ret >= end - pos)
1348 pos += ret;
1351 ret = os_snprintf(pos, end - pos, "%sNONE",
1352 pos == start ? "" : delim);
1353 if (ret < 0 || ret >= end - pos)
1355 pos += ret;
1358 return pos - start;