diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-12 15:19:27 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-12 15:19:27 +1100 |
commit | 6d7b2cd1a32efa2a40c97361065d357a2e60b716 (patch) | |
tree | 9c34abc2723760ce00b6f3867d7e0cfbd6a7424e /ssh.h | |
parent | b5f8927a7e3f25cef4c66603a780176e1b9f6082 (diff) |
- Merged yet more changes from OpenBSD CVS
- [auth-rh-rsa.c auth-rhosts.c auth-rsa.c channels.c clientloop.c]
[ssh.c ssh.h sshconnect.c sshd.c]
make all access to options via 'extern Options options'
and 'extern ServerOptions options' respectively;
options are no longer passed as arguments:
* make options handling more consistent
* remove #include "readconf.h" from ssh.h
* readconf.h is only included if necessary
- [mpaux.c] clear temp buffer
- [servconf.c] print _all_ bad options found in configfile
Diffstat (limited to 'ssh.h')
-rw-r--r-- | ssh.h | 122 |
1 files changed, 57 insertions, 65 deletions
@@ -13,7 +13,7 @@ Generic header file for ssh. | |||
13 | 13 | ||
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* RCSID("$Id: ssh.h,v 1.11 1999/11/12 00:33:04 damien Exp $"); */ | 16 | /* RCSID("$Id: ssh.h,v 1.12 1999/11/12 04:19:27 damien Exp $"); */ |
17 | 17 | ||
18 | #ifndef SSH_H | 18 | #ifndef SSH_H |
19 | #define SSH_H | 19 | #define SSH_H |
@@ -221,60 +221,6 @@ only by root, whereas ssh_config should be world-readable. */ | |||
221 | #define SSH_CMSG_HAVE_KERBEROS_TGT 44 /* credentials (s) */ | 221 | #define SSH_CMSG_HAVE_KERBEROS_TGT 44 /* credentials (s) */ |
222 | #define SSH_CMSG_HAVE_AFS_TOKEN 65 /* token (s) */ | 222 | #define SSH_CMSG_HAVE_AFS_TOKEN 65 /* token (s) */ |
223 | 223 | ||
224 | |||
225 | /*------------ Definitions for logging. -----------------------*/ | ||
226 | |||
227 | /* Supported syslog facilities and levels. */ | ||
228 | typedef enum | ||
229 | { | ||
230 | SYSLOG_FACILITY_DAEMON, | ||
231 | SYSLOG_FACILITY_USER, | ||
232 | SYSLOG_FACILITY_AUTH, | ||
233 | SYSLOG_FACILITY_LOCAL0, | ||
234 | SYSLOG_FACILITY_LOCAL1, | ||
235 | SYSLOG_FACILITY_LOCAL2, | ||
236 | SYSLOG_FACILITY_LOCAL3, | ||
237 | SYSLOG_FACILITY_LOCAL4, | ||
238 | SYSLOG_FACILITY_LOCAL5, | ||
239 | SYSLOG_FACILITY_LOCAL6, | ||
240 | SYSLOG_FACILITY_LOCAL7 | ||
241 | } SyslogFacility; | ||
242 | |||
243 | typedef enum | ||
244 | { | ||
245 | SYSLOG_LEVEL_QUIET, | ||
246 | SYSLOG_LEVEL_FATAL, | ||
247 | SYSLOG_LEVEL_ERROR, | ||
248 | SYSLOG_LEVEL_INFO, | ||
249 | SYSLOG_LEVEL_CHAT, | ||
250 | SYSLOG_LEVEL_DEBUG | ||
251 | } LogLevel; | ||
252 | |||
253 | /* Initializes logging. */ | ||
254 | void log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr); | ||
255 | |||
256 | /* Logging implementation, depending on server or client */ | ||
257 | void do_log(LogLevel level, const char *fmt, va_list args); | ||
258 | |||
259 | /* Output a message to syslog or stderr */ | ||
260 | void fatal(const char *fmt, ...); | ||
261 | void error(const char *fmt, ...); | ||
262 | void log(const char *fmt, ...); | ||
263 | void chat(const char *fmt, ...); | ||
264 | void debug(const char *fmt, ...); | ||
265 | |||
266 | /* same as fatal() but w/o logging */ | ||
267 | void fatal_cleanup(void); | ||
268 | |||
269 | /* Registers a cleanup function to be called by fatal()/fatal_cleanup() before exiting. | ||
270 | It is permissible to call fatal_remove_cleanup for the function itself | ||
271 | from the function. */ | ||
272 | void fatal_add_cleanup(void (*proc)(void *context), void *context); | ||
273 | |||
274 | /* Removes a cleanup function to be called at fatal(). */ | ||
275 | void fatal_remove_cleanup(void (*proc)(void *context), void *context); | ||
276 | |||
277 | |||
278 | /*------------ definitions for login.c -------------*/ | 224 | /*------------ definitions for login.c -------------*/ |
279 | 225 | ||
280 | /* Returns the time when the user last logged in. Returns 0 if the | 226 | /* Returns the time when the user last logged in. Returns 0 if the |
@@ -314,21 +260,15 @@ int ssh_connect(const char *host, struct sockaddr_in *hostaddr, | |||
314 | This initializes the random state, and leaves it initialized (it will also | 260 | This initializes the random state, and leaves it initialized (it will also |
315 | have references from the packet module). */ | 261 | have references from the packet module). */ |
316 | 262 | ||
317 | /* for Options */ | ||
318 | #include "readconf.h" | ||
319 | |||
320 | void ssh_login(int host_key_valid, RSA *host_key, const char *host, | 263 | void ssh_login(int host_key_valid, RSA *host_key, const char *host, |
321 | struct sockaddr_in *hostaddr, Options *options, | 264 | struct sockaddr_in *hostaddr, uid_t original_real_uid); |
322 | uid_t original_real_uid); | ||
323 | 265 | ||
324 | /*------------ Definitions for various authentication methods. -------*/ | 266 | /*------------ Definitions for various authentication methods. -------*/ |
325 | 267 | ||
326 | /* Tries to authenticate the user using the .rhosts file. Returns true if | 268 | /* Tries to authenticate the user using the .rhosts file. Returns true if |
327 | authentication succeeds. If ignore_rhosts is non-zero, this will not | 269 | authentication succeeds. If ignore_rhosts is non-zero, this will not |
328 | consider .rhosts and .shosts (/etc/hosts.equiv will still be used). | 270 | consider .rhosts and .shosts (/etc/hosts.equiv will still be used). */ |
329 | If strict_modes is true, checks ownership and modes of .rhosts/.shosts. */ | 271 | int auth_rhosts(struct passwd *pw, const char *client_user); |
330 | int auth_rhosts(struct passwd *pw, const char *client_user, | ||
331 | int ignore_rhosts, int strict_modes); | ||
332 | 272 | ||
333 | /* Tries to authenticate the user using the .rhosts file and the host using | 273 | /* Tries to authenticate the user using the .rhosts file and the host using |
334 | its host key. Returns true if authentication succeeds. */ | 274 | its host key. Returns true if authentication succeeds. */ |
@@ -343,7 +283,7 @@ int auth_password(struct passwd *pw, const char *password); | |||
343 | /* Performs the RSA authentication dialog with the client. This returns | 283 | /* Performs the RSA authentication dialog with the client. This returns |
344 | 0 if the client could not be authenticated, and 1 if authentication was | 284 | 0 if the client could not be authenticated, and 1 if authentication was |
345 | successful. This may exit if there is a serious protocol violation. */ | 285 | successful. This may exit if there is a serious protocol violation. */ |
346 | int auth_rsa(struct passwd *pw, BIGNUM *client_n, int strict_modes); | 286 | int auth_rsa(struct passwd *pw, BIGNUM *client_n); |
347 | 287 | ||
348 | /* Parses an RSA key (number of bits, e, n) from a string. Moves the pointer | 288 | /* Parses an RSA key (number of bits, e, n) from a string. Moves the pointer |
349 | over the key. Skips any whitespace at the beginning and at end. */ | 289 | over the key. Skips any whitespace at the beginning and at end. */ |
@@ -421,6 +361,58 @@ int load_public_key(const char *filename, RSA *pub, | |||
421 | int load_private_key(const char *filename, const char *passphrase, | 361 | int load_private_key(const char *filename, const char *passphrase, |
422 | RSA *private_key, char **comment_return); | 362 | RSA *private_key, char **comment_return); |
423 | 363 | ||
364 | /*------------ Definitions for logging. -----------------------*/ | ||
365 | |||
366 | /* Supported syslog facilities and levels. */ | ||
367 | typedef enum | ||
368 | { | ||
369 | SYSLOG_FACILITY_DAEMON, | ||
370 | SYSLOG_FACILITY_USER, | ||
371 | SYSLOG_FACILITY_AUTH, | ||
372 | SYSLOG_FACILITY_LOCAL0, | ||
373 | SYSLOG_FACILITY_LOCAL1, | ||
374 | SYSLOG_FACILITY_LOCAL2, | ||
375 | SYSLOG_FACILITY_LOCAL3, | ||
376 | SYSLOG_FACILITY_LOCAL4, | ||
377 | SYSLOG_FACILITY_LOCAL5, | ||
378 | SYSLOG_FACILITY_LOCAL6, | ||
379 | SYSLOG_FACILITY_LOCAL7 | ||
380 | } SyslogFacility; | ||
381 | |||
382 | typedef enum | ||
383 | { | ||
384 | SYSLOG_LEVEL_QUIET, | ||
385 | SYSLOG_LEVEL_FATAL, | ||
386 | SYSLOG_LEVEL_ERROR, | ||
387 | SYSLOG_LEVEL_INFO, | ||
388 | SYSLOG_LEVEL_CHAT, | ||
389 | SYSLOG_LEVEL_DEBUG | ||
390 | } LogLevel; | ||
391 | |||
392 | /* Initializes logging. */ | ||
393 | void log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr); | ||
394 | |||
395 | /* Logging implementation, depending on server or client */ | ||
396 | void do_log(LogLevel level, const char *fmt, va_list args); | ||
397 | |||
398 | /* Output a message to syslog or stderr */ | ||
399 | void fatal(const char *fmt, ...); | ||
400 | void error(const char *fmt, ...); | ||
401 | void log(const char *fmt, ...); | ||
402 | void chat(const char *fmt, ...); | ||
403 | void debug(const char *fmt, ...); | ||
404 | |||
405 | /* same as fatal() but w/o logging */ | ||
406 | void fatal_cleanup(void); | ||
407 | |||
408 | /* Registers a cleanup function to be called by fatal()/fatal_cleanup() before exiting. | ||
409 | It is permissible to call fatal_remove_cleanup for the function itself | ||
410 | from the function. */ | ||
411 | void fatal_add_cleanup(void (*proc)(void *context), void *context); | ||
412 | |||
413 | /* Removes a cleanup function to be called at fatal(). */ | ||
414 | void fatal_remove_cleanup(void (*proc)(void *context), void *context); | ||
415 | |||
424 | /*---------------- definitions for channels ------------------*/ | 416 | /*---------------- definitions for channels ------------------*/ |
425 | 417 | ||
426 | /* Sets specific protocol options. */ | 418 | /* Sets specific protocol options. */ |