27 Commits (1c015aab62a2958d5af5bed36cc859a4290d17e0)

Author SHA1 Message Date
Zhe Huang 8b526e1c20 Fix SQN incrementation arithmetic (#212)
* Fix SQN incrementation arithmetic

Current implementation of increment_sqn function increments the 48 bits
SQN directly by 1 which is incorrect according to 3GPP TS 33.102 version
11.5.1 Annex C. This bug causes commercial UEs to report AUTHENTICATION
FAILURE EMM cause #21 "synch failure" when SQN is out of sync.

According to 3GPP TS 33.102 version 11.5.1 Annex C, 48 bits SQN consists
of 43 bits SEQ and 5 bits IND parts where SEQ are incremented during
generation of authentication vector or resync procedure. A
new IND value is also assigned when an authentication vector is
generated. However, resync procedure will use the same IND value.

This patch implements the increment_sqn function according to 3GPP TS
33.102 version 11.5.1 Annex C. A new function increment_seq_after_resync
is added to handle the special case of SQN arithmetic during SQN
resynchronization.

This patch is tested with two comercial UEs (Oneplus One and Oneplus 3T).

* Fix the maximum value of SEQ value to be 2^43-1

The SEQ value is 43 bits long and previous maximum value has a typo (one
extra F) which allows SEQ value to be 2^47-1. This patch corrects the typo.
6 years ago
Pedro Alvarez 66db3deeb4 Starting to add Bearer QoS parameter to create session request. 6 years ago
Pedro Alvarez f9e3d3a1f7 Added mechanisms to read and write QCI from/to user_db.csv. 6 years ago
Pedro Alvarez b8bb270ac7 Cosmetic fix. 6 years ago
Pedro Alvarez 6a32b5b047 Starting to separate the increment of SQN into a seperate function. 7 years ago
Pedro Alvarez bd39d8bac2 Fixed bug in getting OPc. Removed debug print. Fixed test12345. UE is still having re-synch issues. 7 years ago
Pedro Alvarez 0d61011d13 Changing user_db.csv to allow users to choose OP/OPc. 7 years ago
David Rupprecht 9d71bec7b6 Unified include guards 7 years ago
David Rupprecht 52e7082aee Small bug fixes, debug print. MAC f1_star does not work 7 years ago
David Rupprecht 5db5399b2f Added HSS sync support (not tested) 7 years ago
David Rupprecht 8ea2e73b63 Making hss an interface for testing 7 years ago
David Rupprecht 3ead643c64 Introducing epc interfaces for hss and srsepc namespace 7 years ago
David Rupprecht 53f05354e6 Making HSS functions private 7 years ago
David Rupprecht 9f3d14cfab Increment sqn 7 years ago
David Rupprecht 5666d3021d Write sqn and user context back to db file 7 years ago
David Rupprecht 1aced47d6a Making the SQN readable from the csv database file 7 years ago
David Rupprecht b1cabf8117 Made MCC and MNC in HSS configurable (not tested) 7 years ago
Pedro Alvarez a8f268c55b Added cleanup functionality to the hss. 7 years ago
Pedro Alvarez 9a0b883296 Added XOR support the the HSS. 7 years ago
Pedro Alvarez aef328d68b Added the ability to the HSS to be configured through a .csv. 7 years ago
Pedro Alvarez 468b0f2581 Fixed some issues with the MME and HSS logging. 7 years ago
Pedro Alvarez 9c54a8b7de Initial code to generate Kasme, rand, autn and xres 7 years ago
Pedro Alvarez 470c815196 Generating RAND 7 years ago
Pedro Alvarez 1a8a2f738b Starting to add SQN generation. 7 years ago
Pedro Alvarez ae18da83b2 Starting to add functions to the HSS to get K, AMF and OP. 7 years ago
Pedro Alvarez efe258fb6f Starting to get the IMSI from the attach request. 7 years ago
Pedro Alvarez ef73254707 Added new HSS class to compute the authentication vectors. 7 years ago