diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-01-30 00:38:50 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-01-30 12:04:10 +1100 |
commit | 381a2615a154a82c4c53b787f4a564ef894fe9ac (patch) | |
tree | e5c5100b9d9a416662726660cda468b697a1e8a3 /readconf.c | |
parent | 4833d01591b7eb049489d9558b65f5553387ed43 (diff) |
upstream commit
small cleanup post SSHv1 removal:
remove SSHv1-isms in commented examples
reorder token table to group deprecated and compile-time conditional tokens
better
fix config dumping code for some compile-time conditional options that
weren't being correctly skipped (SSHv1 and PKCS#11)
Upstream-ID: f2e96b3cb3158d857c5a91ad2e15925df3060105
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 76 |
1 files changed, 47 insertions, 29 deletions
diff --git a/readconf.c b/readconf.c index 5064e33ee..72b4a637c 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readconf.c,v 1.265 2017/01/30 00:34:01 djm Exp $ */ | 1 | /* $OpenBSD: readconf.c,v 1.266 2017/01/30 00:38:50 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 |
@@ -93,7 +93,7 @@ | |||
93 | 93 | ||
94 | Host books.com | 94 | Host books.com |
95 | RemoteForward 9999 shadows.cs.hut.fi:9999 | 95 | RemoteForward 9999 shadows.cs.hut.fi:9999 |
96 | Cipher 3des | 96 | Ciphers 3des-cbc |
97 | 97 | ||
98 | Host fascist.blob.com | 98 | Host fascist.blob.com |
99 | Port 23123 | 99 | Port 23123 |
@@ -108,7 +108,7 @@ | |||
108 | PublicKeyAuthentication no | 108 | PublicKeyAuthentication no |
109 | 109 | ||
110 | Host *.su | 110 | Host *.su |
111 | Cipher none | 111 | Ciphers aes128-ctr |
112 | PasswordAuthentication no | 112 | PasswordAuthentication no |
113 | 113 | ||
114 | Host vpn.fake.com | 114 | Host vpn.fake.com |
@@ -180,6 +180,44 @@ static struct { | |||
180 | const char *name; | 180 | const char *name; |
181 | OpCodes opcode; | 181 | OpCodes opcode; |
182 | } keywords[] = { | 182 | } keywords[] = { |
183 | /* Deprecated options */ | ||
184 | { "fallbacktorsh", oDeprecated }, | ||
185 | { "globalknownhostsfile2", oDeprecated }, | ||
186 | { "rhostsauthentication", oDeprecated }, | ||
187 | { "userknownhostsfile2", oDeprecated }, | ||
188 | { "useroaming", oDeprecated }, | ||
189 | { "usersh", oDeprecated }, | ||
190 | |||
191 | /* Unsupported options */ | ||
192 | { "afstokenpassing", oUnsupported }, | ||
193 | { "kerberosauthentication", oUnsupported }, | ||
194 | { "kerberostgtpassing", oUnsupported }, | ||
195 | |||
196 | /* Sometimes-unsupported options */ | ||
197 | #if defined(GSSAPI) | ||
198 | { "gssapiauthentication", oGssAuthentication }, | ||
199 | { "gssapidelegatecredentials", oGssDelegateCreds }, | ||
200 | # else | ||
201 | { "gssapiauthentication", oUnsupported }, | ||
202 | { "gssapidelegatecredentials", oUnsupported }, | ||
203 | #endif | ||
204 | #ifdef ENABLE_PKCS11 | ||
205 | { "smartcarddevice", oPKCS11Provider }, | ||
206 | { "pkcs11provider", oPKCS11Provider }, | ||
207 | # else | ||
208 | { "smartcarddevice", oUnsupported }, | ||
209 | { "pkcs11provider", oUnsupported }, | ||
210 | #endif | ||
211 | #ifdef WITH_SSH1 | ||
212 | { "rsaauthentication", oRSAAuthentication }, | ||
213 | { "rhostsrsaauthentication", oRhostsRSAAuthentication }, | ||
214 | { "compressionlevel", oCompressionLevel }, | ||
215 | # else | ||
216 | { "rsaauthentication", oUnsupported }, | ||
217 | { "rhostsrsaauthentication", oUnsupported }, | ||
218 | { "compressionlevel", oUnsupported }, | ||
219 | #endif | ||
220 | |||
183 | { "forwardagent", oForwardAgent }, | 221 | { "forwardagent", oForwardAgent }, |
184 | { "forwardx11", oForwardX11 }, | 222 | { "forwardx11", oForwardX11 }, |
185 | { "forwardx11trusted", oForwardX11Trusted }, | 223 | { "forwardx11trusted", oForwardX11Trusted }, |
@@ -188,30 +226,15 @@ static struct { | |||
188 | { "xauthlocation", oXAuthLocation }, | 226 | { "xauthlocation", oXAuthLocation }, |
189 | { "gatewayports", oGatewayPorts }, | 227 | { "gatewayports", oGatewayPorts }, |
190 | { "useprivilegedport", oUsePrivilegedPort }, | 228 | { "useprivilegedport", oUsePrivilegedPort }, |
191 | { "rhostsauthentication", oDeprecated }, | ||
192 | { "passwordauthentication", oPasswordAuthentication }, | 229 | { "passwordauthentication", oPasswordAuthentication }, |
193 | { "kbdinteractiveauthentication", oKbdInteractiveAuthentication }, | 230 | { "kbdinteractiveauthentication", oKbdInteractiveAuthentication }, |
194 | { "kbdinteractivedevices", oKbdInteractiveDevices }, | 231 | { "kbdinteractivedevices", oKbdInteractiveDevices }, |
195 | { "rsaauthentication", oRSAAuthentication }, | ||
196 | { "pubkeyauthentication", oPubkeyAuthentication }, | 232 | { "pubkeyauthentication", oPubkeyAuthentication }, |
197 | { "dsaauthentication", oPubkeyAuthentication }, /* alias */ | 233 | { "dsaauthentication", oPubkeyAuthentication }, /* alias */ |
198 | { "rhostsrsaauthentication", oRhostsRSAAuthentication }, | ||
199 | { "hostbasedauthentication", oHostbasedAuthentication }, | 234 | { "hostbasedauthentication", oHostbasedAuthentication }, |
200 | { "challengeresponseauthentication", oChallengeResponseAuthentication }, | 235 | { "challengeresponseauthentication", oChallengeResponseAuthentication }, |
201 | { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */ | 236 | { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */ |
202 | { "tisauthentication", oChallengeResponseAuthentication }, /* alias */ | 237 | { "tisauthentication", oChallengeResponseAuthentication }, /* alias */ |
203 | { "kerberosauthentication", oUnsupported }, | ||
204 | { "kerberostgtpassing", oUnsupported }, | ||
205 | { "afstokenpassing", oUnsupported }, | ||
206 | #if defined(GSSAPI) | ||
207 | { "gssapiauthentication", oGssAuthentication }, | ||
208 | { "gssapidelegatecredentials", oGssDelegateCreds }, | ||
209 | #else | ||
210 | { "gssapiauthentication", oUnsupported }, | ||
211 | { "gssapidelegatecredentials", oUnsupported }, | ||
212 | #endif | ||
213 | { "fallbacktorsh", oDeprecated }, | ||
214 | { "usersh", oDeprecated }, | ||
215 | { "identityfile", oIdentityFile }, | 238 | { "identityfile", oIdentityFile }, |
216 | { "identityfile2", oIdentityFile }, /* obsolete */ | 239 | { "identityfile2", oIdentityFile }, /* obsolete */ |
217 | { "identitiesonly", oIdentitiesOnly }, | 240 | { "identitiesonly", oIdentitiesOnly }, |
@@ -233,15 +256,12 @@ static struct { | |||
233 | { "match", oMatch }, | 256 | { "match", oMatch }, |
234 | { "escapechar", oEscapeChar }, | 257 | { "escapechar", oEscapeChar }, |
235 | { "globalknownhostsfile", oGlobalKnownHostsFile }, | 258 | { "globalknownhostsfile", oGlobalKnownHostsFile }, |
236 | { "globalknownhostsfile2", oDeprecated }, | ||
237 | { "userknownhostsfile", oUserKnownHostsFile }, | 259 | { "userknownhostsfile", oUserKnownHostsFile }, |
238 | { "userknownhostsfile2", oDeprecated }, | ||
239 | { "connectionattempts", oConnectionAttempts }, | 260 | { "connectionattempts", oConnectionAttempts }, |
240 | { "batchmode", oBatchMode }, | 261 | { "batchmode", oBatchMode }, |
241 | { "checkhostip", oCheckHostIP }, | 262 | { "checkhostip", oCheckHostIP }, |
242 | { "stricthostkeychecking", oStrictHostKeyChecking }, | 263 | { "stricthostkeychecking", oStrictHostKeyChecking }, |
243 | { "compression", oCompression }, | 264 | { "compression", oCompression }, |
244 | { "compressionlevel", oCompressionLevel }, | ||
245 | { "tcpkeepalive", oTCPKeepAlive }, | 265 | { "tcpkeepalive", oTCPKeepAlive }, |
246 | { "keepalive", oTCPKeepAlive }, /* obsolete */ | 266 | { "keepalive", oTCPKeepAlive }, /* obsolete */ |
247 | { "numberofpasswordprompts", oNumberOfPasswordPrompts }, | 267 | { "numberofpasswordprompts", oNumberOfPasswordPrompts }, |
@@ -250,13 +270,6 @@ static struct { | |||
250 | { "preferredauthentications", oPreferredAuthentications }, | 270 | { "preferredauthentications", oPreferredAuthentications }, |
251 | { "hostkeyalgorithms", oHostKeyAlgorithms }, | 271 | { "hostkeyalgorithms", oHostKeyAlgorithms }, |
252 | { "bindaddress", oBindAddress }, | 272 | { "bindaddress", oBindAddress }, |
253 | #ifdef ENABLE_PKCS11 | ||
254 | { "smartcarddevice", oPKCS11Provider }, | ||
255 | { "pkcs11provider", oPKCS11Provider }, | ||
256 | #else | ||
257 | { "smartcarddevice", oUnsupported }, | ||
258 | { "pkcs11provider", oUnsupported }, | ||
259 | #endif | ||
260 | { "clearallforwardings", oClearAllForwardings }, | 273 | { "clearallforwardings", oClearAllForwardings }, |
261 | { "enablesshkeysign", oEnableSSHKeysign }, | 274 | { "enablesshkeysign", oEnableSSHKeysign }, |
262 | { "verifyhostkeydns", oVerifyHostKeyDNS }, | 275 | { "verifyhostkeydns", oVerifyHostKeyDNS }, |
@@ -277,7 +290,6 @@ static struct { | |||
277 | { "localcommand", oLocalCommand }, | 290 | { "localcommand", oLocalCommand }, |
278 | { "permitlocalcommand", oPermitLocalCommand }, | 291 | { "permitlocalcommand", oPermitLocalCommand }, |
279 | { "visualhostkey", oVisualHostKey }, | 292 | { "visualhostkey", oVisualHostKey }, |
280 | { "useroaming", oDeprecated }, | ||
281 | { "kexalgorithms", oKexAlgorithms }, | 293 | { "kexalgorithms", oKexAlgorithms }, |
282 | { "ipqos", oIPQoS }, | 294 | { "ipqos", oIPQoS }, |
283 | { "requesttty", oRequestTTY }, | 295 | { "requesttty", oRequestTTY }, |
@@ -2527,8 +2539,10 @@ dump_client_config(Options *o, const char *host) | |||
2527 | dump_cfg_fmtint(oProxyUseFdpass, o->proxy_use_fdpass); | 2539 | dump_cfg_fmtint(oProxyUseFdpass, o->proxy_use_fdpass); |
2528 | dump_cfg_fmtint(oPubkeyAuthentication, o->pubkey_authentication); | 2540 | dump_cfg_fmtint(oPubkeyAuthentication, o->pubkey_authentication); |
2529 | dump_cfg_fmtint(oRequestTTY, o->request_tty); | 2541 | dump_cfg_fmtint(oRequestTTY, o->request_tty); |
2542 | #ifdef WITH_RSA1 | ||
2530 | dump_cfg_fmtint(oRhostsRSAAuthentication, o->rhosts_rsa_authentication); | 2543 | dump_cfg_fmtint(oRhostsRSAAuthentication, o->rhosts_rsa_authentication); |
2531 | dump_cfg_fmtint(oRSAAuthentication, o->rsa_authentication); | 2544 | dump_cfg_fmtint(oRSAAuthentication, o->rsa_authentication); |
2545 | #endif | ||
2532 | dump_cfg_fmtint(oStreamLocalBindUnlink, o->fwd_opts.streamlocal_bind_unlink); | 2546 | dump_cfg_fmtint(oStreamLocalBindUnlink, o->fwd_opts.streamlocal_bind_unlink); |
2533 | dump_cfg_fmtint(oStrictHostKeyChecking, o->strict_host_key_checking); | 2547 | dump_cfg_fmtint(oStrictHostKeyChecking, o->strict_host_key_checking); |
2534 | dump_cfg_fmtint(oTCPKeepAlive, o->tcp_keep_alive); | 2548 | dump_cfg_fmtint(oTCPKeepAlive, o->tcp_keep_alive); |
@@ -2540,7 +2554,9 @@ dump_client_config(Options *o, const char *host) | |||
2540 | 2554 | ||
2541 | /* Integer options */ | 2555 | /* Integer options */ |
2542 | dump_cfg_int(oCanonicalizeMaxDots, o->canonicalize_max_dots); | 2556 | dump_cfg_int(oCanonicalizeMaxDots, o->canonicalize_max_dots); |
2557 | #ifdef WITH_SSH1 | ||
2543 | dump_cfg_int(oCompressionLevel, o->compression_level); | 2558 | dump_cfg_int(oCompressionLevel, o->compression_level); |
2559 | #endif | ||
2544 | dump_cfg_int(oConnectionAttempts, o->connection_attempts); | 2560 | dump_cfg_int(oConnectionAttempts, o->connection_attempts); |
2545 | dump_cfg_int(oForwardX11Timeout, o->forward_x11_timeout); | 2561 | dump_cfg_int(oForwardX11Timeout, o->forward_x11_timeout); |
2546 | dump_cfg_int(oNumberOfPasswordPrompts, o->number_of_password_prompts); | 2562 | dump_cfg_int(oNumberOfPasswordPrompts, o->number_of_password_prompts); |
@@ -2560,7 +2576,9 @@ dump_client_config(Options *o, const char *host) | |||
2560 | dump_cfg_string(oLocalCommand, o->local_command); | 2576 | dump_cfg_string(oLocalCommand, o->local_command); |
2561 | dump_cfg_string(oLogLevel, log_level_name(o->log_level)); | 2577 | dump_cfg_string(oLogLevel, log_level_name(o->log_level)); |
2562 | dump_cfg_string(oMacs, o->macs ? o->macs : KEX_CLIENT_MAC); | 2578 | dump_cfg_string(oMacs, o->macs ? o->macs : KEX_CLIENT_MAC); |
2579 | #ifdef ENABLE_PKCS11 | ||
2563 | dump_cfg_string(oPKCS11Provider, o->pkcs11_provider); | 2580 | dump_cfg_string(oPKCS11Provider, o->pkcs11_provider); |
2581 | #endif | ||
2564 | dump_cfg_string(oPreferredAuthentications, o->preferred_authentications); | 2582 | dump_cfg_string(oPreferredAuthentications, o->preferred_authentications); |
2565 | dump_cfg_string(oPubkeyAcceptedKeyTypes, o->pubkey_key_types); | 2583 | dump_cfg_string(oPubkeyAcceptedKeyTypes, o->pubkey_key_types); |
2566 | dump_cfg_string(oRevokedHostKeys, o->revoked_host_keys); | 2584 | dump_cfg_string(oRevokedHostKeys, o->revoked_host_keys); |