| 1916 |
|
|
| 1917 |
void SSH2_dispatch_add_message(unsigned char message) |
void SSH2_dispatch_add_message(unsigned char message) |
| 1918 |
{ |
{ |
| 1919 |
|
int i; |
| 1920 |
|
|
| 1921 |
if (handle_message_count >= HANDLE_MESSAGE_MAX) { |
if (handle_message_count >= HANDLE_MESSAGE_MAX) { |
| 1922 |
// TODO: error check |
// TODO: error check |
| 1923 |
return; |
return; |
| 1924 |
} |
} |
| 1925 |
|
|
| 1926 |
|
// すでに登録されているメッセージは追加しない |
| 1927 |
|
for (i=0; i<handle_message_count; i++) { |
| 1928 |
|
if (handle_messages[i] == message) { |
| 1929 |
|
return; |
| 1930 |
|
} |
| 1931 |
|
} |
| 1932 |
|
|
| 1933 |
handle_messages[handle_message_count++] = message; |
handle_messages[handle_message_count++] = message; |
| 1934 |
} |
} |
| 1935 |
|
|
| 6385 |
// (2007.10.26 maya) |
// (2007.10.26 maya) |
| 6386 |
if (pvar->userauth_retry_count > 0 |
if (pvar->userauth_retry_count > 0 |
| 6387 |
|| pvar->tryed_ssh2_authlist == TRUE) { |
|| pvar->tryed_ssh2_authlist == TRUE) { |
| 6388 |
return handle_SSH2_authrequest(pvar); |
return do_SSH2_authrequest(pvar); |
| 6389 |
/* NOT REACHED */ |
/* NOT REACHED */ |
| 6390 |
} |
} |
| 6391 |
|
|
| 6614 |
_snprintf(tmp, sizeof(tmp), "SSH2_MSG_SERVICE_ACCEPT is received. service name=%s", s); |
_snprintf(tmp, sizeof(tmp), "SSH2_MSG_SERVICE_ACCEPT is received. service name=%s", s); |
| 6615 |
notify_verbose_message(pvar, tmp, LOG_LEVEL_VERBOSE); |
notify_verbose_message(pvar, tmp, LOG_LEVEL_VERBOSE); |
| 6616 |
|
|
| 6617 |
|
SSH2_dispatch_init(5); |
| 6618 |
|
SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround (2005.3.5 yutaka) |
| 6619 |
|
if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) { |
| 6620 |
|
// keyboard-interactive method |
| 6621 |
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_INFO_REQUEST); |
| 6622 |
|
} |
| 6623 |
|
else if (pvar->auth_state.cur_cred.method == SSH_AUTH_PAGEANT) { |
| 6624 |
|
// Pageant |
| 6625 |
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_PK_OK); |
| 6626 |
|
} |
| 6627 |
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_SUCCESS); |
| 6628 |
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_FAILURE); |
| 6629 |
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_BANNER); |
| 6630 |
|
SSH2_dispatch_add_message(SSH2_MSG_DEBUG); // support for authorized_keys command (2006.2.23 yutaka) |
| 6631 |
|
|
| 6632 |
return do_SSH2_authrequest(pvar); |
return do_SSH2_authrequest(pvar); |
| 6633 |
} |
} |
| 6634 |
|
|
| 6690 |
s = ""; // submethods |
s = ""; // submethods |
| 6691 |
buffer_put_string(msg, s, strlen(s)); |
buffer_put_string(msg, s, strlen(s)); |
| 6692 |
|
|
| 6693 |
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_INFO_REQUEST); |
| 6694 |
|
|
| 6695 |
} else if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) { // 公開鍵認証 |
} else if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) { // 公開鍵認証 |
| 6696 |
buffer_t *signbuf = NULL; |
buffer_t *signbuf = NULL; |
| 6697 |
buffer_t *blob = NULL; |
buffer_t *blob = NULL; |
| 6781 |
|
|
| 6782 |
pvar->pageant_keycurrent++; |
pvar->pageant_keycurrent++; |
| 6783 |
|
|
| 6784 |
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_PK_OK); |
| 6785 |
|
|
| 6786 |
} else { |
} else { |
| 6787 |
goto error; |
goto error; |
| 6788 |
|
|
| 6796 |
finish_send_packet(pvar); |
finish_send_packet(pvar); |
| 6797 |
buffer_free(msg); |
buffer_free(msg); |
| 6798 |
|
|
|
SSH2_dispatch_init(5); |
|
|
SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround (2005.3.5 yutaka) |
|
|
if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) { |
|
|
// keyboard-interactive method |
|
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_INFO_REQUEST); |
|
|
} |
|
|
else if (pvar->auth_state.cur_cred.method == SSH_AUTH_PAGEANT) { |
|
|
// Pageant |
|
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_PK_OK); |
|
|
} |
|
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_SUCCESS); |
|
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_FAILURE); |
|
|
SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_BANNER); |
|
|
SSH2_dispatch_add_message(SSH2_MSG_DEBUG); // support for authorized_keys command (2006.2.23 yutaka) |
|
|
|
|
| 6799 |
{ |
{ |
| 6800 |
char buf[128]; |
char buf[128]; |
| 6801 |
_snprintf_s(buf, sizeof(buf), _TRUNCATE, |
_snprintf_s(buf, sizeof(buf), _TRUNCATE, |