summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-03 03:17:51 +0100
committerHarald Welte <laforge@gnumonks.org>2017-02-04 14:46:19 +0000
commit94e04604fc131a65cf8d08f2a3c60ecccb4bc19a (patch)
treea964a898640511f28464f33ace4c089a58ac045f /utils
parent08177d324a67b9ef633d2487773db61ad81bb165 (diff)
osmo-auc-gen: cosmetic: clarify output upon AUTS
When calculating a re-sync vector using AUTS, osmo-gen-vec used to print SQN.MS + 2, the new SQN after vector generation, labeled 'SEQ.MS'. Firstly, s/SEQ/SQN. Secondly, print SQN.MS as umts.sqn - 2, which is the actual SQN recovered from the AUTS. As explained in the comment, SQN.MS + 1 is used to generate the vector, and then umts.sqn is increased a second time to indicate the next SQN. With AUTS calculated from SQN.MS == 23, the output was: AUTS success: SEQ.MS = 25 Output now: AUTS success: SQN.MS = 23, generated vector with SQN = 24, next SQN = 25 Change-Id: I881bbe8246a5e7d3a5065b4b5b533255723b1a9e
Diffstat (limited to 'utils')
-rw-r--r--utils/osmo-auc-gen.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c
index 4c3e891b..872d6f39 100644
--- a/utils/osmo-auc-gen.c
+++ b/utils/osmo-auc-gen.c
@@ -251,8 +251,21 @@ int main(int argc, char **argv)
else
dump_auth_vec(vec);
+ /* Print SQN from AUTS. It makes sense to print actually three SQN
+ * to clarify:
+ * After recovering SQN.MS from AUTS, milenage_gen_vec_auts() does:
+ * aud->u.umts.sqn = 1 + (osmo_load64be_ext(sqn_out, 6) >> 16);
+ * Then calls milenage_gen_vec(), which, after it is done, does:
+ * aud->u.umts.sqn++;
+ */
if (auts_is_set)
- printf("AUTS success: SEQ.MS = %" PRIu64 "\n", test_aud.u.umts.sqn);
+ printf("AUTS success: SQN.MS = %" PRIu64
+ ", generated vector with SQN = %" PRIu64
+ ", next SQN = %" PRIu64 "\n",
+ test_aud.u.umts.sqn - 2,
+ test_aud.u.umts.sqn - 1,
+ test_aud.u.umts.sqn
+ );
exit(0);
}