diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2016-03-18 13:54:32 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2016-03-18 13:58:20 +0100 |
commit | ffd9968d3ac369e2d60f086f1928b0860ba6e6ca (patch) | |
tree | 629bfb32e7e36b67bdd833acb8e6560c7fa449ea /openbsc/src/gprs/gprs_gmm.c | |
parent | deb227b98e4136f873f76ea3362bfb74673f48bc (diff) |
libiu: Change gprs_transp_upd_key to be useful for CS as well
gprs_transp_upd_key only sends a security mode command which is needed for CS
as well so change it.
Make sure it is called after the UE is authenticated in Iu mode.
Diffstat (limited to 'openbsc/src/gprs/gprs_gmm.c')
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index e96dbcdc8..922c65ab1 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -63,8 +63,6 @@ #define PTMSI_ALLOC -int gprs_transp_upd_key(struct sgsn_mm_ctx *mm); - extern struct sgsn_instance *sgsn; static const struct tlv_definition gsm48_gmm_att_tlvdef = { @@ -117,11 +115,14 @@ int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, int type, void *data) rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; case IU_EVENT_IU_RELEASE: + mm->iu.integrity_active = 0; /* Clean up ue_conn_ctx here */ LOGMMCTXP(LOGL_INFO, mm, "IU release\n", type); break; case IU_EVENT_SECURITY_MODE_COMPLETE: /* Continue authentication here */ + mm->iu.integrity_active = 1; + rc = gsm48_gmm_authorize(mm); break; default: LOGP(DRANAP, LOGL_NOTICE, "Unknown event received: %i\n", type); @@ -572,8 +573,6 @@ static int gsm48_rx_gmm_auth_ciph_resp(struct sgsn_mm_ctx *ctx, /* Check if we can let the mobile station enter */ rc = gsm48_gmm_authorize(ctx); - gprs_transp_upd_key(ctx); - return rc; } @@ -753,6 +752,9 @@ static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx) } /* The MS is authorized */ + if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.integrity_active) { + return iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet); + } switch (ctx->pending_req) { case 0: |