gsm_04_08: Establish secure channel on LOCATION UPDATE
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
2030a2a228
commit
267fba0a2b
|
@ -203,30 +203,53 @@ static void allocate_loc_updating_req(struct gsm_subscriber_connection *conn)
|
||||||
struct gsm_loc_updating_operation);
|
struct gsm_loc_updating_operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gsm0408_authorize(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
static int _gsm0408_authorize_sec_cb(unsigned int hooknum, unsigned int event,
|
||||||
|
struct msgb *msg, void *data, void *param)
|
||||||
{
|
{
|
||||||
if (authorize_subscriber(conn->loc_operation, conn->subscr)) {
|
struct gsm_lchan *lchan = data;
|
||||||
int rc;
|
struct gsm_subscriber_connection *conn = &lchan->conn;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
switch (event) {
|
||||||
|
case GSM_SECURITY_AUTH_FAILED:
|
||||||
|
release_loc_updating_req(conn);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GSM_SECURITY_NOAVAIL:
|
||||||
|
case GSM_SECURITY_SUCCEEDED:
|
||||||
|
/* We're all good */
|
||||||
db_subscriber_alloc_tmsi(conn->subscr);
|
db_subscriber_alloc_tmsi(conn->subscr);
|
||||||
release_loc_updating_req(conn);
|
release_loc_updating_req(conn);
|
||||||
rc = gsm0408_loc_upd_acc(msg->lchan, conn->subscr->tmsi);
|
rc = gsm0408_loc_upd_acc(lchan, conn->subscr->tmsi);
|
||||||
if (msg->lchan->ts->trx->bts->network->send_mm_info) {
|
if (lchan->ts->trx->bts->network->send_mm_info) {
|
||||||
/* send MM INFO with network name */
|
/* send MM INFO with network name */
|
||||||
rc = gsm48_tx_mm_info(msg->lchan);
|
rc = gsm48_tx_mm_info(lchan);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* call subscr_update after putting the loc_upd_acc
|
/* call subscr_update after putting the loc_upd_acc
|
||||||
* in the transmit queue, since S_SUBSCR_ATTACHED might
|
* in the transmit queue, since S_SUBSCR_ATTACHED might
|
||||||
* trigger further action like SMS delivery */
|
* trigger further action like SMS delivery */
|
||||||
subscr_update(conn->subscr, msg->trx->bts,
|
subscr_update(conn->subscr, lchan->ts->trx->bts,
|
||||||
GSM_SUBSCRIBER_UPDATE_ATTACHED);
|
GSM_SUBSCRIBER_UPDATE_ATTACHED);
|
||||||
|
|
||||||
/* try to close channel ASAP */
|
/* try to close channel ASAP */
|
||||||
lchan_auto_release(conn->lchan);
|
lchan_auto_release(lchan);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
rc = -EINVAL;
|
||||||
|
};
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int gsm0408_authorize(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
||||||
|
{
|
||||||
|
if (authorize_subscriber(conn->loc_operation, conn->subscr))
|
||||||
|
return gsm48_secure_channel(conn->lchan,
|
||||||
|
conn->loc_operation->key_seq,
|
||||||
|
_gsm0408_authorize_sec_cb, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue