summaryrefslogtreecommitdiffstats
path: root/include/osmocom/crypt
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-13 17:27:17 +0100
committerHarald Welte <laforge@gnumonks.org>2017-03-15 12:46:08 +0000
commitbb6f7b7becb138da78c0f677d6340065f91d0067 (patch)
tree4b225228eaa90bbd9400e4d24dd045be4887f86e /include/osmocom/crypt
parent82c9a0ec198d83452a4232f288e230b59fa1eaf8 (diff)
osmo_auth_gen_vec: UMTS auth: fix SQN as SEQ || IND
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
Diffstat (limited to 'include/osmocom/crypt')
-rw-r--r--include/osmocom/crypt/auth.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h
index 7c6072b2..7a27f3b3 100644
--- a/include/osmocom/crypt/auth.h
+++ b/include/osmocom/crypt/auth.h
@@ -39,6 +39,8 @@ struct osmo_sub_auth_data {
uint8_t amf[2];
uint64_t sqn; /*!< sequence number */
int opc_is_op; /*!< is the OPC field OPC (0) or OP (1) ? */
+ unsigned int ind_bitlen; /*!< nr of bits not in SEQ, only SQN */
+ unsigned int ind; /*!< SQN slot, i.e. (SEQ << ind_bitlen) + ind */
} umts;
struct {
uint8_t ki[16]; /*!< secret key */