Develop and Download Open Source Software

Browse Subversion Repository

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

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

revision 3151 by maya, Sat Oct 4 09:24:21 2008 UTC revision 3152 by maya, Sat Oct 4 12:37:29 2008 UTC
# Line 1916  int SSH2_dispatch_enabled_check(unsigned Line 1916  int SSH2_dispatch_enabled_check(unsigned
1916    
1917  void SSH2_dispatch_add_message(unsigned char message)  void SSH2_dispatch_add_message(unsigned char message)
1918  {  {
1919            int i;
1920    
1921          if (handle_message_count >= HANDLE_MESSAGE_MAX) {          if (handle_message_count >= HANDLE_MESSAGE_MAX) {
1922                  // TODO: error check                  // TODO: error check
1923                  return;                  return;
1924          }          }
1925    
1926            // すでに登録されているメッセージは追加しない
1927            for (i=0; i<handle_message_count; i++) {
1928                    if (handle_messages[i] == message) {
1929                            return;
1930                    }
1931            }
1932    
1933          handle_messages[handle_message_count++] = message;          handle_messages[handle_message_count++] = message;
1934  }  }
1935    
# Line 6377  BOOL do_SSH2_userauth(PTInstVar pvar) Line 6385  BOOL do_SSH2_userauth(PTInstVar pvar)
6385          // (2007.10.26 maya)          // (2007.10.26 maya)
6386          if (pvar->userauth_retry_count > 0          if (pvar->userauth_retry_count > 0
6387           || pvar->tryed_ssh2_authlist == TRUE) {           || pvar->tryed_ssh2_authlist == TRUE) {
6388                  return handle_SSH2_authrequest(pvar);                  return do_SSH2_authrequest(pvar);
6389                  /* NOT REACHED */                  /* NOT REACHED */
6390          }          }
6391    
# Line 6606  static BOOL handle_SSH2_service_accept(P Line 6614  static BOOL handle_SSH2_service_accept(P
6614          _snprintf(tmp, sizeof(tmp), "SSH2_MSG_SERVICE_ACCEPT is received. service name=%s", s);          _snprintf(tmp, sizeof(tmp), "SSH2_MSG_SERVICE_ACCEPT is received. service name=%s", s);
6615          notify_verbose_message(pvar, tmp, LOG_LEVEL_VERBOSE);          notify_verbose_message(pvar, tmp, LOG_LEVEL_VERBOSE);
6616    
6617            SSH2_dispatch_init(5);
6618            SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround   (2005.3.5 yutaka)
6619            if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
6620                    // keyboard-interactive method
6621                    SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_INFO_REQUEST);
6622            }
6623            else if (pvar->auth_state.cur_cred.method == SSH_AUTH_PAGEANT) {
6624                    // Pageant
6625                    SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_PK_OK);
6626            }
6627            SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_SUCCESS);
6628            SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_FAILURE);
6629            SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_BANNER);
6630            SSH2_dispatch_add_message(SSH2_MSG_DEBUG);  // support for authorized_keys command (2006.2.23 yutaka)
6631    
6632          return do_SSH2_authrequest(pvar);          return do_SSH2_authrequest(pvar);
6633  }  }
6634    
# Line 6667  BOOL do_SSH2_authrequest(PTInstVar pvar) Line 6690  BOOL do_SSH2_authrequest(PTInstVar pvar)
6690                  s = "";  // submethods                  s = "";  // submethods
6691                  buffer_put_string(msg, s, strlen(s));                  buffer_put_string(msg, s, strlen(s));
6692    
6693                    SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_INFO_REQUEST);
6694    
6695          } else if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) { // 公開鍵認証          } else if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) { // 公開鍵認証
6696                  buffer_t *signbuf = NULL;                  buffer_t *signbuf = NULL;
6697                  buffer_t *blob = NULL;                  buffer_t *blob = NULL;
# Line 6756  BOOL do_SSH2_authrequest(PTInstVar pvar) Line 6781  BOOL do_SSH2_authrequest(PTInstVar pvar)
6781    
6782                  pvar->pageant_keycurrent++;                  pvar->pageant_keycurrent++;
6783    
6784                    SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_PK_OK);
6785    
6786          } else {          } else {
6787                  goto error;                  goto error;
6788    
# Line 6769  BOOL do_SSH2_authrequest(PTInstVar pvar) Line 6796  BOOL do_SSH2_authrequest(PTInstVar pvar)
6796          finish_send_packet(pvar);          finish_send_packet(pvar);
6797          buffer_free(msg);          buffer_free(msg);
6798    
         SSH2_dispatch_init(5);  
         SSH2_dispatch_add_message(SSH2_MSG_IGNORE); // XXX: Tru64 UNIX workaround   (2005.3.5 yutaka)  
         if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {  
                 // keyboard-interactive method  
                 SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_INFO_REQUEST);  
         }  
         else if (pvar->auth_state.cur_cred.method == SSH_AUTH_PAGEANT) {  
                 // Pageant  
                 SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_PK_OK);  
         }  
         SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_SUCCESS);  
         SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_FAILURE);  
         SSH2_dispatch_add_message(SSH2_MSG_USERAUTH_BANNER);  
         SSH2_dispatch_add_message(SSH2_MSG_DEBUG);  // support for authorized_keys command (2006.2.23 yutaka)  
   
6799          {          {
6800                  char buf[128];                  char buf[128];
6801                  _snprintf_s(buf, sizeof(buf), _TRUNCATE,                  _snprintf_s(buf, sizeof(buf), _TRUNCATE,

Legend:
Removed from v.3151  
changed lines
  Added in v.3152

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