readconf.c (5dc73ebebeb64670a24b3db3934735b1859926b7) readconf.c (a8f6863aa612ce6941e7bad9cf809a8d0608a7ca)
1/*
2 *
3 * readconf.c
4 *
5 * Author: Tatu Ylonen <ylo@cs.hut.fi>
6 *
7 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 * All rights reserved
9 *
10 * Created: Sat Apr 22 00:03:10 1995 ylo
11 *
12 * Functions for reading the configuration files.
13 *
1/*
2 *
3 * readconf.c
4 *
5 * Author: Tatu Ylonen <ylo@cs.hut.fi>
6 *
7 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 * All rights reserved
9 *
10 * Created: Sat Apr 22 00:03:10 1995 ylo
11 *
12 * Functions for reading the configuration files.
13 *
14 * $FreeBSD$
15 */
16
17#include "includes.h"
18RCSID("$Id: readconf.c,v 1.23 2000/02/28 19:51:58 markus Exp $");
19
20#include "ssh.h"
21#include "cipher.h"
22#include "readconf.h"

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

88/* Keyword tokens. */
89
90typedef enum {
91 oBadOption,
92 oForwardAgent, oForwardX11, oGatewayPorts, oRhostsAuthentication,
93 oPasswordAuthentication, oRSAAuthentication, oFallBackToRsh, oUseRsh,
94 oSkeyAuthentication,
95#ifdef KRB4
14 */
15
16#include "includes.h"
17RCSID("$Id: readconf.c,v 1.23 2000/02/28 19:51:58 markus Exp $");
18
19#include "ssh.h"
20#include "cipher.h"
21#include "readconf.h"

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

87/* Keyword tokens. */
88
89typedef enum {
90 oBadOption,
91 oForwardAgent, oForwardX11, oGatewayPorts, oRhostsAuthentication,
92 oPasswordAuthentication, oRSAAuthentication, oFallBackToRsh, oUseRsh,
93 oSkeyAuthentication,
94#ifdef KRB4
96 oKrb4Authentication,
95 oKerberosAuthentication,
97#endif /* KRB4 */
96#endif /* KRB4 */
98#ifdef KRB5
99 oKrb5Authentication, oKrb5TgtPassing,
100#endif /* KRB5 */
101#ifdef AFS
97#ifdef AFS
102 oKrb4TgtPassing, oAFSTokenPassing,
98 oKerberosTgtPassing, oAFSTokenPassing,
103#endif
104 oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward,
105 oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
106 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
107 oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,
108 oCompressionLevel, oKeepAlives, oNumberOfPasswordPrompts, oTISAuthentication,
109 oUsePrivilegedPort, oLogLevel
110} OpCodes;

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

119 { "forwardx11", oForwardX11 },
120 { "gatewayports", oGatewayPorts },
121 { "useprivilegedport", oUsePrivilegedPort },
122 { "rhostsauthentication", oRhostsAuthentication },
123 { "passwordauthentication", oPasswordAuthentication },
124 { "rsaauthentication", oRSAAuthentication },
125 { "skeyauthentication", oSkeyAuthentication },
126#ifdef KRB4
99#endif
100 oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward,
101 oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
102 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
103 oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,
104 oCompressionLevel, oKeepAlives, oNumberOfPasswordPrompts, oTISAuthentication,
105 oUsePrivilegedPort, oLogLevel
106} OpCodes;

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

