From 2066a42d5a46c0fe501a6036cb57b7255e955e7d Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 26 Aug 2017 22:43:50 +0200 Subject: umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen 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 --- src/gsm/auth_milenage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gsm/auth_milenage.c') diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 6dd4f45a..e1a1dfba 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -158,9 +158,10 @@ static int milenage_gen_vec_auts(struct osmo_auth_vector *vec, if (rc < 0) return rc; + aud->u.umts.sqn_ms = osmo_load64be_ext(sqn_out, 6) >> 16; /* Update our "largest used SQN" from the USIM -- milenage_gen_vec() * below will increment SQN. */ - aud->u.umts.sqn = osmo_load64be_ext(sqn_out, 6) >> 16; + aud->u.umts.sqn = aud->u.umts.sqn_ms; return milenage_gen_vec(vec, aud, _rand); } -- cgit v1.2.3