summaryrefslogtreecommitdiffstats
path: root/src/gsm/auth_milenage.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix/Update copyright notices; Add SPDX annotationHarald Welte2017-11-131-0/+2
| | | | | | | | Let's fix some erroneous/accidential references to wrong license, update copyright information where applicable and introduce a SPDX-License-Identifier to all files. Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
* auth: add OSMO_MILENAGE_IND_BITLEN_MAXNeels Hofmeyr2017-10-091-1/+1
| | | | | | Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Ic39f3404d1a49ffd06070aa9897b36f219eacf4d
* umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-genNeels Hofmeyr2017-08-291-1/+2
| | | | | | | | | | | | | | | | When doing UMTS AKA with AUTS, it can be interesting to know the SQN.MS that was encoded in the AUTS. The only way to know this is to provide it as a separate out-parameter from milenage_gen_vec_auts(), because the SQN.MS from AUTS stored in umts.sqn is immediately modified non-trivially by milenage_gen_vec(). Add sqn_ms to struct osmo_sub_auth_data to retain SQN.MS even after a vector was generated. Use this to print out SQN.MS for 'osmo-auc-gen -3 -A'. Adjust test suite expectations. Related: OS#2464 Change-Id: I9fc05bbf169d06716f40b995154fd42a3f91bef3
* auth_milenage: Fix non-AUTS case with OPHarald Welte2017-08-161-12/+24
| | | | | | | | | We only implemented OPC generation from OP in the AUTS case, but not in the case of normal authentication vector generation. This never really was visible so far due to the fact that we use OPC at sysmocom, and never the shared OP value. Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26
* doxygen: unify use of \file across the boardNeels Hofmeyr2017-06-231-3/+4
| | | | | | | | | | | | | | | | | Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
* update/extend doxygen documentationHarald Welte2017-06-121-0/+6
| | | | | | | | | It's a pity that even with this patch we still are fare away from having the whole API documented. However, at least we have a more solid foundation. Updates not only extend the documentation, but also make sure it is rendered properly in the doxygen HTML. Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3
* auth_milenage: fix check against too large indNeels Hofmeyr2017-03-161-1/+1
| | | | | | | To ensure that the IND index appended to SEQ does not affect the SEQ, the check should read '>= seq_1', not '>'. Change-Id: Ib1251159eee02aa07fae1b429ffec2e4604bf6a8
* osmo_auth_gen_vec: UMTS auth: fix SQN as SEQ || INDNeels Hofmeyr2017-03-151-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | So far we incremented SQN by 1, which doesn't match the procedures described in 3GPP TS 33.102. An IND (index) denotes a non-significant part of SQN, and the significant SEQ part needs to be incremented. In OsmoHLR we furthermore want to use the "exception" suggested in annex C.3.4, so that each HLR's client has a fixed IND index. In other words, we will not assign IND cyclically, but keep IND unchanged per auth vector consumer. Add 'ind_bitlen' and 'ind' to the osmo_sub_auth_data.u.umts structure and increment SQN accordingly. Add a comment explaining the details. Because 'ind_bitlen' is still passed as zero, the milenage_test does not change its behavior, which is a feature I want to clearly show in this patch. The test will be expanded for the newly implemented SQN scheme in a subsequent patch. Adjust osmo-auc-gen.c to still show the right SQN and SQN.MS -- because it is passing ind_bitlen == 0, osmo-auc-gen can rely on single increments and know SQN.MS is sqn - 1. Note that osmo-auc-gen_test output remains unchanged. Related: OS#1968 Change-Id: Ibc97e1736a797ffcbf8c1f7d41c5c4518f4e41bf
* osmo_auth_gen_vec: UMTS auth: store last used SQN, not nextNeels Hofmeyr2017-03-151-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare for the implementation of splitting SQN increments in SEQ and an IND part; particularly to clearly show where the changes in auth/milenage_test's expectations originate. Rationale: the source of UMTS auth vectors, for us usually OsmoHLR, typically stores the last used SQN, not the next one to be used. Particularly with the upcoming fix of the SQN scheme, this change is important: the next SQN will depend on which entity asks for it, because each auth consumer may have a particular slot in the IND part of SQN. It does not make sense to store the next SQN, because we will not know which consumer that will be for. The milenage_test has always calculated a tuple for SQN == 34. To account for the increment now happening before calculating a tuple, lower the test_aud->sqn by one to 0x21 == 33, so that it is still calculating for SQN == 34. Because we are no longer incrementing SQN after the tuple is generated, milenage_test's expected output after doing an AUTS resync to 31 changes to the next SQN = 32, the SQN used for the generated tuple. (BTW, a subsequent patch will illustrate AUTS in detail.) osmo-auc-gen now needs to pass the user requested SQN less one, because the SQN will be incremented befor generating the auth vector. Also the SQN remains the same after generating, so SQN output needs less decrementing. Note that the expected output for osmo-auc-gen_test remains unchanged, hence the same input arguments (particularly -s <sqn> and -A <auts>) still produce the same results. Note: osmo-hlr regression tests will require adjustments when this patch is merged, because it must now pass desired_sqn - 1 instead of just desired_sqn. See osmo-hlr change-id I4ec5a578537acb1d9e1ebfe00a72417fc3ca5894 . Related: OS#1968 Change-Id: Iadf43f21e0605e9e85f7e8026c40985f7ceff1a3
* Improve code reuseMax2016-04-221-32/+3
| | | | Use generic functions covered by testsuit for SQN calculations.
* auth_milenage/osmo-auc-gen: compute OPC in case only OP is knownHarald Welte2012-03-211-2/+13
|
* auth_core: don't use anonymous unions to make certain gcc versions happyHarald Welte2011-12-071-6/+6
|
* auth_milenage: we now copy RAND in auth_core, no need to do it twiceHarald Welte2011-12-071-1/+0
|
* Auth: Import milenage implementation from hostap (Jouni Malinen)Harald Welte2011-12-061-0/+110
... and add integration into the osmo_auth core.