From 94e04604fc131a65cf8d08f2a3c60ecccb4bc19a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 3 Feb 2017 03:17:51 +0100 Subject: 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 --- utils/osmo-auc-gen.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'utils') 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); } -- cgit v1.2.3