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
diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c
index 4c3e891..872d6f3 100644
--- a/utils/osmo-auc-gen.c
+++ b/utils/osmo-auc-gen.c
@@ -251,8 +251,21 @@
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);
}