Lines Matching refs:pos
149 int pos = len - 1; in inc_byte_array() local
150 while (pos >= 0) { in inc_byte_array()
151 counter[pos]++; in inc_byte_array()
152 if (counter[pos] != 0) in inc_byte_array()
154 pos--; in inc_byte_array()
293 char *pos = buf; in pmksa_cache_list() local
298 pos += snprintf(pos, buf + len - pos, in pmksa_cache_list()
304 pos += snprintf(pos, buf + len - pos, "%d " MACSTR " ", in pmksa_cache_list()
307 pos += snprintf(pos, buf + len - pos, "%02x", in pmksa_cache_list()
309 pos += snprintf(pos, buf + len - pos, " %d\n", in pmksa_cache_list()
313 return (pos - buf); in pmksa_cache_list()
336 uint8_t *pos; in wpa_parse_wpa_ie_wpa() local
368 pos = (uint8_t *)(hdr + 1); in wpa_parse_wpa_ie_wpa()
372 data->group_cipher = wpa_selector_to_bitfield(pos); in wpa_parse_wpa_ie_wpa()
373 pos += WPA_SELECTOR_LEN; in wpa_parse_wpa_ie_wpa()
383 count = pos[0] | (pos[1] << 8); in wpa_parse_wpa_ie_wpa()
384 pos += 2; in wpa_parse_wpa_ie_wpa()
393 data->pairwise_cipher |= wpa_selector_to_bitfield(pos); in wpa_parse_wpa_ie_wpa()
394 pos += WPA_SELECTOR_LEN; in wpa_parse_wpa_ie_wpa()
405 count = pos[0] | (pos[1] << 8); in wpa_parse_wpa_ie_wpa()
406 pos += 2; in wpa_parse_wpa_ie_wpa()
415 data->key_mgmt |= wpa_key_mgmt_to_bitfield(pos); in wpa_parse_wpa_ie_wpa()
416 pos += WPA_SELECTOR_LEN; in wpa_parse_wpa_ie_wpa()
426 data->capabilities = pos[0] | (pos[1] << 8); in wpa_parse_wpa_ie_wpa()
427 pos += 2; in wpa_parse_wpa_ie_wpa()
446 uint8_t *pos; in wpa_parse_wpa_ie_rsn() local
477 pos = (uint8_t *)(hdr + 1); in wpa_parse_wpa_ie_rsn()
481 data->group_cipher = rsn_selector_to_bitfield(pos); in wpa_parse_wpa_ie_rsn()
482 pos += RSN_SELECTOR_LEN; in wpa_parse_wpa_ie_rsn()
492 count = pos[0] | (pos[1] << 8); in wpa_parse_wpa_ie_rsn()
493 pos += 2; in wpa_parse_wpa_ie_rsn()
502 data->pairwise_cipher |= rsn_selector_to_bitfield(pos); in wpa_parse_wpa_ie_rsn()
503 pos += RSN_SELECTOR_LEN; in wpa_parse_wpa_ie_rsn()
514 count = pos[0] | (pos[1] << 8); in wpa_parse_wpa_ie_rsn()
515 pos += 2; in wpa_parse_wpa_ie_rsn()
524 data->key_mgmt |= rsn_key_mgmt_to_bitfield(pos); in wpa_parse_wpa_ie_rsn()
525 pos += RSN_SELECTOR_LEN; in wpa_parse_wpa_ie_rsn()
535 data->capabilities = pos[0] | (pos[1] << 8); in wpa_parse_wpa_ie_rsn()
536 pos += 2; in wpa_parse_wpa_ie_rsn()
565 uint8_t *pos; in wpa_gen_wpa_ie_wpa() local
572 pos = (uint8_t *)(hdr + 1); in wpa_gen_wpa_ie_wpa()
575 (void) memcpy(pos, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN); in wpa_gen_wpa_ie_wpa()
577 (void) memcpy(pos, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN); in wpa_gen_wpa_ie_wpa()
579 (void) memcpy(pos, WPA_CIPHER_SUITE_WEP104, WPA_SELECTOR_LEN); in wpa_gen_wpa_ie_wpa()
581 (void) memcpy(pos, WPA_CIPHER_SUITE_WEP40, WPA_SELECTOR_LEN); in wpa_gen_wpa_ie_wpa()
587 pos += WPA_SELECTOR_LEN; in wpa_gen_wpa_ie_wpa()
589 *pos++ = 1; in wpa_gen_wpa_ie_wpa()
590 *pos++ = 0; in wpa_gen_wpa_ie_wpa()
592 (void) memcpy(pos, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN); in wpa_gen_wpa_ie_wpa()
594 (void) memcpy(pos, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN); in wpa_gen_wpa_ie_wpa()
596 (void) memcpy(pos, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN); in wpa_gen_wpa_ie_wpa()
602 pos += WPA_SELECTOR_LEN; in wpa_gen_wpa_ie_wpa()
604 *pos++ = 1; in wpa_gen_wpa_ie_wpa()
605 *pos++ = 0; in wpa_gen_wpa_ie_wpa()
607 (void) memcpy(pos, WPA_AUTH_KEY_MGMT_UNSPEC_802_1X, in wpa_gen_wpa_ie_wpa()
610 (void) memcpy(pos, WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X, in wpa_gen_wpa_ie_wpa()
617 pos += WPA_SELECTOR_LEN; in wpa_gen_wpa_ie_wpa()
622 hdr->len = (pos - wpa_ie) - 2; in wpa_gen_wpa_ie_wpa()
624 return (pos - wpa_ie); in wpa_gen_wpa_ie_wpa()
630 uint8_t *pos; in wpa_gen_wpa_ie_rsn() local
636 pos = (uint8_t *)(hdr + 1); in wpa_gen_wpa_ie_rsn()
639 (void) memcpy(pos, RSN_CIPHER_SUITE_CCMP, RSN_SELECTOR_LEN); in wpa_gen_wpa_ie_rsn()
641 (void) memcpy(pos, RSN_CIPHER_SUITE_TKIP, RSN_SELECTOR_LEN); in wpa_gen_wpa_ie_rsn()
643 (void) memcpy(pos, RSN_CIPHER_SUITE_WEP104, RSN_SELECTOR_LEN); in wpa_gen_wpa_ie_rsn()
645 (void) memcpy(pos, RSN_CIPHER_SUITE_WEP40, RSN_SELECTOR_LEN); in wpa_gen_wpa_ie_rsn()
651 pos += RSN_SELECTOR_LEN; in wpa_gen_wpa_ie_rsn()
653 *pos++ = 1; in wpa_gen_wpa_ie_rsn()
654 *pos++ = 0; in wpa_gen_wpa_ie_rsn()
656 (void) memcpy(pos, RSN_CIPHER_SUITE_CCMP, RSN_SELECTOR_LEN); in wpa_gen_wpa_ie_rsn()
658 (void) memcpy(pos, RSN_CIPHER_SUITE_TKIP, RSN_SELECTOR_LEN); in wpa_gen_wpa_ie_rsn()
660 (void) memcpy(pos, RSN_CIPHER_SUITE_NONE, RSN_SELECTOR_LEN); in wpa_gen_wpa_ie_rsn()
666 pos += RSN_SELECTOR_LEN; in wpa_gen_wpa_ie_rsn()
668 *pos++ = 1; in wpa_gen_wpa_ie_rsn()
669 *pos++ = 0; in wpa_gen_wpa_ie_rsn()
671 (void) memcpy(pos, RSN_AUTH_KEY_MGMT_UNSPEC_802_1X, in wpa_gen_wpa_ie_rsn()
674 (void) memcpy(pos, RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X, in wpa_gen_wpa_ie_rsn()
681 pos += RSN_SELECTOR_LEN; in wpa_gen_wpa_ie_rsn()
684 *pos++ = 0; in wpa_gen_wpa_ie_rsn()
685 *pos++ = 0; in wpa_gen_wpa_ie_rsn()
689 *pos++ = 1; in wpa_gen_wpa_ie_rsn()
690 *pos++ = 0; in wpa_gen_wpa_ie_rsn()
692 (void) memcpy(pos, wpa_s->cur_pmksa->pmkid, PMKID_LEN); in wpa_gen_wpa_ie_rsn()
693 pos += PMKID_LEN; in wpa_gen_wpa_ie_rsn()
696 hdr->len = (pos - rsn_ie) - 2; in wpa_gen_wpa_ie_rsn()
698 return (pos - rsn_ie); in wpa_gen_wpa_ie_rsn()
897 uint8_t *pos = (uint8_t *)(key + 1); in wpa_supplicant_process_1_of_4() local
898 uint8_t *end = pos + BE_16(key->key_data_length); in wpa_supplicant_process_1_of_4()
901 pos, BE_16(key->key_data_length)); in wpa_supplicant_process_1_of_4()
903 while (pos + 1 < end) { in wpa_supplicant_process_1_of_4()
904 if (pos + 2 + pos[1] > end) { in wpa_supplicant_process_1_of_4()
907 pos[0], pos[1]); in wpa_supplicant_process_1_of_4()
910 if (pos[0] == GENERIC_INFO_ELEM && in wpa_supplicant_process_1_of_4()
911 pos + 1 + RSN_SELECTOR_LEN < end && in wpa_supplicant_process_1_of_4()
912 pos[1] >= RSN_SELECTOR_LEN + PMKID_LEN && in wpa_supplicant_process_1_of_4()
913 memcmp(pos + 2, RSN_KEY_DATA_PMKID, in wpa_supplicant_process_1_of_4()
915 pmkid = pos + 2 + RSN_SELECTOR_LEN; in wpa_supplicant_process_1_of_4()
919 } else if (pos[0] == GENERIC_INFO_ELEM && pos[1] == 0) in wpa_supplicant_process_1_of_4()
921 pos += 2 + pos[1]; in wpa_supplicant_process_1_of_4()
1123 uint8_t *pos = (uint8_t *)(key + 1); in wpa_supplicant_process_3_of_4() local
1124 uint8_t *end = pos + BE_16(key->key_data_length); in wpa_supplicant_process_3_of_4()
1125 while (pos + 1 < end) { in wpa_supplicant_process_3_of_4()
1126 if (pos + 2 + pos[1] > end) { in wpa_supplicant_process_3_of_4()
1129 pos[0], pos[1]); in wpa_supplicant_process_3_of_4()
1132 if (*pos == RSN_INFO_ELEM) { in wpa_supplicant_process_3_of_4()
1133 ie = pos; in wpa_supplicant_process_3_of_4()
1134 ie_len = pos[1] + 2; in wpa_supplicant_process_3_of_4()
1135 } else if (pos[0] == GENERIC_INFO_ELEM && in wpa_supplicant_process_3_of_4()
1136 pos + 1 + RSN_SELECTOR_LEN < end && in wpa_supplicant_process_3_of_4()
1137 pos[1] > RSN_SELECTOR_LEN + 2 && in wpa_supplicant_process_3_of_4()
1138 memcmp(pos + 2, RSN_KEY_DATA_GROUPKEY, in wpa_supplicant_process_3_of_4()
1145 gtk = pos + 2 + RSN_SELECTOR_LEN; in wpa_supplicant_process_3_of_4()
1146 gtk_len = pos[1] - RSN_SELECTOR_LEN; in wpa_supplicant_process_3_of_4()
1147 } else if (pos[0] == GENERIC_INFO_ELEM && pos[1] == 0) in wpa_supplicant_process_3_of_4()
1150 pos += 2 + pos[1]; in wpa_supplicant_process_3_of_4()
1319 uint8_t *pos = (uint8_t *)(key + 1); in wpa_supplicant_process_1_of_2() local
1320 uint8_t *end = pos + keydatalen; in wpa_supplicant_process_1_of_2()
1321 while (pos + 1 < end) { in wpa_supplicant_process_1_of_2()
1322 if (pos + 2 + pos[1] > end) { in wpa_supplicant_process_1_of_2()
1325 pos[0], pos[1]); in wpa_supplicant_process_1_of_2()
1328 if (pos[0] == GENERIC_INFO_ELEM && in wpa_supplicant_process_1_of_2()
1329 pos + 1 + RSN_SELECTOR_LEN < end && in wpa_supplicant_process_1_of_2()
1330 pos[1] > RSN_SELECTOR_LEN + 2 && in wpa_supplicant_process_1_of_2()
1331 memcmp(pos + 2, RSN_KEY_DATA_GROUPKEY, in wpa_supplicant_process_1_of_2()
1338 gtk_ie = pos + 2 + RSN_SELECTOR_LEN; in wpa_supplicant_process_1_of_2()
1339 gtk_ie_len = pos[1] - RSN_SELECTOR_LEN; in wpa_supplicant_process_1_of_2()
1341 } else if (pos[0] == GENERIC_INFO_ELEM && pos[1] == 0) { in wpa_supplicant_process_1_of_2()
1345 pos += 2 + pos[1]; in wpa_supplicant_process_1_of_2()