version 1.65, 2001/06/23 03:04:43 |
version 1.66, 2001/06/23 15:12:17 |
|
|
|
|
/* protocol */ |
/* protocol */ |
|
|
void input_service_request(int type, int plen, void *ctxt); |
static void input_service_request(int, int, void *); |
void input_userauth_request(int type, int plen, void *ctxt); |
static void input_userauth_request(int, int, void *); |
void protocol_error(int type, int plen, void *ctxt); |
static void protocol_error(int, int, void *); |
|
|
/* helper */ |
/* helper */ |
Authmethod *authmethod_lookup(const char *name); |
static Authmethod *authmethod_lookup(const char *); |
char *authmethods_get(void); |
char *authmethods_get(void); |
int user_key_allowed(struct passwd *pw, Key *key); |
static int user_key_allowed(struct passwd *, Key *); |
int |
static int hostbased_key_allowed(struct passwd *, const char *, char *, Key *); |
hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, |
|
Key *key); |
|
|
|
/* auth */ |
/* auth */ |
void userauth_banner(void); |
static void userauth_banner(void); |
void userauth_reply(Authctxt *authctxt, int authenticated); |
static int userauth_none(Authctxt *); |
int userauth_none(Authctxt *authctxt); |
static int userauth_passwd(Authctxt *); |
int userauth_passwd(Authctxt *authctxt); |
static int userauth_pubkey(Authctxt *); |
int userauth_pubkey(Authctxt *authctxt); |
static int userauth_hostbased(Authctxt *); |
int userauth_hostbased(Authctxt *authctxt); |
static int userauth_kbdint(Authctxt *); |
int userauth_kbdint(Authctxt *authctxt); |
|
|
|
Authmethod authmethods[] = { |
Authmethod authmethods[] = { |
{"none", |
{"none", |
|
|
do_authenticated(authctxt); |
do_authenticated(authctxt); |
} |
} |
|
|
void |
static void |
protocol_error(int type, int plen, void *ctxt) |
protocol_error(int type, int plen, void *ctxt) |
{ |
{ |
log("auth: protocol error: type %d plen %d", type, plen); |
log("auth: protocol error: type %d plen %d", type, plen); |
|
|
packet_write_wait(); |
packet_write_wait(); |
} |
} |
|
|
void |
static void |
input_service_request(int type, int plen, void *ctxt) |
input_service_request(int type, int plen, void *ctxt) |
{ |
{ |
Authctxt *authctxt = ctxt; |
Authctxt *authctxt = ctxt; |
|
|
xfree(service); |
xfree(service); |
} |
} |
|
|
void |
static void |
input_userauth_request(int type, int plen, void *ctxt) |
input_userauth_request(int type, int plen, void *ctxt) |
{ |
{ |
Authctxt *authctxt = ctxt; |
Authctxt *authctxt = ctxt; |
|
|
} |
} |
} |
} |
|
|
void |
static void |
userauth_banner(void) |
userauth_banner(void) |
{ |
{ |
struct stat st; |
struct stat st; |
|
|
return; |
return; |
} |
} |
|
|
int |
static int |
userauth_none(Authctxt *authctxt) |
userauth_none(Authctxt *authctxt) |
{ |
{ |
/* disable method "none", only allowed one time */ |
/* disable method "none", only allowed one time */ |
|
|
return authctxt->valid ? auth_password(authctxt, "") : 0; |
return authctxt->valid ? auth_password(authctxt, "") : 0; |
} |
} |
|
|
int |
static int |
userauth_passwd(Authctxt *authctxt) |
userauth_passwd(Authctxt *authctxt) |
{ |
{ |
char *password; |
char *password; |
|
|
return authenticated; |
return authenticated; |
} |
} |
|
|
int |
static int |
userauth_kbdint(Authctxt *authctxt) |
userauth_kbdint(Authctxt *authctxt) |
{ |
{ |
int authenticated = 0; |
int authenticated = 0; |
|
|
return authenticated; |
return authenticated; |
} |
} |
|
|
int |
static int |
userauth_pubkey(Authctxt *authctxt) |
userauth_pubkey(Authctxt *authctxt) |
{ |
{ |
Buffer b; |
Buffer b; |
|
|
return authenticated; |
return authenticated; |
} |
} |
|
|
int |
static int |
userauth_hostbased(Authctxt *authctxt) |
userauth_hostbased(Authctxt *authctxt) |
{ |
{ |
Buffer b; |
Buffer b; |
|
|
return list; |
return list; |
} |
} |
|
|
Authmethod * |
static Authmethod * |
authmethod_lookup(const char *name) |
authmethod_lookup(const char *name) |
{ |
{ |
Authmethod *method = NULL; |
Authmethod *method = NULL; |
|
|
} |
} |
|
|
/* return 1 if user allows given key */ |
/* return 1 if user allows given key */ |
int |
static int |
user_key_allowed2(struct passwd *pw, Key *key, char *file) |
user_key_allowed2(struct passwd *pw, Key *key, char *file) |
{ |
{ |
char line[8192]; |
char line[8192]; |
|
|
} |
} |
|
|
/* check whether given key is in .ssh/authorized_keys* */ |
/* check whether given key is in .ssh/authorized_keys* */ |
int |
static int |
user_key_allowed(struct passwd *pw, Key *key) |
user_key_allowed(struct passwd *pw, Key *key) |
{ |
{ |
int success; |
int success; |
|
|
} |
} |
|
|
/* return 1 if given hostkey is allowed */ |
/* return 1 if given hostkey is allowed */ |
int |
static int |
hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, |
hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, |
Key *key) |
Key *key) |
{ |
{ |