laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39018?usp=email )

Change subject: SGSN: f_routing_area_update: add authentication argument
......................................................................

SGSN: f_routing_area_update: add authentication argument

The RAU should always contain an authentication when the MS/UE
is not authenticated or the traffic not encrypted.

Change-Id: I7125ed8aa81fbda48a19f7f4fc711bc1bf2c875f
---
M sgsn/BSSGP_ConnHdlr.ttcn
1 file changed, 19 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn
index 696aa83..6879b0a 100644
--- a/sgsn/BSSGP_ConnHdlr.ttcn
+++ b/sgsn/BSSGP_ConnHdlr.ttcn
@@ -112,6 +112,12 @@
        GlobalRNC_ID grnc_id optional
 };

+type enumerated SGSN_auth_mode {
+       SGSN_AUTH_MODE_DISABLED,
+       SGSN_AUTH_MODE_PERMITTED,
+       SGSN_AUTH_MODE_REQUIRED
+};
+
 function f_new_BSSGP_ConnHdlrPars(integer imsi_suffix,
                                  template (value) BssgpCellIds cell_ids,
                                  template (value) SGSN_ConnHdlrNetworkPars 
net_pars := t_NetPars(),
@@ -688,8 +694,10 @@
 function f_routing_area_update(RoutingAreaIdentificationV old_ra,
                               GprsUpdateType upd_type := GPRS_UPD_T_RA,
                               integer ran_index := 0,
-                              float Tval := 2.0) runs on BSSGP_ConnHdlr {
+                              float Tval := 2.0,
+                              SGSN_auth_mode auth_mode := 
SGSN_AUTH_MODE_REQUIRED) runs on BSSGP_ConnHdlr {
        var template (omit) OCT4 p_tmsi := omit;
+       var boolean authed := false;
        timer T := Tval;

        if (is_iu(ran_index)) {
@@ -700,6 +708,11 @@

        T.start;
        alt {
+       [auth_mode != SGSN_AUTH_MODE_DISABLED] as_gmm_auth(
+                       umts_aka_challenge := true, ran_index := ran_index, 
expect_sai := true)  {
+               authed := true;
+               repeat;
+               }
        [] as_routing_area_update(ran_index) { setverdict(pass); }
        [is_gb(ran_index)] BSSGP[ran_index].receive { repeat; }
        [is_iu(ran_index)] RAN_CONN.receive { repeat; }
@@ -708,6 +721,11 @@
                mtc.stop;
                }
        }
+
+       if (auth_mode == SGSN_AUTH_MODE_REQUIRED and not authed) {
+               setverdict(fail, "RAU succeeded but without required 
authentication");
+               mtc.stop;
+       }
 }

 /* Iu only

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39018?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7125ed8aa81fbda48a19f7f4fc711bc1bf2c875f
Gerrit-Change-Number: 39018
Gerrit-PatchSet: 12
Gerrit-Owner: lynxis lazus <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-CC: fixeria <[email protected]>

Reply via email to