diff options
author | Harald Welte <laforge@gnumonks.org> | 2016-04-20 13:13:19 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-04-29 13:10:37 +0200 |
commit | 121e9a4164e65dfb68b2bf09297a8537a2f659c5 (patch) | |
tree | 19d0f18c0f0a093c30d1ba01af8532657d510657 /openbsc/src/gprs/gprs_subscriber.c | |
parent | 3ffce19cb4929c907460753d302e4720558cc6d2 (diff) |
Start to use struct osmo_auth_vector from gsm_auth_tuple
Rather than having a 'private' structure for kc, sres and rand, we
now finally (with 4 years delay) use osmo_auth_vector from libosmogsm,
which encapsulates authentication vectors that can be either GSM
triplets or UMTS quintuples or a combination of both.
gsm_auth_tuple becomes a wrapper around osmo_auth_vector, adding
use_count and key_seq to it.
key_seq is no longer initialized inside gprs_gsup_messages.c, as there
is no CKSN / key_seq inside the message anyway. If a usre of the code
needs key_seq, they need to manage it themselves.
Diffstat (limited to 'openbsc/src/gprs/gprs_subscriber.c')
-rw-r--r-- | openbsc/src/gprs/gprs_subscriber.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c index 3467293be..678c1de6a 100644 --- a/openbsc/src/gprs/gprs_subscriber.c +++ b/openbsc/src/gprs/gprs_subscriber.c @@ -199,18 +199,18 @@ static int gprs_subscr_handle_gsup_auth_res(struct gsm_subscriber *subscr, struct sgsn_subscriber_data *sdata = subscr->sgsn_data; LOGGSUBSCRP(LOGL_INFO, subscr, - "Got SendAuthenticationInfoResult, num_auth_tuples = %zu\n", - gsup_msg->num_auth_tuples); + "Got SendAuthenticationInfoResult, num_auth_vectors = %zu\n", + gsup_msg->num_auth_vectors); - if (gsup_msg->num_auth_tuples > 0) { + if (gsup_msg->num_auth_vectors > 0) { memset(sdata->auth_triplets, 0, sizeof(sdata->auth_triplets)); for (idx = 0; idx < ARRAY_SIZE(sdata->auth_triplets); idx++) sdata->auth_triplets[idx].key_seq = GSM_KEY_SEQ_INVAL; } - for (idx = 0; idx < gsup_msg->num_auth_tuples; idx++) { - size_t key_seq = gsup_msg->auth_tuples[idx].key_seq; + for (idx = 0; idx < gsup_msg->num_auth_vectors; idx++) { + size_t key_seq = idx; LOGGSUBSCRP(LOGL_DEBUG, subscr, "Adding auth tuple, cksn = %zu\n", key_seq); if (key_seq >= ARRAY_SIZE(sdata->auth_triplets)) { @@ -219,7 +219,8 @@ static int gprs_subscr_handle_gsup_auth_res(struct gsm_subscriber *subscr, key_seq); continue; } - sdata->auth_triplets[key_seq] = gsup_msg->auth_tuples[idx]; + sdata->auth_triplets[key_seq].vec = gsup_msg->auth_vectors[idx]; + sdata->auth_triplets[key_seq].key_seq = key_seq; } sdata->auth_triplets_updated = 1; |