aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-01-07 19:05:13 +0100
committerAlexander Couzens <lynxis@fe80.eu>2020-01-10 07:51:07 +0100
commit81b92bbe69fdc548680af651a44071d948a50292 (patch)
tree1ee6aec9acb703ac18233de979e4971548edd209
parent3a66698d87b29e0bf8eb53ca29db7e0f02871abc (diff)
hlr: respect the num_auth_vectors requested
Previous the hlr always returned the maximum possible auth vectors (5) to the client. Even when only asked for a single auth vector. Change-Id: I20c2b648456bc7ba1fc1321a7d42852158a3523c
-rw-r--r--src/hlr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hlr.c b/src/hlr.c
index c3737d5..38b9022 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -234,6 +234,7 @@ static int rx_send_auth_info(struct osmo_gsup_conn *conn,
struct osmo_gsup_message gsup_out;
struct msgb *msg_out;
bool separation_bit = false;
+ int num_auth_vectors = OSMO_GSUP_MAX_NUM_AUTH_INFO;
int rc;
subscr_create_on_demand(gsup->imsi);
@@ -245,9 +246,13 @@ static int rx_send_auth_info(struct osmo_gsup_conn *conn,
if (gsup->current_rat_type == OSMO_RAT_EUTRAN_SGS)
separation_bit = true;
+ if (gsup->num_auth_vectors > 0 &&
+ gsup->num_auth_vectors <= OSMO_GSUP_MAX_NUM_AUTH_INFO)
+ num_auth_vectors = gsup->num_auth_vectors;
+
rc = db_get_auc(dbc, gsup->imsi, conn->auc_3g_ind,
gsup_out.auth_vectors,
- ARRAY_SIZE(gsup_out.auth_vectors),
+ num_auth_vectors,
gsup->rand, gsup->auts, separation_bit);
if (rc <= 0) {
gsup_out.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR;