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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Feb 3 17:40:27 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/1734

to look at the new patch set (#2).

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(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/1734/2

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: newpatchset
Gerrit-Change-Id: I881bbe8246a5e7d3a5065b4b5b533255723b1a9e
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list