version 1.6, 2002/07/03 09:55:38 |
version 1.7, 2002/07/03 14:21:05 |
|
|
|
|
#include "log.h" |
#include "log.h" |
#include "key.h" |
#include "key.h" |
|
#include "ssh.h" |
#include "ssh2.h" |
#include "ssh2.h" |
#include "misc.h" |
#include "misc.h" |
#include "xmalloc.h" |
#include "xmalloc.h" |
|
|
#include "msg.h" |
#include "msg.h" |
#include "canohost.h" |
#include "canohost.h" |
#include "pathnames.h" |
#include "pathnames.h" |
|
#include "readconf.h" |
|
|
|
uid_t original_real_uid; /* XXX readconf.c needs this */ |
|
|
static int |
static int |
valid_request(struct passwd *pw, char *host, Key **ret, u_char *data, |
valid_request(struct passwd *pw, char *host, Key **ret, u_char *data, |
u_int datalen) |
u_int datalen) |
|
|
main(int argc, char **argv) |
main(int argc, char **argv) |
{ |
{ |
Buffer b; |
Buffer b; |
|
Options options; |
Key *keys[2], *key; |
Key *keys[2], *key; |
struct passwd *pw; |
struct passwd *pw; |
int key_fd[2], i, found, version = 2, fd; |
int key_fd[2], i, found, version = 2, fd; |
|
|
#ifdef DEBUG_SSH_KEYSIGN |
#ifdef DEBUG_SSH_KEYSIGN |
log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0); |
log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0); |
#endif |
#endif |
|
|
|
/* verify that ssh-keysign is enabled by the admin */ |
|
original_real_uid = getuid(); /* XXX readconf.c needs this */ |
|
initialize_options(&options); |
|
(void)read_config_file(_PATH_HOST_CONFIG_FILE, "", &options); |
|
fill_default_options(&options); |
|
if (options.hostbased_authentication != 1) |
|
fatal("Hostbased authentication not enabled in %s", |
|
_PATH_HOST_CONFIG_FILE); |
|
|
if (key_fd[0] == -1 && key_fd[1] == -1) |
if (key_fd[0] == -1 && key_fd[1] == -1) |
fatal("could not open any host key"); |
fatal("could not open any host key"); |