aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-05-01 11:14:18 +0200
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-05-09 10:48:29 +0200
commitcdf716cf9a2d71d5918729a5e7708bf86873b328 (patch)
treed490b97e8a3a9c336a0fccec776e10d93117da28
parenta9c39c04de5bb6d130f9c62c1f9fdddf8f555d39 (diff)
VTY: move default settings to sgsn_instance_alloc()
It's cleaner to have all configuration defaults in one place. Change-Id: I1a439dcc76272a181986b6ec9368ef16441dc098 Related: OS#6442
-rw-r--r--src/sgsn/sgsn.c5
-rw-r--r--src/sgsn/sgsn_vty.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/sgsn/sgsn.c b/src/sgsn/sgsn.c
index 6619bf263..c3b7fda36 100644
--- a/src/sgsn/sgsn.c
+++ b/src/sgsn/sgsn.c
@@ -36,6 +36,9 @@
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/gsup.h>
+#include <osmocom/crypt/gprs_cipher.h>
+#include <osmocom/crypt/utran_cipher.h>
+
#include <osmocom/sgsn/gprs_subscriber.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/sgsn.h>
@@ -162,6 +165,8 @@ struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx)
inst->cfg.gtp_statedir = talloc_strdup(inst, "./");
inst->cfg.auth_policy = SGSN_AUTH_POLICY_CLOSED;
+ inst->cfg.gea_encryption_mask = (1 << GPRS_ALGO_GEA0); /* no encryption */
+ inst->cfg.uea_encryption_mask = (1 << OSMO_UTRAN_UEA0); /* no encryption */
inst->cfg.require_authentication = true; /* only applies if auth_policy is REMOTE */
inst->cfg.gsup_server_port = OSMO_GSUP_PORT;
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 29f9cd604..6837e7180 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -1868,9 +1868,6 @@ int sgsn_parse_config(const char *config_file)
/* make sure sgsn_vty_init() was called before this */
OSMO_ASSERT(g_cfg);
- g_cfg->gea_encryption_mask = 0x1; /* support GEA0 by default unless specific encryption config exists */
- g_cfg->uea_encryption_mask = (1 << OSMO_UTRAN_UEA0); /* support UEA0 by default unless specific encryption config exists */
-
rc = vty_read_config_file(config_file, NULL);
if (rc < 0) {
fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file);