summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-08-26 22:29:51 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-29 12:46:46 +0000
commite6e6446edf24c19c94d0774f81dc78ea0bc52f79 (patch)
tree3bd40d8e334446423f0857ffea28fbcf19da4711 /utils
parentb1af6ef1646c54f429f7b87778d92d139c0e3336 (diff)
osmo-auc-gen: umts: print out the IND of the SQN used
Make ind_mask available in the main(){} scope, in order to print out IND = SQN & ind_mask. Adjust test suite expectations. Related: OS#2465 Change-Id: I91eac53c4af66a58b9372d9baf5781fc9f29b1fc
Diffstat (limited to 'utils')
-rw-r--r--utils/osmo-auc-gen.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c
index 6e38b520..d4ae1b9e 100644
--- a/utils/osmo-auc-gen.c
+++ b/utils/osmo-auc-gen.c
@@ -105,6 +105,8 @@ int main(int argc, char **argv)
int sqn_is_set = 0;
int ind_is_set = 0;
int fmt_triplets_dat = 0;
+ uint64_t seq_1;
+ uint64_t ind_mask;
printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n");
printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n");
@@ -268,8 +270,8 @@ int main(int argc, char **argv)
memset(vec, 0, sizeof(*vec));
if (test_aud.type == OSMO_AUTH_TYPE_UMTS) {
- uint64_t seq_1 = 1LL << test_aud.u.umts.ind_bitlen;
- uint64_t ind_mask = seq_1 - 1;
+ seq_1 = 1LL << test_aud.u.umts.ind_bitlen;
+ ind_mask = seq_1 - 1;
if (sqn_is_set) {
/* Before calculating the UMTS auth vector, osmo_auth_gen_vec() increments SEQ.
@@ -312,8 +314,10 @@ int main(int argc, char **argv)
dump_triplets_dat(vec);
else {
dump_auth_vec(vec);
- if (test_aud.type == OSMO_AUTH_TYPE_UMTS)
+ if (test_aud.type == OSMO_AUTH_TYPE_UMTS) {
printf("SQN:\t%" PRIu64 "\n", test_aud.u.umts.sqn);
+ printf("IND:\t%u\n", (unsigned int)(test_aud.u.umts.sqn & ind_mask));
+ }
}
exit(0);