Deleted Added
full compact
readconf.c (197679) readconf.c (204917)
1/* $OpenBSD: readconf.c,v 1.177 2009/06/27 09:35:06 andreas Exp $ */
1/* $OpenBSD: readconf.c,v 1.183 2010/02/08 10:50:20 markus Exp $ */
2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved
6 * Functions for reading the configuration files.
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this
10 * software must be clearly marked as such, and if the derived work is
11 * incompatible with the protocol description in the RFC file, it must be
12 * called by a name other than "ssh" or "Secure Shell".
13 */
14
15#include "includes.h"
2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved
6 * Functions for reading the configuration files.
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this
10 * software must be clearly marked as such, and if the derived work is
11 * incompatible with the protocol description in the RFC file, it must be
12 * called by a name other than "ssh" or "Secure Shell".
13 */
14
15#include "includes.h"
16__RCSID("$FreeBSD: head/crypto/openssh/readconf.c 197679 2009-10-01 17:12:52Z des $");
16__RCSID("$FreeBSD: head/crypto/openssh/readconf.c 204917 2010-03-09 19:16:43Z des $");
17
18#include <sys/types.h>
19#include <sys/stat.h>
20#include <sys/socket.h>
21#include <sys/sysctl.h>
22
23#include <netinet/in.h>
24

--- 96 unchanged lines hidden (view full) ---

121 oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
122 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
123 oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,
124 oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts,
125 oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs,
126 oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication,
127 oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias,
128 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
17
18#include <sys/types.h>
19#include <sys/stat.h>
20#include <sys/socket.h>
21#include <sys/sysctl.h>
22
23#include <netinet/in.h>
24

--- 96 unchanged lines hidden (view full) ---

121 oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
122 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
123 oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,
124 oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts,
125 oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs,
126 oGlobalKnownHostsFile2, oUserKnownHostsFile2, oPubkeyAuthentication,
127 oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias,
128 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
129 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
129 oHostKeyAlgorithms, oBindAddress, oPKCS11Provider,
130 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
131 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
132 oAddressFamily, oGssAuthentication, oGssDelegateCreds,
133 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
134 oSendEnv, oControlPath, oControlMaster, oHashKnownHosts,
135 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
136 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication,
137 oVersionAddendum,

--- 66 unchanged lines hidden (view full) ---

204 { "tcpkeepalive", oTCPKeepAlive },
205 { "keepalive", oTCPKeepAlive }, /* obsolete */
206 { "numberofpasswordprompts", oNumberOfPasswordPrompts },
207 { "loglevel", oLogLevel },
208 { "dynamicforward", oDynamicForward },
209 { "preferredauthentications", oPreferredAuthentications },
210 { "hostkeyalgorithms", oHostKeyAlgorithms },
211 { "bindaddress", oBindAddress },
130 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
131 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
132 oAddressFamily, oGssAuthentication, oGssDelegateCreds,
133 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
134 oSendEnv, oControlPath, oControlMaster, oHashKnownHosts,
135 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
136 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication,
137 oVersionAddendum,

--- 66 unchanged lines hidden (view full) ---

204 { "tcpkeepalive", oTCPKeepAlive },
205 { "keepalive", oTCPKeepAlive }, /* obsolete */
206 { "numberofpasswordprompts", oNumberOfPasswordPrompts },
207 { "loglevel", oLogLevel },
208 { "dynamicforward", oDynamicForward },
209 { "preferredauthentications", oPreferredAuthentications },
210 { "hostkeyalgorithms", oHostKeyAlgorithms },
211 { "bindaddress", oBindAddress },
212#ifdef SMARTCARD
213 { "smartcarddevice", oSmartcardDevice },
212#ifdef ENABLE_PKCS11
213 { "smartcarddevice", oPKCS11Provider },
214 { "pkcs11provider", oPKCS11Provider },
214#else
215 { "smartcarddevice", oUnsupported },
215#else
216 { "smartcarddevice", oUnsupported },
217 { "pkcs11provider", oUnsupported },
216#endif
217 { "clearallforwardings", oClearAllForwardings },
218 { "enablesshkeysign", oEnableSSHKeysign },
219 { "verifyhostkeydns", oVerifyHostKeyDNS },
220 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
221 { "rekeylimit", oRekeyLimit },
222 { "connecttimeout", oConnectTimeout },
223 { "addressfamily", oAddressFamily },

--- 397 unchanged lines hidden (view full) ---

621 case oPreferredAuthentications:
622 charptr = &options->preferred_authentications;
623 goto parse_string;
624
625 case oBindAddress:
626 charptr = &options->bind_address;
627 goto parse_string;
628
218#endif
219 { "clearallforwardings", oClearAllForwardings },
220 { "enablesshkeysign", oEnableSSHKeysign },
221 { "verifyhostkeydns", oVerifyHostKeyDNS },
222 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
223 { "rekeylimit", oRekeyLimit },
224 { "connecttimeout", oConnectTimeout },
225 { "addressfamily", oAddressFamily },

