path: root/src/gprs/gprs_sgsn.c
diff options
authorPau Espin Pedrol <pespin@sysmocom.de>2019-06-13 19:03:25 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-06-13 19:23:36 +0200
commitd1463bc36574627c6315ab2f7346f897387b1345 (patch)
tree734f7ea3a3345e2ed4649d0c3e40ac0615297f11 /src/gprs/gprs_sgsn.c
parent794f446a284ed1ac6d31eb79a8f4c874d66fc34e (diff)
sgsn: Have authentication required on by default
Previous commit introduced command "authentication (optional|required)", which is only meaningful if auth-policy is remote. Upon adding the cmd, it changed the default logic for remote policy to not require authentication, which broke TTCN3 tests because sgsn no longer tries to authenticate the users. Since it's actually good to enable authentication by default where possible, let's enable it by default when on auth-policy remote. In order to do so, let's simply not care about the value of variable require_authentication if auth_policy is not REMOTE. As a result, we drop parts of the previous patch and remove unneeded checks (which are only partially useful based on order of commands during VTY read). Fixes: 794f446a284ed1ac6d31eb79a8f4c874d66fc34e Change-Id: Ic707a95af178b44f08809df3d3bc8354bf34273c
Diffstat (limited to 'src/gprs/gprs_sgsn.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index f725811d..58011078 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -987,6 +987,7 @@ struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx)
inst = talloc_zero(talloc_ctx, struct sgsn_instance);
inst->cfg.gtp_statedir = talloc_strdup(inst, "./");
inst->cfg.auth_policy = SGSN_AUTH_POLICY_CLOSED;
+ inst->cfg.require_authentication = true; /* only applies if auth_policy is REMOTE */
inst->cfg.gsup_server_port = OSMO_GSUP_PORT;
return inst;