diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-12-08 15:26:47 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-10 12:45:22 +0100 |
commit | 2e5e94c3283fa4f5160962f42e7cd5d4e39b7d1e (patch) | |
tree | bd2e4951b0e688162b08147f96c0bc6090e6078c /openbsc/src/gprs/sgsn_auth.c | |
parent | 4adb136da63a1d3ed523ad85e12fd99fc62f5701 (diff) |
sgsn: Support subscriber based authentication
This commit mainly extends sgsn_auth.c to use and support the
auth_state SGSN_AUTH_AUTHENTICATE. It will be activated when IMSI and
IMEI are available, authentication is required
(subscr->sgsn_data->authenticate is set), but the MM context is not
marked as authenticated. If the state has been set to
SGSN_AUTH_AUTHENTICATE and sgsn_auth_update() is called, the GMM
layer will be informed by invoking gsm0408_gprs_authenticate().
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/sgsn_auth.c')
-rw-r--r-- | openbsc/src/gprs/sgsn_auth.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/gprs/sgsn_auth.c b/openbsc/src/gprs/sgsn_auth.c index 1f11948f1..1219176d6 100644 --- a/openbsc/src/gprs/sgsn_auth.c +++ b/openbsc/src/gprs/sgsn_auth.c @@ -110,6 +110,10 @@ enum sgsn_auth_state sgsn_auth_state(struct sgsn_mm_ctx *mmctx) if (mmctx->subscr->flags & GPRS_SUBSCRIBER_UPDATE_PENDING) return mmctx->auth_state; + if (mmctx->subscr->sgsn_data->authenticate && + !mmctx->is_authenticated) + return SGSN_AUTH_AUTHENTICATE; + if (mmctx->subscr->authorized) return SGSN_AUTH_ACCEPTED; @@ -180,6 +184,9 @@ void sgsn_auth_update(struct sgsn_mm_ctx *mmctx) mmctx->auth_state = auth_state; switch (auth_state) { + case SGSN_AUTH_AUTHENTICATE: + gsm0408_gprs_authenticate(mmctx); + break; case SGSN_AUTH_ACCEPTED: gsm0408_gprs_access_granted(mmctx); break; |