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
This commit is contained in:
Max 2017-05-02 13:03:28 +02:00
parent 7bb383a45c
commit 086067f0a1
1 changed files with 11 additions and 10 deletions

View File

@ -619,18 +619,19 @@ DEFUN(cfg_encrypt, cfg_encrypt_cmd,
"Use GEA0 (no encryption)\n" "Use GEA0 (no encryption)\n"
"Use GEA1\nUse GEA2\nUse GEA3\nUse GEA4\n") "Use GEA1\nUse GEA2\nUse GEA3\nUse GEA4\n")
{ {
if (!g_cfg->require_authentication) { enum gprs_ciph_algo c = get_string_value(gprs_cipher_names, argv[0]);
vty_out(vty, "%% unable to use encryption without " if (c != GPRS_ALGO_GEA0) {
"authentication: adjust auth-policy%s", VTY_NEWLINE); if (!gprs_cipher_supported(c)) {
vty_out(vty, "%% cipher %s is unsupported in current version%s", argv[0], VTY_NEWLINE);
return CMD_WARNING; return CMD_WARNING;
} }
enum gprs_ciph_algo c = get_string_value(gprs_cipher_names, argv[0]); if (!g_cfg->require_authentication) {
if (!gprs_cipher_supported(c)) { vty_out(vty, "%% unable to use encryption %s without authentication: please adjust auth-policy%s",
vty_out(vty, "%% cipher %s is unsupported in current version%s",
argv[0], VTY_NEWLINE); argv[0], VTY_NEWLINE);
return CMD_WARNING; return CMD_WARNING;
} }
}
g_cfg->cipher = c; g_cfg->cipher = c;