AUC: Add support for setting the AMF separation bit to '1' for EUTRAN
Change-Id: Ic766bc40f6126bb479bd0a05b0e96bec3e240008
This commit is contained in:
parent
94c38a9e03
commit
a5e9ca9045
2
src/db.h
2
src/db.h
|
@ -69,7 +69,7 @@ int db_update_sqn(struct db_context *dbc, int64_t id,
|
|||
int db_get_auc(struct db_context *dbc, const char *imsi,
|
||||
unsigned int auc_3g_ind, struct osmo_auth_vector *vec,
|
||||
unsigned int num_vec, const uint8_t *rand_auts,
|
||||
const uint8_t *auts);
|
||||
const uint8_t *auts, bool separation_bit);
|
||||
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <osmocom/gsm/protocol/gsm_23_003.h>
|
||||
|
|
|
@ -189,7 +189,7 @@ out:
|
|||
int db_get_auc(struct db_context *dbc, const char *imsi,
|
||||
unsigned int auc_3g_ind, struct osmo_auth_vector *vec,
|
||||
unsigned int num_vec, const uint8_t *rand_auts,
|
||||
const uint8_t *auts)
|
||||
const uint8_t *auts, bool separation_bit)
|
||||
{
|
||||
struct osmo_sub_auth_data aud2g, aud3g;
|
||||
int64_t subscr_id;
|
||||
|
@ -209,6 +209,12 @@ int db_get_auc(struct db_context *dbc, const char *imsi,
|
|||
aud3g.u.umts.ind_bitlen, aud3g.u.umts.ind);
|
||||
aud3g.u.umts.ind &= (1U << aud3g.u.umts.ind_bitlen) - 1;
|
||||
}
|
||||
/* the first bit (bit0) cannot be used as AMF anymore, but has been
|
||||
* re-appropriated as the separation bit. See 3GPP TS 33.102 Annex H
|
||||
* together with 3GPP TS 33.401 / 33.402 / 33.501 */
|
||||
aud3g.u.umts.amf[0] = aud3g.u.umts.amf[0] & 0x7f;
|
||||
if (separation_bit)
|
||||
aud3g.u.umts.amf[0] |= 0x80;
|
||||
|
||||
LOGAUC(imsi, LOGL_DEBUG, "Calling to generate %u vectors\n", num_vec);
|
||||
rc = auc_compute_vectors(vec, num_vec, &aud2g, &aud3g, rand_auts, auts);
|
||||
|
|
|
@ -233,6 +233,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 rc;
|
||||
|
||||
subscr_create_on_demand(gsup->imsi);
|
||||
|
@ -241,10 +242,13 @@ static int rx_send_auth_info(struct osmo_gsup_conn *conn,
|
|||
memset(&gsup_out, 0, sizeof(gsup_out));
|
||||
memcpy(&gsup_out.imsi, &gsup->imsi, sizeof(gsup_out.imsi));
|
||||
|
||||
if (gsup->rat_types_len >= 1 && gsup->rat_types[0] == OSMO_RAT_EUTRAN_SGS)
|
||||
separation_bit = true;
|
||||
|
||||
rc = db_get_auc(dbc, gsup->imsi, conn->auc_3g_ind,
|
||||
gsup_out.auth_vectors,
|
||||
ARRAY_SIZE(gsup_out.auth_vectors),
|
||||
gsup->rand, gsup->auts);
|
||||
gsup->rand, gsup->auts, separation_bit);
|
||||
if (rc <= 0) {
|
||||
gsup_out.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR;
|
||||
switch (rc) {
|
||||
|
|
|
@ -628,7 +628,7 @@ DEFUN(subscriber_rat,
|
|||
const char *id = argv[1];
|
||||
const char *rat_str = argv[2];
|
||||
const char *allowed_forbidden = argv[3];
|
||||
enum osmo_rat_type rat;
|
||||
enum osmo_rat_type rat = OSMO_RAT_UNKNOWN;
|
||||
bool allowed;
|
||||
int rc;
|
||||
|
||||
|
@ -636,6 +636,8 @@ DEFUN(subscriber_rat,
|
|||
rat = OSMO_RAT_GERAN_A;
|
||||
else if (strcmp(rat_str, "utran-iu") == 0)
|
||||
rat = OSMO_RAT_UTRAN_IU;
|
||||
else if (strcmp(rat_str, "eutran") == 0)
|
||||
rat = OSMO_RAT_EUTRAN_SGS;
|
||||
|
||||
allowed = (strcmp(allowed_forbidden, "allowed") == 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue