Lines Matching defs:sqn
39 * SQN generation follows the not time-based Profile 2 described in
80 u8 sqn[6];
119 " sqn CHAR(12) NOT NULL"
180 if (os_strcmp(col[i], "sqn") == 0 && argv[i] &&
181 hexstr2bin(argv[i], m->sqn, sizeof(m->sqn))) {
182 printf("Invalid sqn value in database\n");
201 "SELECT ki,opc,amf,sqn FROM milenage WHERE imsi=%llu;",
218 pos += wpa_snprintf_hex(pos, sizeof(val), m->sqn, 6);
221 "UPDATE milenage SET sqn='%s' WHERE imsi=%s;",
224 printf("Failed to update SQN in database for IMSI %s\n",
416 /* Parse IMSI Ki OPc AMF SQN */
498 /* SQN */
502 if (strlen(pos) != 12 || hexstr2bin(pos, m->sqn, 6)) {
544 /* IMSI Ki OPc AMF SQN */
570 pos += wpa_snprintf_hex(pos, end - pos, m->sqn, 6);
692 static void inc_sqn(u8 *sqn)
697 * SQN = SEQ | IND = SEQ1 | SEQ2 | IND
700 * SQN = SEQ1 | IND. The length of IND is ind_len bits and the length
705 val = ((u64) WPA_GET_BE32(sqn) << 16) | ((u64) WPA_GET_BE16(sqn + 4));
709 WPA_PUT_BE32(sqn, val >> 16);
710 WPA_PUT_BE16(sqn + 4, val & 0xffff);
734 inc_sqn(m->sqn);
739 printf("AKA: Milenage with SQN=%02x%02x%02x%02x%02x%02x\n",
740 m->sqn[0], m->sqn[1], m->sqn[2],
741 m->sqn[3], m->sqn[4], m->sqn[5]);
742 milenage_generate(m->opc, m->amf, m->ki, m->sqn, _rand,
795 u8 _auts[EAP_AKA_AUTS_LEN], _rand[EAP_AKA_RAND_LEN], sqn[6];
823 if (milenage_auts(m->opc, m->ki, _rand, _auts, sqn)) {
826 memcpy(m->sqn, sqn, 6);
828 "SQN=%02x%02x%02x%02x%02x%02x\n",
829 sqn[0], sqn[1], sqn[2], sqn[3], sqn[4], sqn[5]);
929 " -u = update SQN in Milenage file on exit\n"
935 " -i<IND len in bits> = IND length for SQN (default: 5)\n",