[PATCH] libosmocore[master]: milenage_test: enhance to verify new SQN increments

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue Mar 14 02:22:07 UTC 2017


Hello Jenkins Builder,

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

    https://gerrit.osmocom.org/2050

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

milenage_test: enhance to verify new SQN increments

After the legacy mode incrementing with IND == 0 is through, do another AUTS
run with sensible IND and i, and then two more normal vector generations to
verify proper SQN increments.

Change-Id: Id6947899ff7b1c82b939f969e163e51ce282bce2
---
M tests/auth/milenage_test.c
M tests/auth/milenage_test.ok
2 files changed, 30 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/50/2050/2

diff --git a/tests/auth/milenage_test.c b/tests/auth/milenage_test.c
index f24a9ef..8d29571 100644
--- a/tests/auth/milenage_test.c
+++ b/tests/auth/milenage_test.c
@@ -104,6 +104,33 @@
 		       test_aud.u.umts.sqn);
 	}
 
+	/* Now test SQN incrementing scheme using SEQ and IND parts: with
+	 * IND == 5 and i == 10, the next SQN after 31 is 32 + 10 == 42. */
+	test_aud.u.umts.ind = 5;
+	test_aud.u.umts.i = 10;
+	rc = osmo_auth_gen_vec_auts(vec, &test_aud, auts, _rand, _rand);
+	if (rc < 0)
+		printf("AUTS failed\n");
+	else
+		printf("AUTS success: tuple generated with SQN = %" PRIu64 "\n",
+		       test_aud.u.umts.sqn);
+
+	/* And the one after that is 64 + 10 == 74 */
+	rc = osmo_auth_gen_vec(vec, &test_aud, _rand);
+	if (rc < 0)
+		printf("generating vector failed\n");
+	else
+		printf("tuple generated with SQN = %" PRIu64 "\n",
+		       test_aud.u.umts.sqn);
+
+	/* And the one after *that* is 96 + 10 == 106 */
+	rc = osmo_auth_gen_vec(vec, &test_aud, _rand);
+	if (rc < 0)
+		printf("generating vector failed\n");
+	else
+		printf("tuple generated with SQN = %" PRIu64 "\n",
+		       test_aud.u.umts.sqn);
+
 	opc_test(&test_aud);
 
 	exit(0);
diff --git a/tests/auth/milenage_test.ok b/tests/auth/milenage_test.ok
index b0eb44b..5a0a602 100644
--- a/tests/auth/milenage_test.ok
+++ b/tests/auth/milenage_test.ok
@@ -6,6 +6,9 @@
 SRES:	21 5f db 4d 
 Kc:	6d e8 16 a7 59 a4 29 12 
 AUTS success: tuple generated with SQN = 32
+AUTS success: tuple generated with SQN = 42
+tuple generated with SQN = 74
+tuple generated with SQN = 106
 MILENAGE supported: 1
 OP:	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 OPC:	c6 a1 3b 37 87 8f 5b 82 6f 4f 81 62 a1 c8 d8 79 

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id6947899ff7b1c82b939f969e163e51ce282bce2
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