summaryrefslogtreecommitdiffstats
path: root/tests/osmo-auc-gen
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-15 01:52:58 +0100
committerHarald Welte <laforge@gnumonks.org>2017-03-15 12:46:08 +0000
commitd3b58730d5c86db96ee51e458ad35596617bebe9 (patch)
treeaab9f300850dc5e376617ba13853f4f3f037a16d /tests/osmo-auc-gen
parent8e1b598c8ae408f0dd15a4460920a4d82eb05a27 (diff)
add osmo-auc-gen_test
Add test for osmo-auc-gen invocations to ensure stability across upcoming SQN increment scheme changes. The test comprises of a shell script that invokes the osmo-auc-gen binary with various milenage parameters, of which the stdout/stderr are verified. More osmo-auc-gen invocations could be added, but my main focus is on the SEQ changes. Instead of manually testing that it still works for each SQN patch, I want this test to do it for me. To make sure that osmo-auc-gen is build before the tests are launched, place 'utils' before 'tests' in the root Makefile.am. Related: OS#1968 Change-Id: Ib4af34201cd2e7d76037bcd31dd89ef18c1a9aec
Diffstat (limited to 'tests/osmo-auc-gen')
-rw-r--r--tests/osmo-auc-gen/osmo-auc-gen_test.err0
-rw-r--r--tests/osmo-auc-gen/osmo-auc-gen_test.ok92
-rwxr-xr-xtests/osmo-auc-gen/osmo-auc-gen_test.sh30
3 files changed, 122 insertions, 0 deletions
diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.err b/tests/osmo-auc-gen/osmo-auc-gen_test.err
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/osmo-auc-gen/osmo-auc-gen_test.err
diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok
new file mode 100644
index 00000000..9c2e462b
--- /dev/null
+++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok
@@ -0,0 +1,92 @@
+
+
+> osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 0
+osmo-auc-gen (C) 2011-2012 by Harald Welte
+This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
+
+RAND: 6a61050765caa32c90371370e5d6dc2d
+AUTN: 790c5d80c47b0000716ce00883bc39e1
+IK: 6cf555588bb61ab2ff23cd333c05ed09
+CK: f0b29f50a7d873f30336473bdc35d04f
+RES: f511d3a7f06e6a30
+SRES: 057fb997
+Kc: 60524000cc5e5407
+
+
+> osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 1
+osmo-auc-gen (C) 2011-2012 by Harald Welte
+This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
+
+RAND: 6a61050765caa32c90371370e5d6dc2d
+AUTN: 790c5d80c47a000058508ab3864e26a0
+IK: 6cf555588bb61ab2ff23cd333c05ed09
+CK: f0b29f50a7d873f30336473bdc35d04f
+RES: f511d3a7f06e6a30
+SRES: 057fb997
+Kc: 60524000cc5e5407
+
+
+> osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 23
+osmo-auc-gen (C) 2011-2012 by Harald Welte
+This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
+
+RAND: 6a61050765caa32c90371370e5d6dc2d
+AUTN: 790c5d80c46c0000e74d796ec095dbee
+IK: 6cf555588bb61ab2ff23cd333c05ed09
+CK: f0b29f50a7d873f30336473bdc35d04f
+RES: f511d3a7f06e6a30
+SRES: 057fb997
+Kc: 60524000cc5e5407
+
+
+> osmo-auc-gen -3 -a milenage -r 1dc4f974325cce611e54f516dc1fec56 -k 2a48162ff3edca4adf0b7b5e527d6c16 -o 6a61050765caa32c90371370e5d6dc2d -s 42
+osmo-auc-gen (C) 2011-2012 by Harald Welte
+This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
+
+RAND: 1dc4f974325cce611e54f516dc1fec56
+AUTN: 434a46a71aeb0000fedc563f27a0916c
+IK: d7213dd74860ccb8c14e54c0c4abc91c
+CK: c350653d72f7a5bac3a27422e5186019
+RES: 912cdfaadd7b0154
+SRES: 4c57defe
+Kc: 169d78081b24c007
+
+
+> osmo-auc-gen -3 -a milenage -r 2a48162ff3edca4adf0b7b5e527d6c16 -k 6a61050765caa32c90371370e5d6dc2d -o 1dc4f974325cce611e54f516dc1fec56 -s 99
+osmo-auc-gen (C) 2011-2012 by Harald Welte
+This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
+
+RAND: 2a48162ff3edca4adf0b7b5e527d6c16
+AUTN: bfbf3332c91e0000d6199cad31d15f26
+IK: 191a93c4396113bff6939d4f98e169a6
+CK: 9c38d9089265ed5ea164e190a65c200d
+RES: fd40205be2c9c7b2
+SRES: 1f89e7e9
+Kc: d2d5361395b9b74a
+
+
+> osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 2a48162ff3edca4adf0b7b5e527d6c16 -o 1dc4f974325cce611e54f516dc1fec56 -s 281474976710655
+osmo-auc-gen (C) 2011-2012 by Harald Welte
+This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
+
+RAND: 6a61050765caa32c90371370e5d6dc2d
+AUTN: afb993e4f4b8000069cdeebb4a4b5b58
+IK: c348c2fe2f3e1fb37a7ae1638163bd98
+CK: e740c156278705a14e1a99ba6d31334f
+RES: 7c04e86a67967fcd
+SRES: 1b9297a7
+Kc: 10687b71e4eb94c5
+
+
+> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c
+osmo-auc-gen (C) 2011-2012 by Harald Welte
+This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
+
+RAND: 39fa2f4e3d523d8619a73b4f65c3e14d
+AUTN: 8704f5ba55eb0000d7fc4f7f19cfc180
+IK: 27497388b6cb044648f396aa155b95ef
+CK: f64735036e5871319c679f4742a75ea1
+RES: e229c19e791f2e41
+SRES: 9b36efdf
+Kc: 059a4f668f6fbe39
+AUTS success: SQN.MS = 23, generated vector with SQN = 24, next SQN = 25
diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.sh b/tests/osmo-auc-gen/osmo-auc-gen_test.sh
new file mode 100755
index 00000000..7842638a
--- /dev/null
+++ b/tests/osmo-auc-gen/osmo-auc-gen_test.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+osmo_auc_gen="$1"
+
+set -e
+
+# run the osmo-auc-gen binary verbosely without showing its absolute path
+# for identical expected output everywhere.
+invoke() {
+ echo
+ echo
+ echo '>' osmo-auc-gen $@
+ $osmo_auc_gen $@
+}
+
+bytes1="6a61050765caa32c90371370e5d6dc2d"
+bytes2="1dc4f974325cce611e54f516dc1fec56"
+bytes3="2a48162ff3edca4adf0b7b5e527d6c16"
+
+invoke -3 -a milenage -r $bytes1 -k $bytes2 -o $bytes3 -s 0
+invoke -3 -a milenage -r $bytes1 -k $bytes2 -o $bytes3 -s 1
+invoke -3 -a milenage -r $bytes1 -k $bytes2 -o $bytes3 -s 23
+invoke -3 -a milenage -r $bytes2 -k $bytes3 -o $bytes1 -s 42
+invoke -3 -a milenage -r $bytes3 -k $bytes1 -o $bytes2 -s 99
+invoke -3 -a milenage -r $bytes1 -k $bytes3 -o $bytes2 -s 281474976710655
+
+k="EB215756028D60E3275E613320AEC880"
+opc="FB2A3D1B360F599ABAB99DB8669F8308"
+rand="39fa2f4e3d523d8619a73b4f65c3e14d"
+auts="979498b1f72d3e28c59fa2e72f9c"
+invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts