Home | History | Annotate | Download | only in hostapd

Lines Matching refs:pos

117 	char buf[200], *pos, *pos2;
138 pos = buf;
139 while (*pos != '\0' && *pos != '\n')
140 pos++;
141 if (*pos == '\n')
142 *pos = '\0';
143 pos = buf;
144 if (*pos == '\0')
154 pos2 = strchr(pos, ':');
157 fname, line, pos);
162 if (strlen(pos) >= sizeof(g->imsi)) {
164 fname, line, pos);
168 os_strlcpy(g->imsi, pos, sizeof(g->imsi));
169 pos = pos2 + 1;
172 pos2 = strchr(pos, ':');
174 printf("%s:%d - Invalid Kc (%s)\n", fname, line, pos);
179 if (strlen(pos) != 16 || hexstr2bin(pos, g->kc, 8)) {
180 printf("%s:%d - Invalid Kc (%s)\n", fname, line, pos);
184 pos = pos2 + 1;
187 pos2 = strchr(pos, ':');
190 pos);
195 if (strlen(pos) != 8 || hexstr2bin(pos, g->sres, 4)) {
197 pos);
201 pos = pos2 + 1;
204 pos2 = strchr(pos, ':');
207 if (strlen(pos) != 32 || hexstr2bin(pos, g->_rand, 16)) {
209 pos);
213 pos = pos2 + 1;
255 char buf[200], *pos, *pos2;
276 pos = buf;
277 while (*pos != '\0' && *pos != '\n')
278 pos++;
279 if (*pos == '\n')
280 *pos = '\0';
281 pos = buf;
282 if (*pos == '\0')
292 pos2 = strchr(pos, ' ');
295 fname, line, pos);
300 if (strlen(pos) >= sizeof(m->imsi)) {
302 fname, line, pos);
306 os_strlcpy(m->imsi, pos, sizeof(m->imsi));
307 pos = pos2 + 1;
310 pos2 = strchr(pos, ' ');
312 printf("%s:%d - Invalid Ki (%s)\n", fname, line, pos);
317 if (strlen(pos) != 32 || hexstr2bin(pos, m->ki, 16)) {
318 printf("%s:%d - Invalid Ki (%s)\n", fname, line, pos);
322 pos = pos2 + 1;
325 pos2 = strchr(pos, ' ');
327 printf("%s:%d - Invalid OPc (%s)\n", fname, line, pos);
332 if (strlen(pos) != 32 || hexstr2bin(pos, m->opc, 16)) {
333 printf("%s:%d - Invalid OPc (%s)\n", fname, line, pos);
337 pos = pos2 + 1;
340 pos2 = strchr(pos, ' ');
342 printf("%s:%d - Invalid AMF (%s)\n", fname, line, pos);
347 if (strlen(pos) != 4 || hexstr2bin(pos, m->amf, 2)) {
348 printf("%s:%d - Invalid AMF (%s)\n", fname, line, pos);
352 pos = pos2 + 1;
355 pos2 = strchr(pos, ' ');
358 if (strlen(pos) != 12 || hexstr2bin(pos, m->sqn, 6)) {
359 printf("%s:%d - Invalid SEQ (%s)\n", fname, line, pos);
363 pos = pos2 + 1;
395 char *pos;
402 pos = strchr(imsi, ' ');
403 if (pos) {
404 *pos++ = '\0';
405 max_chal = atoi(pos);
473 char reply[1000], *pos, *end;
509 pos = reply;
511 ret = snprintf(pos, end - pos, "AKA-RESP-AUTH %s ", imsi);
512 if (ret < 0 || ret >= end - pos)
514 pos += ret;
515 pos += wpa_snprintf_hex(pos, end - pos, _rand, EAP_AKA_RAND_LEN);
516 *pos++ = ' ';
517 pos += wpa_snprintf_hex(pos, end - pos, autn, EAP_AKA_AUTN_LEN);
518 *pos++ = ' ';
519 pos += wpa_snprintf_hex(pos, end - pos, ik, EAP_AKA_IK_LEN);
520 *pos++ = ' ';
521 pos += wpa_snprintf_hex(pos, end - pos, ck, EAP_AKA_CK_LEN);
522 *pos++ = ' ';
523 pos += wpa_snprintf_hex(pos, end - pos, res, res_len);
527 if (sendto(s, reply, pos - reply, 0, (struct sockaddr *) from,