Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/ttssh2/ttxssh/hosts.c

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

revision 9255 by nmaya, Wed May 19 14:11:26 2021 UTC revision 9324 by zmatsuo, Tue Jun 29 15:20:20 2021 UTC
# Line 55  See LICENSE.TXT for the license. Line 55  See LICENSE.TXT for the license.
55  #include <memory.h>  #include <memory.h>
56    
57  #include "codeconv.h"  #include "codeconv.h"
 #include "layer_for_unicode.h"  
58  #include "asprintf.h"  #include "asprintf.h"
59    
60  #undef DialogBoxParam  #undef DialogBoxParam
# Line 837  int HOSTS_hostkey_foreach(PTInstVar pvar Line 836  int HOSTS_hostkey_foreach(PTInstVar pvar
836    
837                  // 該当する鍵が見つかったら、コールバック関数を呼び出す。                  // 該当する鍵が見つかったら、コールバック関数を呼び出す。
838                  if (key != NULL) {                  if (key != NULL) {
839                          if (callback(key, ctx) == 0)                          if (callback(key, ctx) == 0)
840                                  key_free(key);                                  key_free(key);
841                  }                  }
842          }          }
# Line 994  static void init_hosts_dlg(PTInstVar pva Line 993  static void init_hosts_dlg(PTInstVar pva
993          wchar_t *hostW;          wchar_t *hostW;
994    
995          // ホスト名に置換する          // ホスト名に置換する
996          _GetDlgItemTextW(dlg, IDC_HOSTWARNING, buf, _countof(buf));          GetDlgItemTextW(dlg, IDC_HOSTWARNING, buf, _countof(buf));
997          hostW = ToWcharA(pvar->hosts_state.prefetched_hostname);          hostW = ToWcharA(pvar->hosts_state.prefetched_hostname);
998          aswprintf(&buf2, buf, hostW);          aswprintf(&buf2, buf, hostW);
999          free(hostW);          free(hostW);
1000          _SetDlgItemTextW(dlg, IDC_HOSTWARNING, buf2);          SetDlgItemTextW(dlg, IDC_HOSTWARNING, buf2);
1001          free(buf2);          free(buf2);
1002    
1003          pvar->hFontFixed = UTIL_get_lang_fixedfont(dlg, pvar->ts->UILanguageFile);          pvar->hFontFixed = UTIL_get_lang_fixedfont(dlg, pvar->ts->UILanguageFile);
# Line 1112  static char *format_host_key(PTInstVar p Line 1111  static char *format_host_key(PTInstVar p
1111                          // setup                          // setup
1112                          if (pvar->ssh_state.tcpport == 22) {                          if (pvar->ssh_state.tcpport == 22) {
1113                                  _snprintf_s(result, msize, _TRUNCATE, "%s %s %s\r\n",                                  _snprintf_s(result, msize, _TRUNCATE, "%s %s %s\r\n",
1114                                              pvar->hosts_state.prefetched_hostname,                                              pvar->hosts_state.prefetched_hostname,
1115                                              get_ssh2_hostkey_type_name_from_key(key),                                              get_ssh2_hostkey_type_name_from_key(key),
1116                                              uu);                                              uu);
1117                          } else {                          } else {
# Line 1804  static INT_PTR CALLBACK hosts_add_dlg_pr Line 1803  static INT_PTR CALLBACK hosts_add_dlg_pr
1803                  }                  }
1804    
1805                  init_hosts_dlg(pvar, dlg);                  init_hosts_dlg(pvar, dlg);
1806                  // add host check boxにチェックをデフォルトで入れておく                  // add host check boxにチェックをデフォルトで入れておく
1807                  SendMessage(GetDlgItem(dlg, IDC_ADDTOKNOWNHOSTS), BM_SETCHECK, BST_CHECKED, 0);                  SendMessage(GetDlgItem(dlg, IDC_ADDTOKNOWNHOSTS), BM_SETCHECK, BST_CHECKED, 0);
1808    
1809                  CenterWindow(dlg, GetParent(dlg));                  CenterWindow(dlg, GetParent(dlg));
# Line 2269  void HOSTS_do_different_type_key_dialog( Line 2268  void HOSTS_do_different_type_key_dialog(
2268   * 必要に応じて known_hosts ダイアログを呼び出す。   * 必要に応じて known_hosts ダイアログを呼び出す。
2269   *   *
2270   *   hostname: 接続先のホスト名   *   hostname: 接続先のホスト名
2271   *   tcpport: 接続先ポート番号   *   tcpport: 接続先ポート番号
2272   *   key: サーバからの公開鍵   *   key: サーバからの公開鍵
2273   *   *
2274   * return:   * return:
# Line 2290  BOOL HOSTS_check_host_key(PTInstVar pvar Line 2289  BOOL HOSTS_check_host_key(PTInstVar pvar
2289           && _stricmp(pvar->hosts_state.prefetched_hostname, hostname) == 0           && _stricmp(pvar->hosts_state.prefetched_hostname, hostname) == 0
2290           && HOSTS_compare_public_key(&pvar->hosts_state.hostkey, key) == 1) {           && HOSTS_compare_public_key(&pvar->hosts_state.hostkey, key) == 1) {
2291    
2292                   // 何もせずに戻る。                               // 何もせずに戻る。
2293                   return TRUE;                   return TRUE;
2294          }          }
2295    
# Line 2335  BOOL HOSTS_check_host_key(PTInstVar pvar Line 2334  BOOL HOSTS_check_host_key(PTInstVar pvar
2334    
2335          // "/nosecuritywarning"が指定されている場合、ダイアログを表示させずに return success する。          // "/nosecuritywarning"が指定されている場合、ダイアログを表示させずに return success する。
2336          if (pvar->nocheck_known_hosts == TRUE) {          if (pvar->nocheck_known_hosts == TRUE) {
2337                   // 何もせずに戻る。                               // 何もせずに戻る。
2338                  return TRUE;                  return TRUE;
2339          }          }
2340    
# Line 2370  BOOL HOSTS_check_host_key(PTInstVar pvar Line 2369  BOOL HOSTS_check_host_key(PTInstVar pvar
2369    
2370          PostMessage(pvar->NotificationWindow, WM_COMMAND, id, 0);          PostMessage(pvar->NotificationWindow, WM_COMMAND, id, 0);
2371    
2372          logprintf(LOG_LEVEL_INFO, "Calling known_hosts dialog...(%s)",          logprintf(LOG_LEVEL_INFO, "Calling known_hosts dialog...(%s)",
2373                  id == ID_SSHDIFFERENTKEY ? "SSHDIFFERENTKEY" :                  id == ID_SSHDIFFERENTKEY ? "SSHDIFFERENTKEY" :
2374                  id == ID_SSHDIFFERENT_TYPE_KEY ? "SSHDIFFERENT_TYPE_KEY" : "SSHUNKNOWNHOST"                  id == ID_SSHDIFFERENT_TYPE_KEY ? "SSHDIFFERENT_TYPE_KEY" : "SSHUNKNOWNHOST"
2375                  );                  );
2376    

Legend:
Removed from v.9255  
changed lines
  Added in v.9324

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