115 { "forwardx11", oForwardX11 },
116 { "gatewayports", oGatewayPorts },
117 { "useprivilegedport", oUsePrivilegedPort },
118 { "rhostsauthentication", oRhostsAuthentication },
119 { "passwordauthentication", oPasswordAuthentication },
120 { "rsaauthentication", oRSAAuthentication },
121 { "skeyauthentication", oSkeyAuthentication },
122#ifdef KRB4
127 { "kerberos4authentication", oKrb4Authentication },
123 { "kerberosauthentication", oKerberosAuthentication },
128#endif /* KRB4 */
124#endif /* KRB4 */
129#ifdef KRB5
130 { "kerberos5authentication", oKrb5Authentication },
131 { "kerberos5tgtpassing", oKrb5TgtPassing },
132#endif /* KRB5 */
133#ifdef AFS
125#ifdef AFS
134 { "kerberos4tgtpassing", oKrb4TgtPassing },
126 { "kerberostgtpassing", oKerberosTgtPassing },
135 { "afstokenpassing", oAFSTokenPassing },
136#endif
137 { "fallbacktorsh", oFallBackToRsh },
138 { "usersh", oUseRsh },
139 { "identityfile", oIdentityFile },
140 { "hostname", oHostName },
141 { "proxycommand", oProxyCommand },
142 { "port", oPort },

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

300
301 case oTISAuthentication:
302 /* fallthrough, there is no difference on the client side */
303 case oSkeyAuthentication:
304 intptr = &options->skey_authentication;
305 goto parse_flag;
306
307#ifdef KRB4
127 { "afstokenpassing", oAFSTokenPassing },
128#endif
129 { "fallbacktorsh", oFallBackToRsh },
130 { "usersh", oUseRsh },
131 { "identityfile", oIdentityFile },
132 { "hostname", oHostName },
133 { "proxycommand", oProxyCommand },
134 { "port", oPort },

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

292
293 case oTISAuthentication:
294 /* fallthrough, there is no difference on the client side */
295 case oSkeyAuthentication:
296 intptr = &options->skey_authentication;
297 goto parse_flag;
298
299#ifdef KRB4
308 case oKrb4Authentication:
309 intptr = &options->krb4_authentication;
300 case oKerberosAuthentication:
301 intptr = &options->kerberos_authentication;
310 goto parse_flag;
311#endif /* KRB4 */
312
302 goto parse_flag;
303#endif /* KRB4 */
304
313#ifdef KRB5
314 case oKrb5Authentication:
315 intptr = &options->krb5_authentication;
316 goto parse_flag;
317
318 case oKrb5TgtPassing:
319 intptr = &options->krb5_tgt_passing;
320 goto parse_flag;
321#endif /* KRB5 */
322
323#ifdef AFS
305#ifdef AFS
324 case oKrb4TgtPassing:
325 intptr = &options->krb4_tgt_passing;
306 case oKerberosTgtPassing:
307 intptr = &options->kerberos_tgt_passing;
326 goto parse_flag;
327
328 case oAFSTokenPassing:
329 intptr = &options->afs_token_passing;
330 goto parse_flag;
331#endif
332
333 case oFallBackToRsh:

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

608 options->forward_agent = -1;
609 options->forward_x11 = -1;
610 options->gateway_ports = -1;
611 options->use_privileged_port = -1;
612 options->rhosts_authentication = -1;
613 options->rsa_authentication = -1;
614 options->skey_authentication = -1;
615#ifdef KRB4
308 goto parse_flag;
309
310 case oAFSTokenPassing:
311 intptr = &options->afs_token_passing;
312 goto parse_flag;
313#endif
314
315 case oFallBackToRsh:

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

590 options->forward_agent = -1;
591 options->forward_x11 = -1;
592 options->gateway_ports = -1;
593 options->use_privileged_port = -1;
594 options->rhosts_authentication = -1;
595 options->rsa_authentication = -1;
596 options->skey_authentication = -1;
597#ifdef KRB4
616 options->krb4_authentication = -1;
598 options->kerberos_authentication = -1;
617#endif
599#endif
618#ifdef KRB5
619 options->krb5_authentication = -1;
620 options->krb5_tgt_passing = -1;
621#endif /* KRB5 */
622#ifdef AFS
600#ifdef AFS
623 options->krb4_tgt_passing = -1;
601 options->kerberos_tgt_passing = -1;
624 options->afs_token_passing = -1;
625#endif
626 options->password_authentication = -1;
627 options->rhosts_rsa_authentication = -1;
628 options->fallback_to_rsh = -1;
629 options->use_rsh = -1;
630 options->batch_mode = -1;
631 options->check_host_ip = -1;

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

