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 3120 by yutakapon, Sun Mar 2 13:54:43 2008 UTC revision 3126 by maya, Mon May 19 08:37:18 2008 UTC
# Line 500  static char FAR *parse_bignum(char FAR * Line 500  static char FAR *parse_bignum(char FAR *
500  // known_hostsファイルの内容を解析し、指定したホストの公開鍵を探す。  // known_hostsファイルの内容を解析し、指定したホストの公開鍵を探す。
501  //  //
502  static int check_host_key(PTInstVar pvar, char FAR * hostname,  static int check_host_key(PTInstVar pvar, char FAR * hostname,
503                            char FAR * data)                            unsigned short tcpport, char FAR * data)
504  {  {
505          int index = eat_spaces(data);          int index = eat_spaces(data);
506          int matched = 0;          int matched = 0;
# Line 623  static int check_host_key(PTInstVar pvar Line 623  static int check_host_key(PTInstVar pvar
623  //  //
624  // known_hostsファイルからホスト名に合致する行を読む  // known_hostsファイルからホスト名に合致する行を読む
625  //  //
626  static int read_host_key(PTInstVar pvar, char FAR * hostname,  static int read_host_key(PTInstVar pvar,
627                             char FAR * hostname, unsigned short tcpport,
628                           int suppress_errors, int return_always)                           int suppress_errors, int return_always)
629  {  {
630          int i;          int i;
# Line 694  static int read_host_key(PTInstVar pvar, Line 695  static int read_host_key(PTInstVar pvar,
695                  }                  }
696    
697                  pvar->hosts_state.file_data_index +=                  pvar->hosts_state.file_data_index +=
698                          check_host_key(pvar, hostname,                          check_host_key(pvar, hostname, tcpport,
699                                         pvar->hosts_state.file_data +                                         pvar->hosts_state.file_data +
700                                         pvar->hosts_state.file_data_index);                                         pvar->hosts_state.file_data_index);
701    
# Line 718  static void finish_read_host_files(PTIns Line 719  static void finish_read_host_files(PTIns
719  }  }
720    
721  // サーバへ接続する前に、known_hostsファイルからホスト公開鍵を先読みしておく。  // サーバへ接続する前に、known_hostsファイルからホスト公開鍵を先読みしておく。
722  void HOSTS_prefetch_host_key(PTInstVar pvar, char FAR * hostname)  void HOSTS_prefetch_host_key(PTInstVar pvar, char FAR * hostname, unsigned short tcpport)
723  {  {
724          if (!begin_read_host_files(pvar, 1)) {          if (!begin_read_host_files(pvar, 1)) {
725                  return;                  return;
726          }          }
727    
728          if (!read_host_key(pvar, hostname, 1, 0)) {          if (!read_host_key(pvar, hostname, tcpport, 1, 0)) {
729                  return;                  return;
730          }          }
731    
# Line 1039  static void delete_different_key(PTInstV Line 1040  static void delete_different_key(PTInstV
1040                          int do_write = 0;                          int do_write = 0;
1041                          length = amount_written = 0;                          length = amount_written = 0;
1042    
1043                          if (!read_host_key(pvar, pvar->ssh_state.hostname, 0, 1)) {                          if (!read_host_key(pvar, pvar->ssh_state.hostname, pvar->ssh_state.tcpport, 0, 1)) {
1044                                  break;                                  break;
1045                          }                          }
1046    
# Line 1388  void HOSTS_do_different_host_dialog(HWND Line 1389  void HOSTS_do_different_host_dialog(HWND
1389  //  //
1390  // SSH2対応を追加 (2006.3.24 yutaka)  // SSH2対応を追加 (2006.3.24 yutaka)
1391  //  //
1392  BOOL HOSTS_check_host_key(PTInstVar pvar, char FAR * hostname, Key *key)  BOOL HOSTS_check_host_key(PTInstVar pvar, char FAR * hostname, unsigned short tcpport, Key *key)
1393  {  {
1394          int found_different_key = 0;          int found_different_key = 0;
1395    
# Line 1408  BOOL HOSTS_check_host_key(PTInstVar pvar Line 1409  BOOL HOSTS_check_host_key(PTInstVar pvar
1409          // 先読みされていない場合は、この時点でファイルから読み込む          // 先読みされていない場合は、この時点でファイルから読み込む
1410          if (begin_read_host_files(pvar, 0)) {          if (begin_read_host_files(pvar, 0)) {
1411                  do {                  do {
1412                          if (!read_host_key(pvar, hostname, 0, 0)) {                          if (!read_host_key(pvar, hostname, tcpport, 0, 0)) {
1413                                  break;                                  break;
1414                          }                          }
1415    

Legend:
Removed from v.3120  
changed lines
  Added in v.3126

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