version 1.2, 2000/04/06 08:55:22 |
version 1.3, 2000/04/14 10:09:14 |
|
|
unsigned int len; |
unsigned int len; |
int accept = 0; |
int accept = 0; |
char *service = packet_get_string(&len); |
char *service = packet_get_string(&len); |
|
packet_done(); |
|
|
if (strcmp(service, "ssh-userauth") == 0) { |
if (strcmp(service, "ssh-userauth") == 0) { |
if (!userauth_success) { |
if (!userauth_success) { |
|
|
pw = auth_set_user(user, service); |
pw = auth_set_user(user, service); |
if (pw && strcmp(service, "ssh-connection")==0) { |
if (pw && strcmp(service, "ssh-connection")==0) { |
if (strcmp(method, "none") == 0 && try == 1) { |
if (strcmp(method, "none") == 0 && try == 1) { |
|
packet_done(); |
authenticated = auth_password(pw, ""); |
authenticated = auth_password(pw, ""); |
} else if (strcmp(method, "password") == 0) { |
} else if (strcmp(method, "password") == 0) { |
char *password; |
char *password; |
|
|
if (c) |
if (c) |
debug("password change not supported"); |
debug("password change not supported"); |
password = packet_get_string(&len); |
password = packet_get_string(&len); |
|
packet_done(); |
authenticated = auth_password(pw, password); |
authenticated = auth_password(pw, password); |
memset(password, 0, len); |
memset(password, 0, len); |
xfree(password); |
xfree(password); |
} else if (strcmp(method, "publickey") == 0) { |
} else if (strcmp(method, "publickey") == 0) { |
/* XXX TODO */ |
/* XXX TODO */ |
char *pkalg; |
char *pkalg, *pkblob, *sig; |
char *pkblob; |
int have_sig = packet_get_char(); |
c = packet_get_char(); |
|
pkalg = packet_get_string(&len); |
pkalg = packet_get_string(&len); |
pkblob = packet_get_string(&len); |
pkblob = packet_get_string(&len); |
|
if (have_sig) { |
|
sig = packet_get_string(&len); |
|
/* test for correct signature */ |
|
packet_done(); |
|
xfree(sig); |
|
} else { |
|
packet_done(); |
|
/* test whether pkalg/pkblob are acceptable */ |
|
} |
xfree(pkalg); |
xfree(pkalg); |
xfree(pkblob); |
xfree(pkblob); |
} |
} |
|
|
if (authenticated) { |
if (authenticated) { |
/* turn off userauth */ |
/* turn off userauth */ |
dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &protocol_error); |
dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &protocol_error); |
/* success! */ |
|
packet_start(SSH2_MSG_USERAUTH_SUCCESS); |
packet_start(SSH2_MSG_USERAUTH_SUCCESS); |
packet_send(); |
packet_send(); |
packet_write_wait(); |
packet_write_wait(); |