Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/auth.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7508 by maya, Sun Mar 24 03:44:58 2019 UTC revision 7560 by zmatsuo, Mon Apr 8 17:12:02 2019 UTC
# Line 32  Line 32 
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>
# Line 47  Line 48 
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  {  {
# Line 702  static BOOL end_auth_dlg(PTInstVar pvar, Line 710  static BOOL end_auth_dlg(PTInstVar pvar,
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  }  }
# Line 758  static BOOL CALLBACK auth_dlg_proc(HWND Line 768  static BOOL CALLBACK auth_dlg_proc(HWND
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:
# Line 768  static BOOL CALLBACK auth_dlg_proc(HWND Line 778  static BOOL CALLBACK auth_dlg_proc(HWND
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)) {
# Line 797  static BOOL CALLBACK auth_dlg_proc(HWND Line 807  static BOOL CALLBACK auth_dlg_proc(HWND
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;
# Line 943  canceled: Line 953  canceled:
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:
# Line 1227  static BOOL CALLBACK TIS_dlg_proc(HWND d Line 1237  static BOOL CALLBACK TIS_dlg_proc(HWND d
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:
# Line 1237  static BOOL CALLBACK TIS_dlg_proc(HWND d Line 1247  static BOOL CALLBACK TIS_dlg_proc(HWND d
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)) {
# Line 1250  static BOOL CALLBACK TIS_dlg_proc(HWND d Line 1260  static BOOL CALLBACK TIS_dlg_proc(HWND d
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);
# Line 1264  static BOOL CALLBACK TIS_dlg_proc(HWND d Line 1274  static BOOL CALLBACK TIS_dlg_proc(HWND d
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:
# Line 1449  static BOOL CALLBACK default_auth_dlg_pr Line 1460  static BOOL CALLBACK default_auth_dlg_pr
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:
# Line 1458  static BOOL CALLBACK default_auth_dlg_pr Line 1469  static BOOL CALLBACK default_auth_dlg_pr
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)) {
# Line 1483  static BOOL CALLBACK default_auth_dlg_pr Line 1494  static BOOL CALLBACK default_auth_dlg_pr
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:
# Line 1491  static BOOL CALLBACK default_auth_dlg_pr Line 1502  static BOOL CALLBACK default_auth_dlg_pr
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:

Legend:
Removed from v.7508  
changed lines
  Added in v.7560

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26