[MERGED] libosmocore[master]: osmo-auc-gen: cosmetic: clarify output upon AUTS

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Feb 4 14:46:20 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: osmo-auc-gen: cosmetic: clarify output upon AUTS
......................................................................


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
---
M utils/osmo-auc-gen.c
1 file changed, 14 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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);
 }

-- 
To view, visit https://gerrit.osmocom.org/1734
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I881bbe8246a5e7d3a5065b4b5b533255723b1a9e
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list