Lines Matching full:pos
109 const char *pos; in eap_gpsk_init() local
111 pos = os_strstr(phase1, "cipher="); in eap_gpsk_init()
112 if (pos) { in eap_gpsk_init()
113 data->forced_cipher = atoi(pos + 7); in eap_gpsk_init()
144 const u8 *pos, const u8 *end) in eap_gpsk_process_id_server() argument
148 if (end - pos < 2) { in eap_gpsk_process_id_server()
152 alen = WPA_GET_BE16(pos); in eap_gpsk_process_id_server()
153 pos += 2; in eap_gpsk_process_id_server()
154 if (end - pos < alen) { in eap_gpsk_process_id_server()
159 data->id_server = os_memdup(pos, alen); in eap_gpsk_process_id_server()
167 pos += alen; in eap_gpsk_process_id_server()
169 return pos; in eap_gpsk_process_id_server()
174 const u8 *pos, const u8 *end) in eap_gpsk_process_rand_server() argument
176 if (pos == NULL) in eap_gpsk_process_rand_server()
179 if (end - pos < EAP_GPSK_RAND_LEN) { in eap_gpsk_process_rand_server()
183 os_memcpy(data->rand_server, pos, EAP_GPSK_RAND_LEN); in eap_gpsk_process_rand_server()
186 pos += EAP_GPSK_RAND_LEN; in eap_gpsk_process_rand_server()
188 return pos; in eap_gpsk_process_rand_server()
237 const u8 *pos, const u8 *end) in eap_gpsk_process_csuite_list() argument
241 if (pos == NULL) in eap_gpsk_process_csuite_list()
244 if (end - pos < 2) { in eap_gpsk_process_csuite_list()
248 len = WPA_GET_BE16(pos); in eap_gpsk_process_csuite_list()
249 pos += 2; in eap_gpsk_process_csuite_list()
250 if (len > (size_t) (end - pos)) { in eap_gpsk_process_csuite_list()
260 if (eap_gpsk_select_csuite(sm, data, pos, len) < 0) in eap_gpsk_process_csuite_list()
263 *list = pos; in eap_gpsk_process_csuite_list()
265 pos += len; in eap_gpsk_process_csuite_list()
267 return pos; in eap_gpsk_process_csuite_list()
279 const u8 *csuite_list, *pos, *end; in eap_gpsk_process_gpsk_1() local
291 pos = eap_gpsk_process_id_server(data, payload, end); in eap_gpsk_process_gpsk_1()
292 pos = eap_gpsk_process_rand_server(data, pos, end); in eap_gpsk_process_gpsk_1()
293 pos = eap_gpsk_process_csuite_list(sm, data, &csuite_list, in eap_gpsk_process_gpsk_1()
294 &csuite_list_len, pos, end); in eap_gpsk_process_gpsk_1()
295 if (pos == NULL) { in eap_gpsk_process_gpsk_1()
410 const u8 *pos, const u8 *end) in eap_gpsk_validate_rand() argument
412 if (end - pos < EAP_GPSK_RAND_LEN) { in eap_gpsk_validate_rand()
417 if (os_memcmp(pos, data->rand_peer, EAP_GPSK_RAND_LEN) != 0) { in eap_gpsk_validate_rand()
423 pos, EAP_GPSK_RAND_LEN); in eap_gpsk_validate_rand()
426 pos += EAP_GPSK_RAND_LEN; in eap_gpsk_validate_rand()
428 if (end - pos < EAP_GPSK_RAND_LEN) { in eap_gpsk_validate_rand()
433 if (os_memcmp(pos, data->rand_server, EAP_GPSK_RAND_LEN) != 0) { in eap_gpsk_validate_rand()
439 pos, EAP_GPSK_RAND_LEN); in eap_gpsk_validate_rand()
442 pos += EAP_GPSK_RAND_LEN; in eap_gpsk_validate_rand()
444 return pos; in eap_gpsk_validate_rand()
449 const u8 *pos, const u8 *end) in eap_gpsk_validate_id_server() argument
453 if (pos == NULL) in eap_gpsk_validate_id_server()
456 if (end - pos < (int) 2) { in eap_gpsk_validate_id_server()
462 len = WPA_GET_BE16(pos); in eap_gpsk_validate_id_server()
463 pos += 2; in eap_gpsk_validate_id_server()
465 if (end - pos < (int) len) { in eap_gpsk_validate_id_server()
472 os_memcmp(pos, data->id_server, len) != 0) { in eap_gpsk_validate_id_server()
478 pos, len); in eap_gpsk_validate_id_server()
482 pos += len; in eap_gpsk_validate_id_server()
484 return pos; in eap_gpsk_validate_id_server()
489 const u8 *pos, const u8 *end) in eap_gpsk_validate_csuite() argument
494 if (pos == NULL) in eap_gpsk_validate_csuite()
497 if (end - pos < (int) sizeof(*csuite)) { in eap_gpsk_validate_csuite()
502 csuite = (const struct eap_gpsk_csuite *) pos; in eap_gpsk_validate_csuite()
505 pos += sizeof(*csuite); in eap_gpsk_validate_csuite()
513 return pos; in eap_gpsk_validate_csuite()
518 const u8 *pos, const u8 *end) in eap_gpsk_validate_pd_payload_2() argument
522 if (pos == NULL) in eap_gpsk_validate_pd_payload_2()
525 if (end - pos < 2) { in eap_gpsk_validate_pd_payload_2()
530 alen = WPA_GET_BE16(pos); in eap_gpsk_validate_pd_payload_2()
531 pos += 2; in eap_gpsk_validate_pd_payload_2()
532 if (end - pos < alen) { in eap_gpsk_validate_pd_payload_2()
537 wpa_hexdump(MSG_DEBUG, "EAP-GPSK: PD_Payload_2", pos, alen); in eap_gpsk_validate_pd_payload_2()
538 pos += alen; in eap_gpsk_validate_pd_payload_2()
540 return pos; in eap_gpsk_validate_pd_payload_2()
546 const u8 *pos, const u8 *end) in eap_gpsk_validate_gpsk_3_mic() argument
551 if (pos == NULL) in eap_gpsk_validate_gpsk_3_mic()
555 if (end - pos < (int) miclen) { in eap_gpsk_validate_gpsk_3_mic()
558 (unsigned long) (end - pos), in eap_gpsk_validate_gpsk_3_mic()
563 data->specifier, payload, pos - payload, mic) in eap_gpsk_validate_gpsk_3_mic()
568 if (os_memcmp_const(mic, pos, miclen) != 0) { in eap_gpsk_validate_gpsk_3_mic()
570 wpa_hexdump(MSG_DEBUG, "EAP-GPSK: Received MIC", pos, miclen); in eap_gpsk_validate_gpsk_3_mic()
574 pos += miclen; in eap_gpsk_validate_gpsk_3_mic()
576 return pos; in eap_gpsk_validate_gpsk_3_mic()
588 const u8 *pos, *end; in eap_gpsk_process_gpsk_3() local
599 pos = eap_gpsk_validate_rand(data, payload, end); in eap_gpsk_process_gpsk_3()
600 pos = eap_gpsk_validate_id_server(data, pos, end); in eap_gpsk_process_gpsk_3()
601 pos = eap_gpsk_validate_csuite(data, pos, end); in eap_gpsk_process_gpsk_3()
602 pos = eap_gpsk_validate_pd_payload_2(data, pos, end); in eap_gpsk_process_gpsk_3()
603 pos = eap_gpsk_validate_gpsk_3_mic(data, payload, pos, end); in eap_gpsk_process_gpsk_3()
605 if (pos == NULL) { in eap_gpsk_process_gpsk_3()
609 if (pos != end) { in eap_gpsk_process_gpsk_3()
612 (unsigned long) (end - pos)); in eap_gpsk_process_gpsk_3()
668 const u8 *pos; in eap_gpsk_process() local
672 pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_GPSK, reqData, &len); in eap_gpsk_process()
673 if (pos == NULL || len < 1) { in eap_gpsk_process()
679 opcode = *pos++; in eap_gpsk_process()
690 resp = eap_gpsk_process_gpsk_1(sm, data, ret, id, pos, len); in eap_gpsk_process()
693 resp = eap_gpsk_process_gpsk_3(sm, data, ret, id, pos, len); in eap_gpsk_process()