summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/readconf.c b/readconf.c
index f1c860b9c..1d03bdf72 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.238 2015/07/10 06:21:53 markus Exp $ */ 1/* $OpenBSD: readconf.c,v 1.239 2015/07/30 00:01:34 djm 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
@@ -1086,7 +1086,7 @@ parse_int:
1086 arg = strdelim(&s); 1086 arg = strdelim(&s);
1087 if (!arg || *arg == '\0') 1087 if (!arg || *arg == '\0')
1088 fatal("%.200s line %d: Missing argument.", filename, linenum); 1088 fatal("%.200s line %d: Missing argument.", filename, linenum);
1089 if (!ciphers_valid(arg)) 1089 if (!ciphers_valid(*arg == '+' ? arg + 1 : arg))
1090 fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.", 1090 fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.",
1091 filename, linenum, arg ? arg : "<NONE>"); 1091 filename, linenum, arg ? arg : "<NONE>");
1092 if (*activep && options->ciphers == NULL) 1092 if (*activep && options->ciphers == NULL)
@@ -1097,7 +1097,7 @@ parse_int:
1097 arg = strdelim(&s); 1097 arg = strdelim(&s);
1098 if (!arg || *arg == '\0') 1098 if (!arg || *arg == '\0')
1099 fatal("%.200s line %d: Missing argument.", filename, linenum); 1099 fatal("%.200s line %d: Missing argument.", filename, linenum);
1100 if (!mac_valid(arg)) 1100 if (!mac_valid(*arg == '+' ? arg + 1 : arg))
1101 fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.", 1101 fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.",
1102 filename, linenum, arg ? arg : "<NONE>"); 1102 filename, linenum, arg ? arg : "<NONE>");
1103 if (*activep && options->macs == NULL) 1103 if (*activep && options->macs == NULL)
@@ -1109,7 +1109,7 @@ parse_int:
1109 if (!arg || *arg == '\0') 1109 if (!arg || *arg == '\0')
1110 fatal("%.200s line %d: Missing argument.", 1110 fatal("%.200s line %d: Missing argument.",
1111 filename, linenum); 1111 filename, linenum);
1112 if (!kex_names_valid(arg)) 1112 if (!kex_names_valid(*arg == '+' ? arg + 1 : arg))
1113 fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.", 1113 fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.",
1114 filename, linenum, arg ? arg : "<NONE>"); 1114 filename, linenum, arg ? arg : "<NONE>");
1115 if (*activep && options->kex_algorithms == NULL) 1115 if (*activep && options->kex_algorithms == NULL)
@@ -1123,7 +1123,7 @@ parse_keytypes:
1123 if (!arg || *arg == '\0') 1123 if (!arg || *arg == '\0')
1124 fatal("%.200s line %d: Missing argument.", 1124 fatal("%.200s line %d: Missing argument.",
1125 filename, linenum); 1125 filename, linenum);
1126 if (!sshkey_names_valid2(arg, 1)) 1126 if (!sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1))
1127 fatal("%s line %d: Bad key types '%s'.", 1127 fatal("%s line %d: Bad key types '%s'.",
1128 filename, linenum, arg ? arg : "<NONE>"); 1128 filename, linenum, arg ? arg : "<NONE>");
1129 if (*activep && *charptr == NULL) 1129 if (*activep && *charptr == NULL)
@@ -1762,9 +1762,6 @@ fill_default_options(Options * options)
1762 /* Selected in ssh_login(). */ 1762 /* Selected in ssh_login(). */
1763 if (options->cipher == -1) 1763 if (options->cipher == -1)
1764 options->cipher = SSH_CIPHER_NOT_SET; 1764 options->cipher = SSH_CIPHER_NOT_SET;
1765 /* options->ciphers, default set in myproposals.h */
1766 /* options->macs, default set in myproposals.h */
1767 /* options->kex_algorithms, default set in myproposals.h */
1768 /* options->hostkeyalgorithms, default set in myproposals.h */ 1765 /* options->hostkeyalgorithms, default set in myproposals.h */
1769 if (options->protocol == SSH_PROTO_UNKNOWN) 1766 if (options->protocol == SSH_PROTO_UNKNOWN)
1770 options->protocol = SSH_PROTO_2; 1767 options->protocol = SSH_PROTO_2;
@@ -1858,10 +1855,14 @@ fill_default_options(Options * options)
1858 options->fingerprint_hash = SSH_FP_HASH_DEFAULT; 1855 options->fingerprint_hash = SSH_FP_HASH_DEFAULT;
1859 if (options->update_hostkeys == -1) 1856 if (options->update_hostkeys == -1)
1860 options->update_hostkeys = 0; 1857 options->update_hostkeys = 0;
1861 if (options->hostbased_key_types == NULL) 1858 if (kex_assemble_names(KEX_CLIENT_ENCRYPT, &options->ciphers) != 0 ||
1862 options->hostbased_key_types = xstrdup(KEX_DEFAULT_PK_ALG); 1859 kex_assemble_names(KEX_CLIENT_MAC, &options->macs) != 0 ||
1863 if (options->pubkey_key_types == NULL) 1860 kex_assemble_names(KEX_CLIENT_KEX, &options->kex_algorithms) != 0 ||
1864 options->pubkey_key_types = xstrdup(KEX_DEFAULT_PK_ALG); 1861 kex_assemble_names(KEX_DEFAULT_PK_ALG,
1862 &options->hostbased_key_types) != 0 ||
1863 kex_assemble_names(KEX_DEFAULT_PK_ALG,
1864 &options->pubkey_key_types) != 0)
1865 fatal("%s: kex_assemble_names failed", __func__);
1865 1866
1866#define CLEAR_ON_NONE(v) \ 1867#define CLEAR_ON_NONE(v) \
1867 do { \ 1868 do { \