diff options
author | naddy@openbsd.org <naddy@openbsd.org> | 2019-09-06 14:45:34 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-09-08 14:49:04 +1000 |
commit | 91a2135f32acdd6378476c5bae475a6e7811a6a2 (patch) | |
tree | da8ddb5e4236cb12f3c70ab939e3abe674aa8ba4 /readconf.c | |
parent | c8bdd2db77ac2369d5cdee237656f266c8f41552 (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 'readconf.c')
-rw-r--r-- | readconf.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/readconf.c b/readconf.c index d1b7871ec..f78b4d6fe 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readconf.c,v 1.308 2019/08/09 05:05:54 djm Exp $ */ | 1 | /* $OpenBSD: readconf.c,v 1.309 2019/09/06 14:45:34 naddy Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1199,7 +1199,8 @@ parse_int: | |||
1199 | arg = strdelim(&s); | 1199 | arg = strdelim(&s); |
1200 | if (!arg || *arg == '\0') | 1200 | if (!arg || *arg == '\0') |
1201 | fatal("%.200s line %d: Missing argument.", filename, linenum); | 1201 | fatal("%.200s line %d: Missing argument.", filename, linenum); |
1202 | if (*arg != '-' && !ciphers_valid(*arg == '+' ? arg + 1 : arg)) | 1202 | if (*arg != '-' && |
1203 | !ciphers_valid(*arg == '+' || *arg == '^' ? arg + 1 : arg)) | ||
1203 | fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.", | 1204 | fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.", |
1204 | filename, linenum, arg ? arg : "<NONE>"); | 1205 | filename, linenum, arg ? arg : "<NONE>"); |
1205 | if (*activep && options->ciphers == NULL) | 1206 | if (*activep && options->ciphers == NULL) |
@@ -1210,7 +1211,8 @@ parse_int: | |||
1210 | arg = strdelim(&s); | 1211 | arg = strdelim(&s); |
1211 | if (!arg || *arg == '\0') | 1212 | if (!arg || *arg == '\0') |
1212 | fatal("%.200s line %d: Missing argument.", filename, linenum); | 1213 | fatal("%.200s line %d: Missing argument.", filename, linenum); |
1213 | if (*arg != '-' && !mac_valid(*arg == '+' ? arg + 1 : arg)) | 1214 | if (*arg != '-' && |
1215 | !mac_valid(*arg == '+' || *arg == '^' ? arg + 1 : arg)) | ||
1214 | fatal("%.200s line %d: Bad SSH2 MAC spec '%s'.", | 1216 | fatal("%.200s line %d: Bad SSH2 MAC spec '%s'.", |
1215 | filename, linenum, arg ? arg : "<NONE>"); | 1217 | filename, linenum, arg ? arg : "<NONE>"); |
1216 | if (*activep && options->macs == NULL) | 1218 | if (*activep && options->macs == NULL) |
@@ -1223,7 +1225,8 @@ parse_int: | |||
1223 | fatal("%.200s line %d: Missing argument.", | 1225 | fatal("%.200s line %d: Missing argument.", |
1224 | filename, linenum); | 1226 | filename, linenum); |
1225 | if (*arg != '-' && | 1227 | if (*arg != '-' && |
1226 | !kex_names_valid(*arg == '+' ? arg + 1 : arg)) | 1228 | !kex_names_valid(*arg == '+' || *arg == '^' ? |
1229 | arg + 1 : arg)) | ||
1227 | fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.", | 1230 | fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.", |
1228 | filename, linenum, arg ? arg : "<NONE>"); | 1231 | filename, linenum, arg ? arg : "<NONE>"); |
1229 | if (*activep && options->kex_algorithms == NULL) | 1232 | if (*activep && options->kex_algorithms == NULL) |
@@ -1238,7 +1241,8 @@ parse_keytypes: | |||
1238 | fatal("%.200s line %d: Missing argument.", | 1241 | fatal("%.200s line %d: Missing argument.", |
1239 | filename, linenum); | 1242 | filename, linenum); |
1240 | if (*arg != '-' && | 1243 | if (*arg != '-' && |
1241 | !sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1)) | 1244 | !sshkey_names_valid2(*arg == '+' || *arg == '^' ? |
1245 | arg + 1 : arg, 1)) | ||
1242 | fatal("%s line %d: Bad key types '%s'.", | 1246 | fatal("%s line %d: Bad key types '%s'.", |
1243 | filename, linenum, arg ? arg : "<NONE>"); | 1247 | filename, linenum, arg ? arg : "<NONE>"); |
1244 | if (*activep && *charptr == NULL) | 1248 | if (*activep && *charptr == NULL) |