--- 397 unchanged lines hidden (view full) ---

623 case oPreferredAuthentications:
624 charptr = &options->preferred_authentications;
625 goto parse_string;
626
627 case oBindAddress:
628 charptr = &options->bind_address;
629 goto parse_string;
630
629 case oSmartcardDevice:
630 charptr = &options->smartcard_device;
631 case oPKCS11Provider:
632 charptr = &options->pkcs11_provider;
631 goto parse_string;
632
633 case oProxyCommand:
634 charptr = &options->proxy_command;
635parse_command:
636 if (s == NULL)
637 fatal("%.200s line %d: Missing argument.", filename, linenum);
638 len = strspn(s, WHITESPACE "=");

--- 431 unchanged lines hidden (view full) ---

1070 options->system_hostfile2 = NULL;
1071 options->user_hostfile2 = NULL;
1072 options->num_local_forwards = 0;
1073 options->num_remote_forwards = 0;
1074 options->clear_forwardings = -1;
1075 options->log_level = SYSLOG_LEVEL_NOT_SET;
1076 options->preferred_authentications = NULL;
1077 options->bind_address = NULL;
633 goto parse_string;
634
635 case oProxyCommand:
636 charptr = &options->proxy_command;
637parse_command:
638 if (s == NULL)
639 fatal("%.200s line %d: Missing argument.", filename, linenum);
640 len = strspn(s, WHITESPACE "=");

--- 431 unchanged lines hidden (view full) ---

1072 options->system_hostfile2 = NULL;
1073 options->user_hostfile2 = NULL;
1074 options->num_local_forwards = 0;
1075 options->num_remote_forwards = 0;
1076 options->clear_forwardings = -1;
1077 options->log_level = SYSLOG_LEVEL_NOT_SET;
1078 options->preferred_authentications = NULL;
1079 options->bind_address = NULL;
1078 options->smartcard_device = NULL;
1080 options->pkcs11_provider = NULL;
1079 options->enable_ssh_keysign = - 1;
1080 options->no_host_authentication_for_localhost = - 1;
1081 options->identities_only = - 1;
1082 options->rekey_limit = - 1;
1083 options->verify_host_key_dns = -1;
1084 options->server_alive_interval = -1;
1085 options->server_alive_count_max = -1;
1086 options->num_send_env = 0;

--- 74 unchanged lines hidden (view full) ---

1161 options->number_of_password_prompts = 3;
1162 /* Selected in ssh_login(). */
1163 if (options->cipher == -1)
1164 options->cipher = SSH_CIPHER_NOT_SET;
1165 /* options->ciphers, default set in myproposals.h */
1166 /* options->macs, default set in myproposals.h */
1167 /* options->hostkeyalgorithms, default set in myproposals.h */
1168 if (options->protocol == SSH_PROTO_UNKNOWN)
1081 options->enable_ssh_keysign = - 1;
1082 options->no_host_authentication_for_localhost = - 1;
1083 options->identities_only = - 1;
1084 options->rekey_limit = - 1;
1085 options->verify_host_key_dns = -1;
1086 options->server_alive_interval = -1;
1087 options->server_alive_count_max = -1;
1088 options->num_send_env = 0;

--- 74 unchanged lines hidden (view full) ---

1163 options->number_of_password_prompts = 3;
1164 /* Selected in ssh_login(). */
1165 if (options->cipher == -1)
1166 options->cipher = SSH_CIPHER_NOT_SET;
1167 /* options->ciphers, default set in myproposals.h */
1168 /* options->macs, default set in myproposals.h */
1169 /* options->hostkeyalgorithms, default set in myproposals.h */
1170 if (options->protocol == SSH_PROTO_UNKNOWN)
1169 options->protocol = SSH_PROTO_1|SSH_PROTO_2;
1171 options->protocol = SSH_PROTO_2;
1170 if (options->num_identity_files == 0) {
1171 if (options->protocol & SSH_PROTO_1) {
1172 len = 2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1;
1173 options->identity_files[options->num_identity_files] =
1174 xmalloc(len);
1175 snprintf(options->identity_files[options->num_identity_files++],
1176 len, "~/%.100s", _PATH_SSH_CLIENT_IDENTITY);
1177 }

--- 165 unchanged lines hidden ---
1172 if (options->num_identity_files == 0) {
1173 if (options->protocol & SSH_PROTO_1) {
1174 len = 2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1;
1175 options->identity_files[options->num_identity_files] =
1176 xmalloc(len);
1177 snprintf(options->identity_files[options->num_identity_files++],
1178 len, "~/%.100s", _PATH_SSH_CLIENT_IDENTITY);
1179 }

--- 165 unchanged lines hidden ---