667 options->use_privileged_port = 1;
668 if (options->rhosts_authentication == -1)
669 options->rhosts_authentication = 1;
670 if (options->rsa_authentication == -1)
671 options->rsa_authentication = 1;
672 if (options->skey_authentication == -1)
673 options->skey_authentication = 0;
674#ifdef KRB4
602 options->afs_token_passing = -1;
603#endif
604 options->password_authentication = -1;
605 options->rhosts_rsa_authentication = -1;
606 options->fallback_to_rsh = -1;
607 options->use_rsh = -1;
608 options->batch_mode = -1;
609 options->check_host_ip = -1;

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

645 options->use_privileged_port = 1;
646 if (options->rhosts_authentication == -1)
647 options->rhosts_authentication = 1;
648 if (options->rsa_authentication == -1)
649 options->rsa_authentication = 1;
650 if (options->skey_authentication == -1)
651 options->skey_authentication = 0;
652#ifdef KRB4
675 if (options->krb4_authentication == -1)
676 options->krb4_authentication = 1;
653 if (options->kerberos_authentication == -1)
654 options->kerberos_authentication = 1;
677#endif /* KRB4 */
655#endif /* KRB4 */
678#ifdef KRB5
679 if (options->krb5_authentication == -1)
680 options->krb5_authentication = 1;
681 if (options->krb5_tgt_passing == -1)
682 options->krb5_tgt_passing = 1;
683#endif /* KRB5 */
684#ifdef AFS
656#ifdef AFS
685 if (options->krb4_tgt_passing == -1)
686 options->krb4_tgt_passing = 1;
657 if (options->kerberos_tgt_passing == -1)
658 options->kerberos_tgt_passing = 1;
687 if (options->afs_token_passing == -1)
688 options->afs_token_passing = 1;
689#endif /* AFS */
690 if (options->password_authentication == -1)
691 options->password_authentication = 1;
692 if (options->rhosts_rsa_authentication == -1)
693 options->rhosts_rsa_authentication = 1;
694 if (options->fallback_to_rsh == -1)
695 options->fallback_to_rsh = 1;
696 if (options->use_rsh == -1)
697 options->use_rsh = 0;
698 if (options->batch_mode == -1)
699 options->batch_mode = 0;
700 if (options->check_host_ip == -1)
659 if (options->afs_token_passing == -1)
660 options->afs_token_passing = 1;
661#endif /* AFS */
662 if (options->password_authentication == -1)
663 options->password_authentication = 1;
664 if (options->rhosts_rsa_authentication == -1)
665 options->rhosts_rsa_authentication = 1;
666 if (options->fallback_to_rsh == -1)
667 options->fallback_to_rsh = 1;
668 if (options->use_rsh == -1)
669 options->use_rsh = 0;
670 if (options->batch_mode == -1)
671 options->batch_mode = 0;
672 if (options->check_host_ip == -1)
701 options->check_host_ip = 0;
673 options->check_host_ip = 1;
702 if (options->strict_host_key_checking == -1)
703 options->strict_host_key_checking = 2; /* 2 is default */
704 if (options->compression == -1)
705 options->compression = 0;
706 if (options->keepalives == -1)
707 options->keepalives = 1;
708 if (options->compression_level == -1)
709 options->compression_level = 6;

--- 27 unchanged lines hidden ---
674 if (options->strict_host_key_checking == -1)
675 options->strict_host_key_checking = 2; /* 2 is default */
676 if (options->compression == -1)
677 options->compression = 0;
678 if (options->keepalives == -1)
679 options->keepalives = 1;
680 if (options->compression_level == -1)
681 options->compression_level = 6;

--- 27 unchanged lines hidden ---