summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-04 00:06:09 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-09 18:34:17 +0100
commitafed23965fc8e266ff7b5014a51ae229e3f2f18c (patch)
tree8051e77c10d8eea714820fab96eb6c9949b5a6f3
parent3dbdf8178311a838f9a8d8eec36a674bd92db30c (diff)
ensure authentication is required on UTRAN
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c13
-rw-r--r--openbsc/src/libvlr/vlr_access_req_fsm.c4
-rw-r--r--openbsc/src/libvlr/vlr_lu_fsm.c4
3 files changed, 16 insertions, 5 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 1ddbf2a..0e44ba6 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -339,11 +339,11 @@ int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
uint8_t mi_type;
char mi_string[GSM48_MI_SIZE];
enum vlr_lu_type vlr_lu_type = VLR_LU_TYPE_REGULAR;
-
uint32_t tmsi;
char *imsi;
struct osmo_location_area_id old_lai, new_lai;
struct osmo_fsm_inst *lu_fsm;
+ bool is_utran;
int rc;
lu = (struct gsm48_loc_upd_req *) gh->data;
@@ -409,16 +409,17 @@ int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
new_lai.lac = conn->lac;
DEBUGP(DMM, "LU/new-LAC: %u/%u\n", old_lai.lac, new_lai.lac);
+ is_utran = (conn->via_ran == RAN_UTRAN_IU);
lu_fsm = vlr_loc_update(conn->conn_fsm,
SUBSCR_CONN_E_ACCEPTED,
SUBSCR_CONN_E_CN_CLOSE,
(void*)&conn_from_lu,
net->vlr, conn, vlr_lu_type, tmsi, imsi,
&old_lai, &new_lai,
- conn->network->authentication_required,
+ is_utran || conn->network->authentication_required,
conn->network->a5_encryption,
classmark_is_r99(&conn->classmark),
- conn->via_ran == RAN_UTRAN_IU);
+ is_utran);
if (!lu_fsm) {
DEBUGP(DRR, "%s: Can't start LU FSM\n", mi_string);
return 0;
@@ -668,6 +669,7 @@ int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *ms
uint8_t mi_len = *(classmark2 + classmark2_len);
uint8_t *mi = (classmark2 + classmark2_len + 1);
struct osmo_location_area_id lai;
+ bool is_utran;
int rc;
lai.plmn.mcc = conn->network->country_code;
@@ -721,16 +723,17 @@ int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *ms
send_siemens_mrpci(msg->lchan, classmark2-1);
#endif
+ is_utran = (conn->via_ran == RAN_UTRAN_IU);
vlr_proc_acc_req(conn->conn_fsm,
SUBSCR_CONN_E_ACCEPTED,
SUBSCR_CONN_E_CN_CLOSE,
(void*)&conn_from_cm_service_req,
net->vlr, conn,
VLR_PR_ARQ_T_CM_SERV_REQ, mi-1, &lai,
- conn->network->authentication_required,
+ is_utran || conn->network->authentication_required,
conn->network->a5_encryption,
classmark_is_r99(&conn->classmark),
- conn->via_ran == RAN_UTRAN_IU);
+ is_utran);
return 0;
}
diff --git a/openbsc/src/libvlr/vlr_access_req_fsm.c b/openbsc/src/libvlr/vlr_access_req_fsm.c
index 5c0822e..67c61b7 100644
--- a/openbsc/src/libvlr/vlr_access_req_fsm.c
+++ b/openbsc/src/libvlr/vlr_access_req_fsm.c
@@ -683,6 +683,10 @@ vlr_proc_acc_req(struct osmo_fsm_inst *parent,
(ciphering_required? "+Ciph" : " (no Ciph)")
: "");
+ if (is_utran && !authentication_required)
+ LOGPFSML(fi, LOGL_ERROR,
+ "Authentication off on UTRAN network. Good luck.\n");
+
gsm48_mi_to_string(mi_string, sizeof(mi_string), mi_lv+1, mi_lv[0]);
mi_type = mi_lv[1] & GSM_MI_TYPE_MASK;
switch (mi_type) {
diff --git a/openbsc/src/libvlr/vlr_lu_fsm.c b/openbsc/src/libvlr/vlr_lu_fsm.c
index c7fa8dc..e9fed2d 100644
--- a/openbsc/src/libvlr/vlr_lu_fsm.c
+++ b/openbsc/src/libvlr/vlr_lu_fsm.c
@@ -1401,6 +1401,10 @@ vlr_loc_update(struct osmo_fsm_inst *parent,
(ciphering_required? "+Ciph" : " (no Ciph)")
: "");
+ if (is_utran && !authentication_required)
+ LOGPFSML(fi, LOGL_ERROR,
+ "Authentication off on UTRAN network. Good luck.\n");
+
osmo_fsm_inst_dispatch(fi, VLR_ULA_E_UPDATE_LA, NULL);
return fi;