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 6229 by yutakapon, Fri Jan 1 11:06:37 2016 UTC revision 6801 by doda, Tue Jun 13 10:30:12 2017 UTC
# Line 48  static HFONT DlgAuthFont; Line 48  static HFONT DlgAuthFont;
48  static HFONT DlgTisFont;  static HFONT DlgTisFont;
49  static HFONT DlgAuthSetupFont;  static HFONT DlgAuthSetupFont;
50    
51  void destroy_malloced_string(char FAR * FAR * str)  void destroy_malloced_string(char **str)
52  {  {
53          if (*str != NULL) {          if (*str != NULL) {
54                  SecureZeroMemory(*str, strlen(*str));                  SecureZeroMemory(*str, strlen(*str));
# Line 72  LRESULT CALLBACK password_wnd_proc(HWND Line 72  LRESULT CALLBACK password_wnd_proc(HWND
72                          char chars[] = { (char) wParam, 0 };                          char chars[] = { (char) wParam, 0 };
73    
74                          SendMessage(control, EM_REPLACESEL, (WPARAM) TRUE,                          SendMessage(control, EM_REPLACESEL, (WPARAM) TRUE,
75                                      (LPARAM) (char FAR *) chars);                                      (LPARAM) (char *) chars);
76                          return 0;                          return 0;
77                  }                  }
78          }          }
# Line 352  static void init_auth_dlg(PTInstVar pvar Line 352  static void init_auth_dlg(PTInstVar pvar
352          }          }
353  }  }
354    
355  static char FAR *alloc_control_text(HWND ctl)  static char *alloc_control_text(HWND ctl)
356  {  {
357          int len = GetWindowTextLength(ctl);          int len = GetWindowTextLength(ctl);
358          char FAR *result = malloc(len + 1);          char *result = malloc(len + 1);
359    
360          if (result != NULL) {          if (result != NULL) {
361                  GetWindowText(ctl, result, len + 1);                  GetWindowText(ctl, result, len + 1);
# Line 365  static char FAR *alloc_control_text(HWND Line 365  static char FAR *alloc_control_text(HWND
365          return result;          return result;
366  }  }
367    
368  static int get_key_file_name(HWND parent, char FAR * buf, int bufsize, PTInstVar pvar)  static int get_key_file_name(HWND parent, char *buf, int bufsize, PTInstVar pvar)
369  {  {
370          OPENFILENAME params;          OPENFILENAME params;
371          char fullname_buf[2048] = "identity";          char fullname_buf[2048] = "identity";
# Line 423  static void choose_host_RSA_key_file(HWN Line 423  static void choose_host_RSA_key_file(HWN
423  static BOOL end_auth_dlg(PTInstVar pvar, HWND dlg)  static BOOL end_auth_dlg(PTInstVar pvar, HWND dlg)
424  {  {
425          int method = SSH_AUTH_PASSWORD;          int method = SSH_AUTH_PASSWORD;
426          char FAR *password =          char *password =
427                  alloc_control_text(GetDlgItem(dlg, IDC_SSHPASSWORD));                  alloc_control_text(GetDlgItem(dlg, IDC_SSHPASSWORD));
428          Key *key_pair = NULL;          Key *key_pair = NULL;
429    
# Line 936  canceled: Line 936  canceled:
936          }          }
937  }  }
938    
939  char FAR *AUTH_get_user_name(PTInstVar pvar)  char *AUTH_get_user_name(PTInstVar pvar)
940  {  {
941          return pvar->auth_state.user;          return pvar->auth_state.user;
942  }  }
# Line 1121  static void init_TIS_dlg(PTInstVar pvar, Line 1121  static void init_TIS_dlg(PTInstVar pvar,
1121    
1122  static BOOL end_TIS_dlg(PTInstVar pvar, HWND dlg)  static BOOL end_TIS_dlg(PTInstVar pvar, HWND dlg)
1123  {  {
1124          char FAR *password =          char *password =
1125                  alloc_control_text(GetDlgItem(dlg, IDC_SSHPASSWORD));                  alloc_control_text(GetDlgItem(dlg, IDC_SSHPASSWORD));
1126    
1127          pvar->auth_state.cur_cred.method = SSH_AUTH_TIS;          pvar->auth_state.cur_cred.method = SSH_AUTH_TIS;
# Line 1462  void AUTH_set_generic_mode(PTInstVar pva Line 1462  void AUTH_set_generic_mode(PTInstVar pva
1462          destroy_malloced_string(&pvar->auth_state.TIS_prompt);          destroy_malloced_string(&pvar->auth_state.TIS_prompt);
1463  }  }
1464    
1465  void AUTH_set_TIS_mode(PTInstVar pvar, char FAR * prompt, int len)  void AUTH_set_TIS_mode(PTInstVar pvar, char *prompt, int len)
1466  {  {
1467          if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {          if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
1468                  pvar->auth_state.mode = TIS_AUTH_MODE;                  pvar->auth_state.mode = TIS_AUTH_MODE;
# Line 1520  static const char *get_auth_method_name( Line 1520  static const char *get_auth_method_name(
1520          }          }
1521  }  }
1522    
1523  void AUTH_get_auth_info(PTInstVar pvar, char FAR * dest, int len)  void AUTH_get_auth_info(PTInstVar pvar, char *dest, int len)
1524  {  {
1525          const char *method = "unknown";          const char *method = "unknown";
1526          char buf[256];          char buf[256];

Legend:
Removed from v.6229  
changed lines
  Added in v.6801

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