From ee392bb3b1fdfd45e8b4401622e0ee6cc66f9695 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 16 Mar 2017 05:20:50 +0100 Subject: fix debug log: adjust to new SQN increment scheme We can no longer accurately print the SQN from AUTS resync, since the SQN is incremented after AUTS. Instead, always print the SQN from the generated tuple, i.e. exactly the one left in auth data *after* the tuple was generated. This change was forgotten in recent adjustments to the new SQN incrementing scheme from libosmocore, in change-id I4ec5a578537acb1d9e1ebfe00a72417fc3ca5894 for libosmocore change-id Iadf43f21e0605e9e85f7e8026c40985f7ceff1a3. It should have been obvious that something was missing in the previous patch from the auc_test output: the SQN in the output changed while the AUTN remained the same. That slipped by without being noticed :/ Change-Id: I0e1e828da931a3d22c75306c55bdb7f44df6512f --- src/auc.c | 9 ++------- src/db_auc.c | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/auc.c b/src/auc.c index 9c20db2..d3b3d36 100644 --- a/src/auc.c +++ b/src/auc.c @@ -123,14 +123,7 @@ int auc_compute_vectors(struct osmo_auth_vector *vec, unsigned int num_vec, rc = osmo_auth_gen_vec_auts(vec+i, aud3g, auts, rand_auts, rand); - /* The sqn used for the key is sqn - 1 because - * vector generation has already inc'd it. The - * USIM's sqn sent in AUTS is sqn - 2. */ - DBGP("vector [%u]: resync: sqn = %"PRIu64 "\n", - i, aud3g->u.umts.sqn - 1); } else { - DBGP("vector [%u]: sqn = %" PRIu64 "\n", - i, aud3g->u.umts.sqn); rc = osmo_auth_gen_vec(vec+i, aud3g, rand); } if (rc < 0) { @@ -138,6 +131,8 @@ int auc_compute_vectors(struct osmo_auth_vector *vec, unsigned int num_vec, "generation: [%u]: rc = %d\n", i, rc); goto out; } + DBGP("vector [%u]: sqn = %" PRIu64 "\n", + i, aud3g->u.umts.sqn); DBGVB(autn); DBGVB(ck); diff --git a/src/db_auc.c b/src/db_auc.c index a24f27e..ac81404 100644 --- a/src/db_auc.c +++ b/src/db_auc.c @@ -18,6 +18,7 @@ */ #include +#include #include #include -- cgit v1.2.3