| 61 |
}; |
}; |
| 62 |
|
|
| 63 |
static LRESULT CALLBACK password_wnd_proc(HWND control, UINT msg, |
static LRESULT CALLBACK password_wnd_proc(HWND control, UINT msg, |
| 64 |
WPARAM wParam, LPARAM lParam) |
WPARAM wParam, LPARAM lParam) |
| 65 |
{ |
{ |
| 66 |
switch (msg) { |
switch (msg) { |
| 67 |
case WM_CHAR: |
case WM_CHAR: |
| 69 |
char chars[] = { (char) wParam, 0 }; |
char chars[] = { (char) wParam, 0 }; |
| 70 |
|
|
| 71 |
SendMessage(control, EM_REPLACESEL, (WPARAM) TRUE, |
SendMessage(control, EM_REPLACESEL, (WPARAM) TRUE, |
| 72 |
(LPARAM) (char FAR *) chars); |
(LPARAM) (char FAR *) chars); |
| 73 |
return 0; |
return 0; |
| 74 |
} |
} |
| 75 |
} |
} |
| 76 |
|
|
| 77 |
return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA), |
return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA), |
| 78 |
control, msg, wParam, lParam); |
control, msg, wParam, lParam); |
| 79 |
} |
} |
| 80 |
|
|
| 81 |
static void init_password_control(HWND dlg) |
static void init_password_control(HWND dlg) |
| 83 |
HWND passwordControl = GetDlgItem(dlg, IDC_SSHPASSWORD); |
HWND passwordControl = GetDlgItem(dlg, IDC_SSHPASSWORD); |
| 84 |
|
|
| 85 |
SetWindowLong(passwordControl, GWL_USERDATA, |
SetWindowLong(passwordControl, GWL_USERDATA, |
| 86 |
SetWindowLong(passwordControl, GWL_WNDPROC, |
SetWindowLong(passwordControl, GWL_WNDPROC, |
| 87 |
(LONG) password_wnd_proc)); |
(LONG) password_wnd_proc)); |
| 88 |
|
|
| 89 |
SetFocus(passwordControl); |
SetFocus(passwordControl); |
| 90 |
} |
} |
| 131 |
} |
} |
| 132 |
|
|
| 133 |
for (control = IDC_SSHUSEPASSWORD; control <= MAX_AUTH_CONTROL; |
for (control = IDC_SSHUSEPASSWORD; control <= MAX_AUTH_CONTROL; |
| 134 |
control++) { |
control++) { |
| 135 |
BOOL enabled = FALSE; |
BOOL enabled = FALSE; |
| 136 |
int method; |
int method; |
| 137 |
HWND item = GetDlgItem(dlg, control); |
HWND item = GetDlgItem(dlg, control); |
| 139 |
if (item != NULL) { |
if (item != NULL) { |
| 140 |
for (method = 0; method <= SSH_AUTH_MAX; method++) { |
for (method = 0; method <= SSH_AUTH_MAX; method++) { |
| 141 |
if (auth_types_to_control_IDs[method] == control |
if (auth_types_to_control_IDs[method] == control |
| 142 |
&& (supported_methods & (1 << method)) != 0) { |
&& (supported_methods & (1 << method)) != 0) { |
| 143 |
enabled = TRUE; |
enabled = TRUE; |
| 144 |
} |
} |
| 145 |
} |
} |
| 146 |
|
|
| 231 |
} |
} |
| 232 |
|
|
| 233 |
set_auth_options_status(dlg, |
set_auth_options_status(dlg, |
| 234 |
auth_types_to_control_IDs[default_method]); |
auth_types_to_control_IDs[default_method]); |
| 235 |
|
|
| 236 |
if (default_method == SSH_AUTH_TIS) { |
if (default_method == SSH_AUTH_TIS) { |
| 237 |
/* we disabled the password control, so fix the focus */ |
/* we disabled the password control, so fix the focus */ |
| 244 |
EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAMELABEL), FALSE); |
EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAMELABEL), FALSE); |
| 245 |
} else if (pvar->session_settings.DefaultUserName[0] != 0) { |
} else if (pvar->session_settings.DefaultUserName[0] != 0) { |
| 246 |
SetDlgItemText(dlg, IDC_SSHUSERNAME, |
SetDlgItemText(dlg, IDC_SSHUSERNAME, |
| 247 |
pvar->session_settings.DefaultUserName); |
pvar->session_settings.DefaultUserName); |
| 248 |
} else { |
} else { |
| 249 |
SetFocus(GetDlgItem(dlg, IDC_SSHUSERNAME)); |
SetFocus(GetDlgItem(dlg, IDC_SSHUSERNAME)); |
| 250 |
} |
} |
| 251 |
|
|
| 252 |
SetDlgItemText(dlg, IDC_RSAFILENAME, |
SetDlgItemText(dlg, IDC_RSAFILENAME, |
| 253 |
pvar->session_settings.DefaultRSAPrivateKeyFile); |
pvar->session_settings.DefaultRSAPrivateKeyFile); |
| 254 |
SetDlgItemText(dlg, IDC_HOSTRSAFILENAME, |
SetDlgItemText(dlg, IDC_HOSTRSAFILENAME, |
| 255 |
pvar->session_settings.DefaultRhostsHostPrivateKeyFile); |
pvar->session_settings.DefaultRhostsHostPrivateKeyFile); |
| 256 |
SetDlgItemText(dlg, IDC_LOCALUSERNAME, |
SetDlgItemText(dlg, IDC_LOCALUSERNAME, |
| 257 |
pvar->session_settings.DefaultRhostsLocalUserName); |
pvar->session_settings.DefaultRhostsLocalUserName); |
| 258 |
|
|
| 259 |
update_server_supported_types(pvar, dlg); |
update_server_supported_types(pvar, dlg); |
| 260 |
|
|
| 317 |
// 変更する。(2005.3.12 yutaka) |
// 変更する。(2005.3.12 yutaka) |
| 318 |
if (pvar->settings.ssh2_keyboard_interactive == 1) { |
if (pvar->settings.ssh2_keyboard_interactive == 1) { |
| 319 |
UTIL_get_lang_msg("DLG_AUTH_METHOD_PASSWORD_KBDINT", pvar, |
UTIL_get_lang_msg("DLG_AUTH_METHOD_PASSWORD_KBDINT", pvar, |
| 320 |
"Use p&lain password to log in (with keyboard-interactive)"); |
"Use p&lain password to log in (with keyboard-interactive)"); |
| 321 |
SetDlgItemText(dlg, IDC_SSHUSEPASSWORD, pvar->ts->UIMsg); |
SetDlgItemText(dlg, IDC_SSHUSEPASSWORD, pvar->ts->UIMsg); |
| 322 |
} |
} |
| 323 |
|
|
| 324 |
if (pvar->settings.ssh_protocol_version == 1) { |
if (pvar->settings.ssh_protocol_version == 1) { |
| 325 |
UTIL_get_lang_msg("DLG_AUTH_METHOD_CHALLENGE1", pvar, |
UTIL_get_lang_msg("DLG_AUTH_METHOD_CHALLENGE1", pvar, |
| 326 |
"Use challenge/response to log in(&TIS)"); |
"Use challenge/response to log in(&TIS)"); |
| 327 |
SetDlgItemText(dlg, IDC_SSHUSETIS, pvar->ts->UIMsg); |
SetDlgItemText(dlg, IDC_SSHUSETIS, pvar->ts->UIMsg); |
| 328 |
} else { |
} else { |
| 329 |
UTIL_get_lang_msg("DLG_AUTH_METHOD_CHALLENGE2", pvar, |
UTIL_get_lang_msg("DLG_AUTH_METHOD_CHALLENGE2", pvar, |
| 330 |
"Use &challenge/response to log in(keyboard-interactive)"); |
"Use &challenge/response to log in(keyboard-interactive)"); |
| 331 |
SetDlgItemText(dlg, IDC_SSHUSETIS, pvar->ts->UIMsg); |
SetDlgItemText(dlg, IDC_SSHUSETIS, pvar->ts->UIMsg); |
| 332 |
} |
} |
| 333 |
#endif |
#endif |
| 366 |
// フィルタの追加 (2004.12.19 yutaka) |
// フィルタの追加 (2004.12.19 yutaka) |
| 367 |
// 3ファイルフィルタの追加 (2005.4.26 yutaka) |
// 3ファイルフィルタの追加 (2005.4.26 yutaka) |
| 368 |
UTIL_get_lang_msg("FILEDLG_OPEN_PRIVATEKEY_FILTER", pvar, |
UTIL_get_lang_msg("FILEDLG_OPEN_PRIVATEKEY_FILTER", pvar, |
| 369 |
"identity files\\0identity;id_rsa;id_dsa\\0identity(RSA1)\\0identity\\0id_rsa(SSH2)\\0id_rsa\\0id_dsa(SSH2)\\0id_dsa\\0all(*.*)\\0*.*\\0\\0"); |
"identity files\\0identity;id_rsa;id_dsa\\0identity(RSA1)\\0identity\\0id_rsa(SSH2)\\0id_rsa\\0id_dsa(SSH2)\\0id_dsa\\0all(*.*)\\0*.*\\0\\0"); |
| 370 |
memcpy(filter, pvar->ts->UIMsg, sizeof(filter)); |
memcpy(filter, pvar->ts->UIMsg, sizeof(filter)); |
| 371 |
params.lpstrFilter = filter; |
params.lpstrFilter = filter; |
| 372 |
params.lpstrCustomFilter = NULL; |
params.lpstrCustomFilter = NULL; |
| 377 |
params.lpstrFileTitle = NULL; |
params.lpstrFileTitle = NULL; |
| 378 |
params.lpstrInitialDir = NULL; |
params.lpstrInitialDir = NULL; |
| 379 |
UTIL_get_lang_msg("FILEDLG_OPEN_PRIVATEKEY_TITLE", pvar, |
UTIL_get_lang_msg("FILEDLG_OPEN_PRIVATEKEY_TITLE", pvar, |
| 380 |
"Choose a file with the RSA/DSA private key"); |
"Choose a file with the RSA/DSA private key"); |
| 381 |
params.lpstrTitle = pvar->ts->UIMsg; |
params.lpstrTitle = pvar->ts->UIMsg; |
| 382 |
params.Flags = |
params.Flags = |
| 383 |
OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY; |
OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY; |
| 437 |
GetDlgItemText(dlg, file_ctl_ID, buf, sizeof(buf)); |
GetDlgItemText(dlg, file_ctl_ID, buf, sizeof(buf)); |
| 438 |
if (buf[0] == 0) { |
if (buf[0] == 0) { |
| 439 |
UTIL_get_lang_msg("MSG_KEYSPECIFY_ERROR", pvar, |
UTIL_get_lang_msg("MSG_KEYSPECIFY_ERROR", pvar, |
| 440 |
"You must specify a file containing the RSA/DSA private key."); |
"You must specify a file containing the RSA/DSA private key."); |
| 441 |
notify_nonfatal_error(pvar, pvar->ts->UIMsg); |
notify_nonfatal_error(pvar, pvar->ts->UIMsg); |
| 442 |
SetFocus(GetDlgItem(dlg, file_ctl_ID)); |
SetFocus(GetDlgItem(dlg, file_ctl_ID)); |
| 443 |
destroy_malloced_string(&password); |
destroy_malloced_string(&password); |
| 448 |
BOOL invalid_passphrase = FALSE; |
BOOL invalid_passphrase = FALSE; |
| 449 |
|
|
| 450 |
key_pair = KEYFILES_read_private_key(pvar, buf, password, |
key_pair = KEYFILES_read_private_key(pvar, buf, password, |
| 451 |
&invalid_passphrase, |
&invalid_passphrase, |
| 452 |
FALSE); |
FALSE); |
| 453 |
|
|
| 454 |
if (key_pair == NULL) { |
if (key_pair == NULL) { |
| 455 |
if (invalid_passphrase) { |
if (invalid_passphrase) { |
| 472 |
//GetCurrentDirectory(sizeof(errmsg), errmsg); |
//GetCurrentDirectory(sizeof(errmsg), errmsg); |
| 473 |
|
|
| 474 |
key_pair = read_SSH2_private_key(pvar, buf, password, |
key_pair = read_SSH2_private_key(pvar, buf, password, |
| 475 |
&invalid_passphrase, |
&invalid_passphrase, |
| 476 |
FALSE, |
FALSE, |
| 477 |
errmsg, |
errmsg, |
| 478 |
sizeof(errmsg) |
sizeof(errmsg) |
| 479 |
); |
); |
| 480 |
|
|
| 481 |
if (key_pair == NULL) { // read error |
if (key_pair == NULL) { // read error |
| 482 |
char buf[1024]; |
char buf[1024]; |
| 483 |
UTIL_get_lang_msg("MSG_READKEY_ERROR", pvar, |
UTIL_get_lang_msg("MSG_READKEY_ERROR", pvar, |
| 484 |
"read error SSH2 private key file\r\n%s"); |
"read error SSH2 private key file\r\n%s"); |
| 485 |
_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg, errmsg); |
_snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg, errmsg); |
| 486 |
notify_nonfatal_error(pvar, buf); |
notify_nonfatal_error(pvar, buf); |
| 487 |
// パスフレーズが鍵と一致しなかった場合はIDC_SSHPASSWORDにフォーカスを移す (2006.10.29 yasuhide) |
// パスフレーズが鍵と一致しなかった場合はIDC_SSHPASSWORDにフォーカスを移す (2006.10.29 yasuhide) |
| 530 |
if (method == SSH_AUTH_RHOSTS || method == SSH_AUTH_RHOSTS_RSA) { |
if (method == SSH_AUTH_RHOSTS || method == SSH_AUTH_RHOSTS_RSA) { |
| 531 |
if (pvar->session_settings.DefaultAuthMethod != SSH_AUTH_RHOSTS) { |
if (pvar->session_settings.DefaultAuthMethod != SSH_AUTH_RHOSTS) { |
| 532 |
UTIL_get_lang_msg("MSG_RHOSTS_NOTDEFAULT_ERROR", pvar, |
UTIL_get_lang_msg("MSG_RHOSTS_NOTDEFAULT_ERROR", pvar, |
| 533 |
"Rhosts authentication will probably fail because it was not " |
"Rhosts authentication will probably fail because it was not " |
| 534 |
"the default authentication method.\n" |
"the default authentication method.\n" |
| 535 |
"To use Rhosts authentication " |
"To use Rhosts authentication " |
| 536 |
"in TTSSH, you need to set it to be the default by restarting\n" |
"in TTSSH, you need to set it to be the default by restarting\n" |
| 537 |
"TTSSH and selecting \"SSH Authentication...\" from the Setup menu" |
"TTSSH and selecting \"SSH Authentication...\" from the Setup menu" |
| 538 |
"before connecting."); |
"before connecting."); |
| 539 |
notify_nonfatal_error(pvar, pvar->ts->UIMsg); |
notify_nonfatal_error(pvar, pvar->ts->UIMsg); |
| 540 |
} |
} |
| 541 |
|
|
| 545 |
pvar->auth_state.auth_dialog = NULL; |
pvar->auth_state.auth_dialog = NULL; |
| 546 |
|
|
| 547 |
GetDlgItemText(dlg, IDC_RSAFILENAME, |
GetDlgItemText(dlg, IDC_RSAFILENAME, |
| 548 |
pvar->session_settings.DefaultRSAPrivateKeyFile, |
pvar->session_settings.DefaultRSAPrivateKeyFile, |
| 549 |
sizeof(pvar->session_settings. |
sizeof(pvar->session_settings. |
| 550 |
DefaultRSAPrivateKeyFile)); |
DefaultRSAPrivateKeyFile)); |
| 551 |
GetDlgItemText(dlg, IDC_HOSTRSAFILENAME, |
GetDlgItemText(dlg, IDC_HOSTRSAFILENAME, |
| 552 |
pvar->session_settings.DefaultRhostsHostPrivateKeyFile, |
pvar->session_settings.DefaultRhostsHostPrivateKeyFile, |
| 553 |
sizeof(pvar->session_settings. |
sizeof(pvar->session_settings. |
| 554 |
DefaultRhostsHostPrivateKeyFile)); |
DefaultRhostsHostPrivateKeyFile)); |
| 555 |
GetDlgItemText(dlg, IDC_LOCALUSERNAME, |
GetDlgItemText(dlg, IDC_LOCALUSERNAME, |
| 556 |
pvar->session_settings.DefaultRhostsLocalUserName, |
pvar->session_settings.DefaultRhostsLocalUserName, |
| 557 |
sizeof(pvar->session_settings. |
sizeof(pvar->session_settings. |
| 558 |
DefaultRhostsLocalUserName)); |
DefaultRhostsLocalUserName)); |
| 559 |
|
|
| 560 |
if (SSHv1(pvar)) { |
if (SSHv1(pvar)) { |
| 561 |
SSH_notify_user_name(pvar); |
SSH_notify_user_name(pvar); |
| 566 |
} |
} |
| 567 |
|
|
| 568 |
EndDialog(dlg, 1); |
EndDialog(dlg, 1); |
| 569 |
if (DlgAuthFont != NULL) { |
if (DlgAuthFont != NULL) { |
| 570 |
DeleteObject(DlgAuthFont); |
DeleteObject(DlgAuthFont); |
| 571 |
} |
} |
| 572 |
|
|
| 573 |
return TRUE; |
return TRUE; |
| 574 |
} |
} |
| 575 |
|
|
| 576 |
static BOOL CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, |
static BOOL CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, |
| 577 |
LPARAM lParam) |
LPARAM lParam) |
| 578 |
{ |
{ |
| 579 |
const int IDC_TIMER1 = 300; |
const int IDC_TIMER1 = 300; |
| 580 |
const int autologin_timeout = 10; // ミリ秒 |
const int autologin_timeout = 10; // ミリ秒 |
| 689 |
char buf[1024]; |
char buf[1024]; |
| 690 |
|
|
| 691 |
_snprintf_s(buf, sizeof(buf), _TRUNCATE, |
_snprintf_s(buf, sizeof(buf), _TRUNCATE, |
| 692 |
"Server reports supported authentication method mask = %d", |
"Server reports supported authentication method mask = %d", |
| 693 |
types); |
types); |
| 694 |
buf[sizeof(buf) - 1] = 0; |
buf[sizeof(buf) - 1] = 0; |
| 695 |
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE); |
| 696 |
|
|
| 697 |
if (SSHv1(pvar)) { |
if (SSHv1(pvar)) { |
| 698 |
types &= (1 << SSH_AUTH_PASSWORD) | (1 << SSH_AUTH_RSA) |
types &= (1 << SSH_AUTH_PASSWORD) | (1 << SSH_AUTH_RSA) |
| 699 |
| (1 << SSH_AUTH_RHOSTS_RSA) | (1 << SSH_AUTH_RHOSTS) |
| (1 << SSH_AUTH_RHOSTS_RSA) | (1 << SSH_AUTH_RHOSTS) |
| 700 |
| (1 << SSH_AUTH_TIS); |
| (1 << SSH_AUTH_TIS); |
| 701 |
} else { |
} else { |
| 702 |
// for SSH2(yutaka) |
// for SSH2(yutaka) |
| 703 |
// types &= (1 << SSH_AUTH_PASSWORD); |
// types &= (1 << SSH_AUTH_PASSWORD); |
| 704 |
// 公開鍵認証を有効にする (2004.12.18 yutaka) |
// 公開鍵認証を有効にする (2004.12.18 yutaka) |
| 705 |
// TISを追加。SSH2ではkeyboard-interactiveとして扱う。(2005.3.12 yutaka) |
// TISを追加。SSH2ではkeyboard-interactiveとして扱う。(2005.3.12 yutaka) |
| 706 |
types &= (1 << SSH_AUTH_PASSWORD) | (1 << SSH_AUTH_RSA) |
types &= (1 << SSH_AUTH_PASSWORD) | (1 << SSH_AUTH_RSA) |
| 707 |
| (1 << SSH_AUTH_DSA) |
| (1 << SSH_AUTH_DSA) |
| 708 |
| (1 << SSH_AUTH_TIS); |
| (1 << SSH_AUTH_TIS); |
| 709 |
} |
} |
| 710 |
pvar->auth_state.supported_types = types; |
pvar->auth_state.supported_types = types; |
| 711 |
|
|
| 712 |
if (types == 0) { |
if (types == 0) { |
| 713 |
UTIL_get_lang_msg("MSG_NOAUTHMETHOD_ERROR", pvar, |
UTIL_get_lang_msg("MSG_NOAUTHMETHOD_ERROR", pvar, |
| 714 |
"Server does not support any of the authentication options\n" |
"Server does not support any of the authentication options\n" |
| 715 |
"provided by TTSSH. This connection will now close."); |
"provided by TTSSH. This connection will now close."); |
| 716 |
notify_fatal_error(pvar, pvar->ts->UIMsg); |
notify_fatal_error(pvar, pvar->ts->UIMsg); |
| 717 |
return 0; |
return 0; |
| 718 |
} else { |
} else { |
| 719 |
if (pvar->auth_state.auth_dialog != NULL) { |
if (pvar->auth_state.auth_dialog != NULL) { |
| 720 |
update_server_supported_types(pvar, |
update_server_supported_types(pvar, |
| 721 |
pvar->auth_state.auth_dialog); |
pvar->auth_state.auth_dialog); |
| 722 |
} |
} |
| 723 |
|
|
| 724 |
return 1; |
return 1; |
| 744 |
pvar->auth_state.cur_cred.key_pair |
pvar->auth_state.cur_cred.key_pair |
| 745 |
= |
= |
| 746 |
KEYFILES_read_private_key(pvar, |
KEYFILES_read_private_key(pvar, |
| 747 |
pvar->session_settings. |
pvar->session_settings. |
| 748 |
DefaultRSAPrivateKeyFile, |
DefaultRSAPrivateKeyFile, |
| 749 |
password, |
password, |
| 750 |
&invalid_passphrase, TRUE); |
&invalid_passphrase, TRUE); |
| 751 |
if (pvar->auth_state.cur_cred.key_pair == NULL) { |
if (pvar->auth_state.cur_cred.key_pair == NULL) { |
| 752 |
return; |
return; |
| 753 |
} else { |
} else { |
| 765 |
pvar->auth_state.cur_cred.key_pair |
pvar->auth_state.cur_cred.key_pair |
| 766 |
= |
= |
| 767 |
KEYFILES_read_private_key(pvar, |
KEYFILES_read_private_key(pvar, |
| 768 |
pvar->session_settings. |
pvar->session_settings. |
| 769 |
DefaultRhostsHostPrivateKeyFile, |
DefaultRhostsHostPrivateKeyFile, |
| 770 |
password, |
password, |
| 771 |
&invalid_passphrase, TRUE); |
&invalid_passphrase, TRUE); |
| 772 |
if (pvar->auth_state.cur_cred.key_pair == NULL) { |
if (pvar->auth_state.cur_cred.key_pair == NULL) { |
| 773 |
return; |
return; |
| 774 |
} else { |
} else { |
| 881 |
} |
} |
| 882 |
|
|
| 883 |
static BOOL CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, |
static BOOL CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, |
| 884 |
LPARAM lParam) |
LPARAM lParam) |
| 885 |
{ |
{ |
| 886 |
PTInstVar pvar; |
PTInstVar pvar; |
| 887 |
LOGFONT logfont; |
LOGFONT logfont; |
| 960 |
} |
} |
| 961 |
|
|
| 962 |
if (!DialogBoxParam(hInst, dialog_template, |
if (!DialogBoxParam(hInst, dialog_template, |
| 963 |
cur_active != |
cur_active != |
| 964 |
NULL ? cur_active : pvar->NotificationWindow, |
NULL ? cur_active : pvar->NotificationWindow, |
| 965 |
dlg_proc, (LPARAM) pvar) == -1) { |
dlg_proc, (LPARAM) pvar) == -1) { |
| 966 |
UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTH_ERROR", pvar, |
UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTH_ERROR", pvar, |
| 967 |
"Unable to display authentication dialog box.\n" |
"Unable to display authentication dialog box.\n" |
| 968 |
"Connection terminated."); |
"Connection terminated."); |
| 969 |
notify_fatal_error(pvar, pvar->ts->UIMsg); |
notify_fatal_error(pvar, pvar->ts->UIMsg); |
| 970 |
} |
} |
| 971 |
} |
} |
| 1018 |
switch (pvar->settings.DefaultAuthMethod) { |
switch (pvar->settings.DefaultAuthMethod) { |
| 1019 |
case SSH_AUTH_RSA: |
case SSH_AUTH_RSA: |
| 1020 |
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, |
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, |
| 1021 |
IDC_SSHUSERSA); |
IDC_SSHUSERSA); |
| 1022 |
break; |
break; |
| 1023 |
case SSH_AUTH_RHOSTS: |
case SSH_AUTH_RHOSTS: |
| 1024 |
case SSH_AUTH_RHOSTS_RSA: |
case SSH_AUTH_RHOSTS_RSA: |
| 1025 |
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, |
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, |
| 1026 |
IDC_SSHUSERHOSTS); |
IDC_SSHUSERHOSTS); |
| 1027 |
break; |
break; |
| 1028 |
case SSH_AUTH_TIS: |
case SSH_AUTH_TIS: |
| 1029 |
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, |
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, |
| 1030 |
IDC_SSHUSETIS); |
IDC_SSHUSETIS); |
| 1031 |
break; |
break; |
| 1032 |
case SSH_AUTH_PASSWORD: |
case SSH_AUTH_PASSWORD: |
| 1033 |
default: |
default: |
| 1034 |
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, |
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, |
| 1035 |
IDC_SSHUSEPASSWORD); |
IDC_SSHUSEPASSWORD); |
| 1036 |
} |
} |
| 1037 |
|
|
| 1038 |
SetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->settings.DefaultUserName); |
SetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->settings.DefaultUserName); |
| 1039 |
SetDlgItemText(dlg, IDC_RSAFILENAME, |
SetDlgItemText(dlg, IDC_RSAFILENAME, |
| 1040 |
pvar->settings.DefaultRSAPrivateKeyFile); |
pvar->settings.DefaultRSAPrivateKeyFile); |
| 1041 |
SetDlgItemText(dlg, IDC_HOSTRSAFILENAME, |
SetDlgItemText(dlg, IDC_HOSTRSAFILENAME, |
| 1042 |
pvar->settings.DefaultRhostsHostPrivateKeyFile); |
pvar->settings.DefaultRhostsHostPrivateKeyFile); |
| 1043 |
SetDlgItemText(dlg, IDC_LOCALUSERNAME, |
SetDlgItemText(dlg, IDC_LOCALUSERNAME, |
| 1044 |
pvar->settings.DefaultRhostsLocalUserName); |
pvar->settings.DefaultRhostsLocalUserName); |
| 1045 |
|
|
| 1046 |
// SSH2 keyboard-interactive method (2005.2.22 yutaka) |
// SSH2 keyboard-interactive method (2005.2.22 yutaka) |
| 1047 |
if (pvar->settings.ssh2_keyboard_interactive) { |
if (pvar->settings.ssh2_keyboard_interactive) { |
| 1067 |
} |
} |
| 1068 |
|
|
| 1069 |
GetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->settings.DefaultUserName, |
GetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->settings.DefaultUserName, |
| 1070 |
sizeof(pvar->settings.DefaultUserName)); |
sizeof(pvar->settings.DefaultUserName)); |
| 1071 |
GetDlgItemText(dlg, IDC_RSAFILENAME, |
GetDlgItemText(dlg, IDC_RSAFILENAME, |
| 1072 |
pvar->settings.DefaultRSAPrivateKeyFile, |
pvar->settings.DefaultRSAPrivateKeyFile, |
| 1073 |
sizeof(pvar->settings.DefaultRSAPrivateKeyFile)); |
sizeof(pvar->settings.DefaultRSAPrivateKeyFile)); |
| 1074 |
GetDlgItemText(dlg, IDC_HOSTRSAFILENAME, |
GetDlgItemText(dlg, IDC_HOSTRSAFILENAME, |
| 1075 |
pvar->settings.DefaultRhostsHostPrivateKeyFile, |
pvar->settings.DefaultRhostsHostPrivateKeyFile, |
| 1076 |
sizeof(pvar->settings.DefaultRhostsHostPrivateKeyFile)); |
sizeof(pvar->settings.DefaultRhostsHostPrivateKeyFile)); |
| 1077 |
GetDlgItemText(dlg, IDC_LOCALUSERNAME, |
GetDlgItemText(dlg, IDC_LOCALUSERNAME, |
| 1078 |
pvar->settings.DefaultRhostsLocalUserName, |
pvar->settings.DefaultRhostsLocalUserName, |
| 1079 |
sizeof(pvar->settings.DefaultRhostsLocalUserName)); |
sizeof(pvar->settings.DefaultRhostsLocalUserName)); |
| 1080 |
|
|
| 1081 |
// SSH2 keyboard-interactive method (2005.2.22 yutaka) |
// SSH2 keyboard-interactive method (2005.2.22 yutaka) |
| 1082 |
{ |
{ |
| 1211 |
HWND cur_active = GetActiveWindow(); |
HWND cur_active = GetActiveWindow(); |
| 1212 |
|
|
| 1213 |
if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHAUTHSETUP), |
if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHAUTHSETUP), |
| 1214 |
cur_active != |
cur_active != NULL ? cur_active |
| 1215 |
NULL ? cur_active : pvar->NotificationWindow, |
: pvar->NotificationWindow, |
| 1216 |
default_auth_dlg_proc, (LPARAM) pvar) == -1) { |
default_auth_dlg_proc, (LPARAM) pvar) == -1) { |
| 1217 |
UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTHSETUP_ERROR", pvar, |
UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTHSETUP_ERROR", pvar, |
| 1218 |
"Unable to display authentication setup dialog box."); |
"Unable to display authentication setup dialog box."); |
| 1219 |
notify_nonfatal_error(pvar, pvar->ts->UIMsg); |
notify_nonfatal_error(pvar, pvar->ts->UIMsg); |
| 1220 |
} |
} |
| 1221 |
} |
} |
| 1258 |
if (SSHv1(pvar)) { |
if (SSHv1(pvar)) { |
| 1259 |
UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s"); |
UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s"); |
| 1260 |
_snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg, pvar->auth_state.user, |
_snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg, pvar->auth_state.user, |
| 1261 |
get_auth_method_name(pvar->auth_state.cur_cred.method)); |
get_auth_method_name(pvar->auth_state.cur_cred.method)); |
| 1262 |
|
|
| 1263 |
} else { |
} else { |
| 1264 |
// SSH2:認証メソッドの判別 (2004.12.23 yutaka) |
// SSH2:認証メソッドの判別 (2004.12.23 yutaka) |
| 1274 |
} |
} |
| 1275 |
UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s"); |
UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s"); |
| 1276 |
_snprintf_s(dest, len, _TRUNCATE, |
_snprintf_s(dest, len, _TRUNCATE, |
| 1277 |
pvar->ts->UIMsg, pvar->auth_state.user, method); |
pvar->ts->UIMsg, pvar->auth_state.user, method); |
| 1278 |
|
|
| 1279 |
} else { |
} else { |
| 1280 |
if (pvar->auth_state.cur_cred.key_pair->RSA_key != NULL) { |
if (pvar->auth_state.cur_cred.key_pair->RSA_key != NULL) { |
| 1284 |
} |
} |
| 1285 |
UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s"); |
UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s"); |
| 1286 |
_snprintf_s(dest, len, _TRUNCATE, |
_snprintf_s(dest, len, _TRUNCATE, |
| 1287 |
pvar->ts->UIMsg, pvar->auth_state.user, method); |
pvar->ts->UIMsg, pvar->auth_state.user, method); |
| 1288 |
} |
} |
| 1289 |
|
|
| 1290 |
} |
} |
| 1292 |
} else { |
} else { |
| 1293 |
UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s"); |
UTIL_get_lang_msg("DLG_ABOUT_AUTH_INFO", pvar, "User '%s', using %s"); |
| 1294 |
_snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg, pvar->auth_state.user, |
_snprintf_s(dest, len, _TRUNCATE, pvar->ts->UIMsg, pvar->auth_state.user, |
| 1295 |
get_auth_method_name(pvar->auth_state.failed_method)); |
get_auth_method_name(pvar->auth_state.failed_method)); |
| 1296 |
} |
} |
| 1297 |
|
|
| 1298 |
dest[len - 1] = 0; |
dest[len - 1] = 0; |