aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-14 02:53:56 +0100
committerHarald Welte <laforge@gnumonks.org>2017-03-15 12:46:08 +0000
commit45e778d397a525956e377567d5f9af6318a5343e (patch)
tree59a292e7fd2ea808acd9aed074c8e1033e032ab1
parentbb6f7b7becb138da78c0f677d6340065f91d0067 (diff)
milenage_test: enhance to verify new SQN increments
After the legacy mode incrementing with ind_bitlen == 0 is through, do another AUTS run with sensible ind_bitlen and ind, and then two more normal vector generations to verify proper SQN increments. Related: OS#1968 Change-Id: Id6947899ff7b1c82b939f969e163e51ce282bce2
-rw-r--r--tests/auth/milenage_test.c28
-rw-r--r--tests/auth/milenage_test.ok3
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/auth/milenage_test.c b/tests/auth/milenage_test.c
index 7aada36b..b4c2c79b 100644
--- a/tests/auth/milenage_test.c
+++ b/tests/auth/milenage_test.c
@@ -104,6 +104,34 @@ int main(int argc, char **argv)
test_aud.u.umts.sqn);
}
+ /* Now test SQN incrementing scheme using SEQ and IND parts:
+ * with ind_bitlen == 5 and ind == 10, the next SQN after 31 is
+ * 32 + 10 == 42. */
+ test_aud.u.umts.ind_bitlen = 5;
+ test_aud.u.umts.ind = 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 b0eb44bb..5a0a6021 100644
--- a/tests/auth/milenage_test.ok
+++ b/tests/auth/milenage_test.ok
@@ -6,6 +6,9 @@ RES: e9 fc 88 cc c8 a3 53 81
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