version 1.24, 2000/03/28 20:31:28 |
version 1.25, 2000/04/12 07:45:44 |
|
|
#include "readconf.h" |
#include "readconf.h" |
#include "match.h" |
#include "match.h" |
#include "xmalloc.h" |
#include "xmalloc.h" |
|
#include "compat.h" |
|
|
/* Format of the configuration file: |
/* Format of the configuration file: |
|
|
|
|
oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts, |
oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts, |
oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression, |
oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression, |
oCompressionLevel, oKeepAlives, oNumberOfPasswordPrompts, oTISAuthentication, |
oCompressionLevel, oKeepAlives, oNumberOfPasswordPrompts, oTISAuthentication, |
oUsePrivilegedPort, oLogLevel |
oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol |
} OpCodes; |
} OpCodes; |
|
|
/* Textual representations of the tokens. */ |
/* Textual representations of the tokens. */ |
|
|
{ "proxycommand", oProxyCommand }, |
{ "proxycommand", oProxyCommand }, |
{ "port", oPort }, |
{ "port", oPort }, |
{ "cipher", oCipher }, |
{ "cipher", oCipher }, |
|
{ "ciphers", oCiphers }, |
|
{ "protocol", oProtocol }, |
{ "remoteforward", oRemoteForward }, |
{ "remoteforward", oRemoteForward }, |
{ "localforward", oLocalForward }, |
{ "localforward", oLocalForward }, |
{ "user", oUser }, |
{ "user", oUser }, |
|
|
*intptr = value; |
*intptr = value; |
break; |
break; |
|
|
|
case oCiphers: |
|
cp = strtok(NULL, WHITESPACE); |
|
if (!ciphers_valid(cp)) |
|
fatal("%.200s line %d: Bad cipher spec '%s'.", |
|
filename, linenum, cp ? cp : "<NONE>"); |
|
if (*activep && options->ciphers == NULL) |
|
options->ciphers = xstrdup(cp); |
|
break; |
|
|
|
case oProtocol: |
|
intptr = &options->protocol; |
|
cp = strtok(NULL, WHITESPACE); |
|
value = proto_spec(cp); |
|
if (value == SSH_PROTO_UNKNOWN) |
|
fatal("%.200s line %d: Bad protocol spec '%s'.", |
|
filename, linenum, cp ? cp : "<NONE>"); |
|
if (*activep && *intptr == SSH_PROTO_UNKNOWN) |
|
*intptr = value; |
|
break; |
|
|
case oLogLevel: |
case oLogLevel: |
intptr = (int *) &options->log_level; |
intptr = (int *) &options->log_level; |
cp = strtok(NULL, WHITESPACE); |
cp = strtok(NULL, WHITESPACE); |
|
|
options->connection_attempts = -1; |
options->connection_attempts = -1; |
options->number_of_password_prompts = -1; |
options->number_of_password_prompts = -1; |
options->cipher = -1; |
options->cipher = -1; |
|
options->ciphers = NULL; |
|
options->protocol = SSH_PROTO_UNKNOWN; |
options->num_identity_files = 0; |
options->num_identity_files = 0; |
options->hostname = NULL; |
options->hostname = NULL; |
options->proxy_command = NULL; |
options->proxy_command = NULL; |
|
|
/* Selected in ssh_login(). */ |
/* Selected in ssh_login(). */ |
if (options->cipher == -1) |
if (options->cipher == -1) |
options->cipher = SSH_CIPHER_NOT_SET; |
options->cipher = SSH_CIPHER_NOT_SET; |
|
if (options->protocol == SSH_PROTO_UNKNOWN) |
|
options->protocol = SSH_PROTO_1; |
if (options->num_identity_files == 0) { |
if (options->num_identity_files == 0) { |
options->identity_files[0] = |
options->identity_files[0] = |
xmalloc(2 + strlen(SSH_CLIENT_IDENTITY) + 1); |
xmalloc(2 + strlen(SSH_CLIENT_IDENTITY) + 1); |