summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-04 16:02:39 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-04 16:06:59 +0200
commit960d28087e18263027f7dbdb5e5bc641053c7e64 (patch)
tree183c036d782a1ca4be49a238c4c57b61558bfe5e
parenta27b295100f30f5477bc5baae4a2872997f86f33 (diff)
IuCS: upon sec mode compl, check that a sec op is pending
Safety check: discard Security Mode Complete messages when there is no security operation pending.
-rw-r--r--openbsc/src/osmo-cscn/iucs_ranap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/src/osmo-cscn/iucs_ranap.c b/openbsc/src/osmo-cscn/iucs_ranap.c
index 4a0f6bb..06a0acb 100644
--- a/openbsc/src/osmo-cscn/iucs_ranap.c
+++ b/openbsc/src/osmo-cscn/iucs_ranap.c
@@ -58,6 +58,14 @@ int iucs_rx_sec_mode_compl(struct gsm_subscriber_connection *conn,
OSMO_ASSERT(conn->via_iface == IFACE_IU);
+ if (!conn->sec_operation) {
+ LOGP(DIUCS, LOGL_ERROR,
+ "Received Security Mode Complete message, but no"
+ " authentication/cipher operation in progress"
+ " for subscr %s\n", subscr_name(conn->subscr));
+ return;
+ }
+
/* TODO evalute ies */
if (conn->iu.integrity_protection)