diff options
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/servconf.c b/servconf.c index f1010b3b9..c0f6af0be 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | /* $OpenBSD: servconf.c,v 1.339 2018/07/11 18:53:29 markus Exp $ */ | 2 | /* $OpenBSD: servconf.c,v 1.340 2018/08/12 20:19:13 djm 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 |
@@ -192,24 +192,24 @@ static void | |||
192 | assemble_algorithms(ServerOptions *o) | 192 | assemble_algorithms(ServerOptions *o) |
193 | { | 193 | { |
194 | char *all_cipher, *all_mac, *all_kex, *all_key; | 194 | char *all_cipher, *all_mac, *all_kex, *all_key; |
195 | int r; | ||
195 | 196 | ||
196 | all_cipher = cipher_alg_list(',', 0); | 197 | all_cipher = cipher_alg_list(',', 0); |
197 | all_mac = mac_alg_list(','); | 198 | all_mac = mac_alg_list(','); |
198 | all_kex = kex_alg_list(','); | 199 | all_kex = kex_alg_list(','); |
199 | all_key = sshkey_alg_list(0, 0, 1, ','); | 200 | all_key = sshkey_alg_list(0, 0, 1, ','); |
200 | if (kex_assemble_names(&o->ciphers, | 201 | #define ASSEMBLE(what, defaults, all) \ |
201 | KEX_SERVER_ENCRYPT, all_cipher) != 0 || | 202 | do { \ |
202 | kex_assemble_names(&o->macs, | 203 | if ((r = kex_assemble_names(&o->what, defaults, all)) != 0) \ |
203 | KEX_SERVER_MAC, all_mac) != 0 || | 204 | fatal("%s: %s: %s", __func__, #what, ssh_err(r)); \ |
204 | kex_assemble_names(&o->kex_algorithms, | 205 | } while (0) |
205 | KEX_SERVER_KEX, all_kex) != 0 || | 206 | ASSEMBLE(ciphers, KEX_SERVER_ENCRYPT, all_cipher); |
206 | kex_assemble_names(&o->hostkeyalgorithms, | 207 | ASSEMBLE(macs, KEX_SERVER_MAC, all_mac); |
207 | KEX_DEFAULT_PK_ALG, all_key) != 0 || | 208 | ASSEMBLE(kex_algorithms, KEX_SERVER_KEX, all_kex); |
208 | kex_assemble_names(&o->hostbased_key_types, | 209 | ASSEMBLE(hostkeyalgorithms, KEX_DEFAULT_PK_ALG, all_key); |
209 | KEX_DEFAULT_PK_ALG, all_key) != 0 || | 210 | ASSEMBLE(hostbased_key_types, KEX_DEFAULT_PK_ALG, all_key); |
210 | kex_assemble_names(&o->pubkey_key_types, | 211 | ASSEMBLE(pubkey_key_types, KEX_DEFAULT_PK_ALG, all_key); |
211 | KEX_DEFAULT_PK_ALG, all_key) != 0) | 212 | #undef ASSEMBLE |
212 | fatal("kex_assemble_names failed"); | ||
213 | free(all_cipher); | 213 | free(all_cipher); |
214 | free(all_mac); | 214 | free(all_mac); |
215 | free(all_kex); | 215 | free(all_kex); |