summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
authornaddy@openbsd.org <naddy@openbsd.org>2019-09-06 14:45:34 +0000
committerDamien Miller <djm@mindrot.org>2019-09-08 14:49:04 +1000
commit91a2135f32acdd6378476c5bae475a6e7811a6a2 (patch)
treeda8ddb5e4236cb12f3c70ab939e3abe674aa8ba4 /servconf.c
parentc8bdd2db77ac2369d5cdee237656f266c8f41552 (diff)
upstream: Allow prepending a list of algorithms to the default set
by starting the list with the '^' character, e.g. HostKeyAlgorithms ^ssh-ed25519 Ciphers ^aes128-gcm@openssh.com,aes256-gcm@openssh.com ok djm@ dtucker@ OpenBSD-Commit-ID: 1e1996fac0dc8a4b0d0ff58395135848287f6f97
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/servconf.c b/servconf.c
index 340045b28..e76f9c39e 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.351 2019/04/18 18:56:16 dtucker Exp $ */ 2/* $OpenBSD: servconf.c,v 1.352 2019/09/06 14:45:34 naddy Exp $ */
3/* 3/*
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved 5 * All rights reserved
@@ -1444,7 +1444,8 @@ process_server_config_line(ServerOptions *options, char *line,
1444 fatal("%s line %d: Missing argument.", 1444 fatal("%s line %d: Missing argument.",
1445 filename, linenum); 1445 filename, linenum);
1446 if (*arg != '-' && 1446 if (*arg != '-' &&
1447 !sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1)) 1447 !sshkey_names_valid2(*arg == '+' || *arg == '^' ?
1448 arg + 1 : arg, 1))
1448 fatal("%s line %d: Bad key types '%s'.", 1449 fatal("%s line %d: Bad key types '%s'.",
1449 filename, linenum, arg ? arg : "<NONE>"); 1450 filename, linenum, arg ? arg : "<NONE>");
1450 if (*activep && *charptr == NULL) 1451 if (*activep && *charptr == NULL)
@@ -1715,7 +1716,8 @@ process_server_config_line(ServerOptions *options, char *line,
1715 arg = strdelim(&cp); 1716 arg = strdelim(&cp);
1716 if (!arg || *arg == '\0') 1717 if (!arg || *arg == '\0')
1717 fatal("%s line %d: Missing argument.", filename, linenum); 1718 fatal("%s line %d: Missing argument.", filename, linenum);
1718 if (*arg != '-' && !ciphers_valid(*arg == '+' ? arg + 1 : arg)) 1719 if (*arg != '-' &&
1720 !ciphers_valid(*arg == '+' || *arg == '^' ? arg + 1 : arg))
1719 fatal("%s line %d: Bad SSH2 cipher spec '%s'.", 1721 fatal("%s line %d: Bad SSH2 cipher spec '%s'.",
1720 filename, linenum, arg ? arg : "<NONE>"); 1722 filename, linenum, arg ? arg : "<NONE>");
1721 if (options->ciphers == NULL) 1723 if (options->ciphers == NULL)
@@ -1726,7 +1728,8 @@ process_server_config_line(ServerOptions *options, char *line,
1726 arg = strdelim(&cp); 1728 arg = strdelim(&cp);
1727 if (!arg || *arg == '\0') 1729 if (!arg || *arg == '\0')
1728 fatal("%s line %d: Missing argument.", filename, linenum); 1730 fatal("%s line %d: Missing argument.", filename, linenum);
1729 if (*arg != '-' && !mac_valid(*arg == '+' ? arg + 1 : arg)) 1731 if (*arg != '-' &&
1732 !mac_valid(*arg == '+' || *arg == '^' ? arg + 1 : arg))
1730 fatal("%s line %d: Bad SSH2 mac spec '%s'.", 1733 fatal("%s line %d: Bad SSH2 mac spec '%s'.",
1731 filename, linenum, arg ? arg : "<NONE>"); 1734 filename, linenum, arg ? arg : "<NONE>");
1732 if (options->macs == NULL) 1735 if (options->macs == NULL)
@@ -1739,7 +1742,8 @@ process_server_config_line(ServerOptions *options, char *line,
1739 fatal("%s line %d: Missing argument.", 1742 fatal("%s line %d: Missing argument.",
1740 filename, linenum); 1743 filename, linenum);
1741 if (*arg != '-' && 1744 if (*arg != '-' &&
1742 !kex_names_valid(*arg == '+' ? arg + 1 : arg)) 1745 !kex_names_valid(*arg == '+' || *arg == '^' ?
1746 arg + 1 : arg))
1743 fatal("%s line %d: Bad SSH2 KexAlgorithms '%s'.", 1747 fatal("%s line %d: Bad SSH2 KexAlgorithms '%s'.",
1744 filename, linenum, arg ? arg : "<NONE>"); 1748 filename, linenum, arg ? arg : "<NONE>");
1745 if (options->kex_algorithms == NULL) 1749 if (options->kex_algorithms == NULL)