[MERGED] openbsc[master]: Fix vty warnings for GEA0

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu May 4 13:34:09 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: Fix vty warnings for GEA0
......................................................................


Fix vty warnings for GEA0

Previously vty always used additional checks even for GEA0 (no
encryption) which resulted in misleading warnings. Fix this by
adding explicit check for GEA0.

Related: SYS#3610
Change-Id: I1ee468ab3298076d4cb5c7b1f6293c07e272417b
---
M openbsc/src/gprs/sgsn_vty.c
1 file changed, 11 insertions(+), 10 deletions(-)

Approvals:
  daniel: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c
index d42a165..e09a029 100644
--- a/openbsc/src/gprs/sgsn_vty.c
+++ b/openbsc/src/gprs/sgsn_vty.c
@@ -619,17 +619,18 @@
       "Use GEA0 (no encryption)\n"
       "Use GEA1\nUse GEA2\nUse GEA3\nUse GEA4\n")
 {
-	if (!g_cfg->require_authentication) {
-		vty_out(vty, "%% unable to use encryption without "
-			"authentication: adjust auth-policy%s", VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
 	enum gprs_ciph_algo c = get_string_value(gprs_cipher_names, argv[0]);
-	if (!gprs_cipher_supported(c)) {
-		vty_out(vty, "%% cipher %s is unsupported in current version%s",
-			argv[0], VTY_NEWLINE);
-		return CMD_WARNING;
+	if (c != GPRS_ALGO_GEA0) {
+		if (!gprs_cipher_supported(c)) {
+			vty_out(vty, "%% cipher %s is unsupported in current version%s", argv[0], VTY_NEWLINE);
+			return CMD_WARNING;
+		}
+
+		if (!g_cfg->require_authentication) {
+			vty_out(vty, "%% unable to use encryption %s without authentication: please adjust auth-policy%s",
+				argv[0], VTY_NEWLINE);
+			return CMD_WARNING;
+		}
 	}
 
 	g_cfg->cipher = c;

-- 
To view, visit https://gerrit.osmocom.org/2459
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ee468ab3298076d4cb5c7b1f6293c07e272417b
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>



More information about the gerrit-log mailing list