aboutsummaryrefslogtreecommitdiffstats
path: root/src/auc.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-16 05:20:50 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-16 05:46:40 +0100
commitee392bb3b1fdfd45e8b4401622e0ee6cc66f9695 (patch)
treec84ef198b416c7979338ccd467c4ffe7550cd11d /src/auc.c
parentea1052d300ac683d24c9775df7bf338a3c4fa103 (diff)
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
Diffstat (limited to 'src/auc.c')
-rw-r--r--src/auc.c9
1 files changed, 2 insertions, 7 deletions
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);