]> andersk Git - gssapi-openssh.git/blob - openssh/ssh.h
port to OpenSSH 3.1p1
[gssapi-openssh.git] / openssh / ssh.h
1 /*      $OpenBSD: ssh.h,v 1.64 2002/03/04 17:27:39 stevesk Exp $        */
2
3 /*
4  * Author: Tatu Ylonen <ylo@cs.hut.fi>
5  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6  *                    All rights reserved
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 #ifndef SSH_H
16 #define SSH_H
17
18 #include <netinet/in.h> /* For struct sockaddr_in */
19 #include <pwd.h> /* For struct pw */
20 #include <stdarg.h> /* For va_list */
21 #include <syslog.h> /* For LOG_AUTH and friends */
22 #include <sys/socket.h> /* For struct sockaddr_storage */
23 #include "openbsd-compat/fake-socket.h" /* For struct sockaddr_storage */
24 #ifdef HAVE_SYS_SELECT_H
25 # include <sys/select.h>
26 #endif
27
28 /* Cipher used for encrypting authentication files. */
29 #define SSH_AUTHFILE_CIPHER     SSH_CIPHER_3DES
30
31 /* Default port number. */
32 #define SSH_DEFAULT_PORT        22
33
34 /* Maximum number of TCP/IP ports forwarded per direction. */
35 #define SSH_MAX_FORWARDS_PER_DIRECTION  100
36
37 /*
38  * Maximum number of RSA authentication identity files that can be specified
39  * in configuration files or on the command line.
40  */
41 #define SSH_MAX_IDENTITY_FILES          100
42
43 /*
44  * Major protocol version.  Different version indicates major incompatiblity
45  * that prevents communication.
46  *
47  * Minor protocol version.  Different version indicates minor incompatibility
48  * that does not prevent interoperation.
49  */
50 #define PROTOCOL_MAJOR_1        1
51 #define PROTOCOL_MINOR_1        5
52
53 /* We support both SSH1 and SSH2 */
54 #define PROTOCOL_MAJOR_2        2
55 #define PROTOCOL_MINOR_2        0
56
57 /*
58  * Name for the service.  The port named by this service overrides the
59  * default port if present.
60  */
61 #define SSH_SERVICE_NAME        "ssh"
62
63 #if defined(USE_PAM) && !defined(SSHD_PAM_SERVICE)
64 # define SSHD_PAM_SERVICE       __progname
65 #endif
66
67 /*modified by binhe*/
68 #ifdef GSSAPI
69 /*------------ GSSAPI-related functions -----------------------*/
70
71 #include <gssapi.h>
72 /*
73  * Given a target account, and source host, perform GSSAPI authentication
74  * and authorization. Returns 1 on success, 0 on failure. On success fills
75  * in client_name with the GSSAPI identity of the user.
76  */
77 int auth_gssapi(const char *target_account,
78                 const char *source_host,
79                 gss_buffer_desc *client_name);
80
81 /*
82  * The userstring sent by the client may contain a GSSAPI identity which
83  * the server can use to determine the target account. This function
84  * parses the userstring and does the local account determination,
85  * if needed.
86  */
87 char *
88 gssapi_parse_userstring(char *username);
89
90 /*
91  * Change the ownership of all delegated credentials to the user.
92  * Returns 0 on success, non-zero on error.
93  */
94 int
95 gssapi_chown_delegation(uid_t uid, gid_t gid);
96
97 /*
98  * Remove the forwarded proxy credentials
99  */
100 void
101 gssapi_remove_delegation(void);
102
103 /*
104  * Clean our environment on startup. This means removing any environment
105  * strings that might inadvertantly been in root's environment and
106  * could cause serious security problems if we think we set them.
107  */
108 void
109 gssapi_clean_env(void);
110
111 /*
112  * Set up our environment for GSSAPI authentication
113  */
114 void
115 gssapi_setup_env(void);
116
117 /*
118  * Fix up our environment after GSSAPI authentication
119  */
120 int
121 gssapi_fix_env(void);
122
123 /*
124  * Pass all the GSSAPI environment variables to the child.
125  */
126 void
127 gssapi_child_set_env(char ***p_env,
128                      unsigned int *p_envsize);
129
130 /*
131  * A string containing the version of the GSSAPI patch applied
132  */
133 #define GSSAPI_PATCH_VERSION    "GSSAPI_PATCH FOR OPENSSH-3.0.2p1"
134
135 #ifndef GSSAPI_SERVICE_NAME
136 #define GSSAPI_SERVICE_NAME             "host"
137 #endif /* GSSAPI_SERVICE_NAME */
138
139 #ifndef GSSAPI_SERVICE_NAME_FORMAT
140 #define GSSAPI_SERVICE_NAME_FORMAT      "%s@%s"         /* host@fqdn */
141 #endif /* GSSAPI_SERVICE_NAME_FORMAT */
142
143 /* String to send if we don't have a valid hash of sshd keys */
144 #define GSSAPI_NO_HASH_STRING           "GSSAPI_NO_HASH"
145 #endif /* GSSAPI */
146 /*end of modification*/
147
148 /*
149  * Name of the environment variable containing the pathname of the
150  * authentication socket.
151  */
152 #define SSH_AGENTPID_ENV_NAME   "SSH_AGENT_PID"
153
154 /*
155  * Name of the environment variable containing the pathname of the
156  * authentication socket.
157  */
158 #define SSH_AUTHSOCKET_ENV_NAME "SSH_AUTH_SOCK"
159
160 /*
161  * Environment variable for overwriting the default location of askpass
162  */
163 #define SSH_ASKPASS_ENV         "SSH_ASKPASS"
164
165 /*
166  * Force host key length and server key length to differ by at least this
167  * many bits.  This is to make double encryption with rsaref work.
168  */
169 #define SSH_KEY_BITS_RESERVED           128
170
171 /*
172  * Length of the session key in bytes.  (Specified as 256 bits in the
173  * protocol.)
174  */
175 #define SSH_SESSION_KEY_LENGTH          32
176
177 /* Name of Kerberos service for SSH to use. */
178 #define KRB4_SERVICE_NAME               "rcmd"
179
180 /* Used to identify ``EscapeChar none'' */
181 #define SSH_ESCAPECHAR_NONE             -2
182
183 #endif                          /* SSH_H */
This page took 0.100729 seconds and 5 git commands to generate.