aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/sgsn
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-29 22:12:20 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-11-14 09:27:23 +0100
commit0c06f98ced2b70801147eb52d6596079e473dfc9 (patch)
tree11808bb72a07e2413c07a5ec381794400019fa5d /openbsc/tests/sgsn
parentb1c074f62c1d04138b751f71e3b07fbb0a521898 (diff)
sgsn: Move IMSI authorization to gsm48_gmm_authorize
Currently the IMSI is only checked immediately when an Attach Request is received that contains an IMSI IE. If it contains a P-TMSI instead, access is always granted. This commit moves the IMSI check to gsm48_gmm_authorize where it is applied when IMSI and IMEI have been acquired. This fixes the authorization when the Attach Accept doesn't contain an IMSI. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/sgsn')
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 49ee2df20..218092f2c 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -340,6 +340,8 @@ static void test_gmm_attach(void)
/* reset the PRNG used by sgsn_alloc_ptmsi */
srand(1);
+ sgsn_acl_add("123456789012345", &sgsn->cfg);
+
foreign_tlli = gprs_tmsi2tlli(0xc0000023, TLLI_FOREIGN);
/* Create a LLE/LLME */
@@ -369,9 +371,6 @@ static void test_gmm_attach(void)
send_0408_message(ctx->llme, foreign_tlli,
ident_resp_imsi, ARRAY_SIZE(ident_resp_imsi));
- /* FIXME: We are not authorized and should get an Attach Reject, fix
- * authorization in gprs_gmm.c */
-
/* check that the MM context has not been removed due to a failed
* authorization */
OSMO_ASSERT(ctx == sgsn_mm_ctx_by_tlli(foreign_tlli, &raid));
@@ -401,6 +400,8 @@ static void test_gmm_attach(void)
OSMO_ASSERT(count(gprs_llme_list()) == 0);
ictx = sgsn_mm_ctx_by_tlli(local_tlli, &raid);
OSMO_ASSERT(!ictx);
+
+ sgsn_acl_del("123456789012345", &sgsn->cfg);
}
static struct log_info_cat gprs_categories[] = {