| 32 |
#include "ssh.h" |
#include "ssh.h" |
| 33 |
#include "key.h" |
#include "key.h" |
| 34 |
#include "ttlib.h" |
#include "ttlib.h" |
| 35 |
|
#include "dlglib.h" |
| 36 |
|
|
| 37 |
#include <io.h> |
#include <io.h> |
| 38 |
#include <fcntl.h> |
#include <fcntl.h> |
| 48 |
|
|
| 49 |
#define MAX_AUTH_CONTROL IDC_SSHUSEPAGEANT |
#define MAX_AUTH_CONTROL IDC_SSHUSEPAGEANT |
| 50 |
|
|
| 51 |
static HFONT DlgAuthFont; |
#undef DialogBoxParam |
| 52 |
static HFONT DlgTisFont; |
#define DialogBoxParam(p1,p2,p3,p4,p5) \ |
| 53 |
static HFONT DlgAuthSetupFont; |
TTDialogBoxParam(p1,p2,p3,p4,p5) |
| 54 |
|
#undef EndDialog |
| 55 |
|
#define EndDialog(p1,p2) \ |
| 56 |
|
TTEndDialog(p1, p2) |
| 57 |
|
|
| 58 |
|
//static HFONT DlgAuthFont; |
| 59 |
|
//static HFONT DlgTisFont; |
| 60 |
|
//static HFONT DlgAuthSetupFont; |
| 61 |
|
|
| 62 |
void destroy_malloced_string(char **str) |
void destroy_malloced_string(char **str) |
| 63 |
{ |
{ |
| 710 |
} |
} |
| 711 |
|
|
| 712 |
EndDialog(dlg, 1); |
EndDialog(dlg, 1); |
| 713 |
|
#if 0 |
| 714 |
if (DlgAuthFont != NULL) { |
if (DlgAuthFont != NULL) { |
| 715 |
DeleteObject(DlgAuthFont); |
DeleteObject(DlgAuthFont); |
| 716 |
} |
} |
| 717 |
|
#endif |
| 718 |
|
|
| 719 |
return TRUE; |
return TRUE; |
| 720 |
} |
} |
| 768 |
const int IDC_TIMER3 = 302; // challenge で ask4passwd でCheckAuthListFirst が FALSE のとき |
const int IDC_TIMER3 = 302; // challenge で ask4passwd でCheckAuthListFirst が FALSE のとき |
| 769 |
const int autologin_timeout = 10; // ミリ秒 |
const int autologin_timeout = 10; // ミリ秒 |
| 770 |
PTInstVar pvar; |
PTInstVar pvar; |
| 771 |
LOGFONT logfont; |
// LOGFONT logfont; |
| 772 |
HFONT font; |
// HFONT font; |
| 773 |
|
|
| 774 |
switch (msg) { |
switch (msg) { |
| 775 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
| 778 |
SetWindowLong(dlg, DWL_USER, lParam); |
SetWindowLong(dlg, DWL_USER, lParam); |
| 779 |
|
|
| 780 |
init_auth_dlg(pvar, dlg); |
init_auth_dlg(pvar, dlg); |
| 781 |
|
#if 0 |
| 782 |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
| 783 |
GetObject(font, sizeof(LOGFONT), &logfont); |
GetObject(font, sizeof(LOGFONT), &logfont); |
| 784 |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgAuthFont, pvar)) { |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgAuthFont, pvar)) { |
| 807 |
else { |
else { |
| 808 |
DlgAuthFont = NULL; |
DlgAuthFont = NULL; |
| 809 |
} |
} |
| 810 |
|
#endif |
| 811 |
// SSH2 autologinが有効の場合は、タイマを仕掛ける。 (2004.12.1 yutaka) |
// SSH2 autologinが有効の場合は、タイマを仕掛ける。 (2004.12.1 yutaka) |
| 812 |
if (pvar->ssh2_autologin == 1) { |
if (pvar->ssh2_autologin == 1) { |
| 813 |
autologin_sent_none = FALSE; |
autologin_sent_none = FALSE; |
| 953 |
pvar->auth_state.auth_dialog = NULL; |
pvar->auth_state.auth_dialog = NULL; |
| 954 |
notify_closed_connection(pvar, "authentication cancelled"); |
notify_closed_connection(pvar, "authentication cancelled"); |
| 955 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
| 956 |
|
#if 0 |
| 957 |
if (DlgAuthFont != NULL) { |
if (DlgAuthFont != NULL) { |
| 958 |
DeleteObject(DlgAuthFont); |
DeleteObject(DlgAuthFont); |
| 959 |
} |
} |
| 960 |
|
#endif |
| 961 |
return TRUE; |
return TRUE; |
| 962 |
|
|
| 963 |
case IDC_SSHUSERNAME: |
case IDC_SSHUSERNAME: |
| 1237 |
LPARAM lParam) |
LPARAM lParam) |
| 1238 |
{ |
{ |
| 1239 |
PTInstVar pvar; |
PTInstVar pvar; |
| 1240 |
LOGFONT logfont; |
// LOGFONT logfont; |
| 1241 |
HFONT font; |
// HFONT font; |
| 1242 |
|
|
| 1243 |
switch (msg) { |
switch (msg) { |
| 1244 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
| 1247 |
SetWindowLong(dlg, DWL_USER, lParam); |
SetWindowLong(dlg, DWL_USER, lParam); |
| 1248 |
|
|
| 1249 |
init_TIS_dlg(pvar, dlg); |
init_TIS_dlg(pvar, dlg); |
| 1250 |
|
#if 0 |
| 1251 |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
| 1252 |
GetObject(font, sizeof(LOGFONT), &logfont); |
GetObject(font, sizeof(LOGFONT), &logfont); |
| 1253 |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgTisFont, pvar)) { |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgTisFont, pvar)) { |
| 1260 |
else { |
else { |
| 1261 |
DlgTisFont = NULL; |
DlgTisFont = NULL; |
| 1262 |
} |
} |
| 1263 |
|
#endif |
| 1264 |
// /auth=challenge を追加 (2007.10.5 maya) |
// /auth=challenge を追加 (2007.10.5 maya) |
| 1265 |
if (pvar->ssh2_autologin == 1) { |
if (pvar->ssh2_autologin == 1) { |
| 1266 |
SetDlgItemText(dlg, IDC_SSHPASSWORD, pvar->ssh2_password); |
SetDlgItemText(dlg, IDC_SSHPASSWORD, pvar->ssh2_password); |
| 1274 |
|
|
| 1275 |
switch (LOWORD(wParam)) { |
switch (LOWORD(wParam)) { |
| 1276 |
case IDOK: |
case IDOK: |
| 1277 |
|
#if 0 |
| 1278 |
if (DlgTisFont != NULL) { |
if (DlgTisFont != NULL) { |
| 1279 |
DeleteObject(DlgTisFont); |
DeleteObject(DlgTisFont); |
| 1280 |
} |
} |
| 1281 |
|
#endif |
| 1282 |
return end_TIS_dlg(pvar, dlg); |
return end_TIS_dlg(pvar, dlg); |
| 1283 |
|
|
| 1284 |
case IDCANCEL: /* kill the connection */ |
case IDCANCEL: /* kill the connection */ |
| 1285 |
pvar->auth_state.auth_dialog = NULL; |
pvar->auth_state.auth_dialog = NULL; |
| 1286 |
notify_closed_connection(pvar, "authentication cancelled"); |
notify_closed_connection(pvar, "authentication cancelled"); |
| 1287 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
| 1288 |
|
#if 0 |
| 1289 |
if (DlgTisFont != NULL) { |
if (DlgTisFont != NULL) { |
| 1290 |
DeleteObject(DlgTisFont); |
DeleteObject(DlgTisFont); |
| 1291 |
} |
} |
| 1292 |
|
#endif |
| 1293 |
return TRUE; |
return TRUE; |
| 1294 |
|
|
| 1295 |
default: |
default: |
| 1460 |
WPARAM wParam, LPARAM lParam) |
WPARAM wParam, LPARAM lParam) |
| 1461 |
{ |
{ |
| 1462 |
PTInstVar pvar; |
PTInstVar pvar; |
| 1463 |
LOGFONT logfont; |
// LOGFONT logfont; |
| 1464 |
HFONT font; |
// HFONT font; |
| 1465 |
|
|
| 1466 |
switch (msg) { |
switch (msg) { |
| 1467 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
| 1469 |
SetWindowLong(dlg, DWL_USER, lParam); |
SetWindowLong(dlg, DWL_USER, lParam); |
| 1470 |
|
|
| 1471 |
init_default_auth_dlg(pvar, dlg); |
init_default_auth_dlg(pvar, dlg); |
| 1472 |
|
#if 0 |
| 1473 |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0); |
| 1474 |
GetObject(font, sizeof(LOGFONT), &logfont); |
GetObject(font, sizeof(LOGFONT), &logfont); |
| 1475 |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgAuthSetupFont, pvar)) { |
if (UTIL_get_lang_font("DLG_TAHOMA_FONT", dlg, &logfont, &DlgAuthSetupFont, pvar)) { |
| 1494 |
else { |
else { |
| 1495 |
DlgAuthSetupFont = NULL; |
DlgAuthSetupFont = NULL; |
| 1496 |
} |
} |
| 1497 |
|
#endif |
| 1498 |
return TRUE; /* because we do not set the focus */ |
return TRUE; /* because we do not set the focus */ |
| 1499 |
|
|
| 1500 |
case WM_COMMAND: |
case WM_COMMAND: |
| 1502 |
|
|
| 1503 |
switch (LOWORD(wParam)) { |
switch (LOWORD(wParam)) { |
| 1504 |
case IDOK: |
case IDOK: |
| 1505 |
|
#if 0 |
| 1506 |
if (DlgAuthSetupFont != NULL) { |
if (DlgAuthSetupFont != NULL) { |
| 1507 |
DeleteObject(DlgAuthSetupFont); |
DeleteObject(DlgAuthSetupFont); |
| 1508 |
} |
} |
| 1509 |
|
#endif |
| 1510 |
return end_default_auth_dlg(pvar, dlg); |
return end_default_auth_dlg(pvar, dlg); |
| 1511 |
|
|
| 1512 |
case IDCANCEL: |
case IDCANCEL: |
| 1513 |
EndDialog(dlg, 0); |
EndDialog(dlg, 0); |
| 1514 |
|
#if 0 |
| 1515 |
if (DlgAuthSetupFont != NULL) { |
if (DlgAuthSetupFont != NULL) { |
| 1516 |
DeleteObject(DlgAuthSetupFont); |
DeleteObject(DlgAuthSetupFont); |
| 1517 |
} |
} |
| 1518 |
|
#endif |
| 1519 |
return TRUE; |
return TRUE; |
| 1520 |
|
|
| 1521 |
case IDC_CHOOSERSAFILE: |
case IDC_CHOOSERSAFILE: |