Develop and Download Open Source Software

Browse Subversion Repository

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

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

revision 2809 by yutakakn, Sun Apr 3 14:39:48 2005 UTC revision 2811 by yutakakn, Fri Apr 8 14:55:03 2005 UTC
# Line 2010  static int PASCAL FAR TTXProcessCommand( Line 2010  static int PASCAL FAR TTXProcessCommand(
2010          }          }
2011  }  }
2012    
2013    
2014    // 以下はTeraTerm Menuのコード(ttpmenu.cpp)と同一。
2015    // 空白を @ に置き換える。@自身は@@にする。(2005.1.28 yutaka)
2016    static void replace_blank_to_mark(char *str, char *dst, int dst_len)
2017    {
2018            int i, len, n;
2019    
2020            len = strlen(str);
2021            n = 0;
2022            for (i = 0 ; i < len ; i++) {
2023                    if (str[i] == '@')
2024                            n++;
2025            }
2026            if (dst_len < (len + 2*n))
2027                    return;
2028    
2029            for (i = 0 ; i < len ; i++) {
2030                    if (str[i] == '@') {
2031                            *dst++ = '@';
2032                            *dst++ = '@';
2033    
2034                    } else if (str[i] == ' ') {
2035                            *dst++ = '@';
2036    
2037                    } else {
2038                            *dst++ = str[i];
2039    
2040                    }
2041            }
2042            *dst = '\0';
2043    
2044    }
2045    
2046  static void PASCAL FAR TTXSetCommandLine(PCHAR cmd, int cmdlen,  static void PASCAL FAR TTXSetCommandLine(PCHAR cmd, int cmdlen,
2047                                                                                   PGetHNRec rec)                                                                                   PGetHNRec rec)
2048  {  {
# Line 2047  static void PASCAL FAR TTXSetCommandLine Line 2080  static void PASCAL FAR TTXSetCommandLine
2080                          }                          }
2081    
2082                  }                  }
2083    
2084                    // セッション複製の場合は、自動ログイン用パラメータを付ける。(2005.4.8 yutaka)
2085                    if (strstr(buf, "DUPLICATE")) {
2086                            char mark[MAX_PATH];
2087                            char tmp[MAX_PATH*2];
2088    
2089                            // 自動ログインの場合は下記フラグが0のため、必要なコマンドを付加する。
2090                            if (!pvar->hostdlg_Enabled) {
2091                                    _snprintf(tmp, sizeof(tmp), " /ssh /%d", pvar->settings.ssh_protocol_version);
2092                                    strncat(cmd, tmp, cmdlen);
2093                            }
2094    
2095                            if (pvar->auth_state.cur_cred.method == SSH_AUTH_PASSWORD) {
2096                                    replace_blank_to_mark(pvar->auth_state.cur_cred.password, mark, sizeof(mark));
2097                                    _snprintf(tmp, sizeof(tmp), " /auth=password /user=%s /passwd=%s", pvar->auth_state.user, mark);
2098                                    strncat(cmd, tmp, cmdlen);
2099    
2100                            } else if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) {
2101                                    replace_blank_to_mark(pvar->auth_state.cur_cred.password, mark, sizeof(mark));
2102                                    _snprintf(tmp, sizeof(tmp), " /auth=publickey /user=%s /passwd=%s", pvar->auth_state.user, mark);
2103                                    strncat(cmd, tmp, cmdlen);
2104    
2105                                    replace_blank_to_mark(pvar->session_settings.DefaultRSAPrivateKeyFile, mark, sizeof(mark));
2106                                    _snprintf(tmp, sizeof(tmp), " /keyfile=%s", mark);
2107                                    strncat(cmd, tmp, cmdlen);
2108    
2109                            } else if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
2110                                    // keyboard-interactive認証の場合は何もしない。
2111    
2112                            } else {
2113                                    // don't come here
2114    
2115                            }
2116    
2117                    }
2118    
2119          }          }
2120  }  }
2121    
# Line 2195  int CALLBACK LibMain(HANDLE hInstance, W Line 2264  int CALLBACK LibMain(HANDLE hInstance, W
2264    
2265  /*  /*
2266   * $Log: not supported by cvs2svn $   * $Log: not supported by cvs2svn $
2267     * Revision 1.18  2005/04/03 14:39:48  yutakakn
2268     * SSH2 channel lookup機構の追加(ポートフォワーディングのため)。
2269     * TTSSH 2.10で追加したlog dump機構において、DH鍵再作成時にbuffer freeで
2270     * アプリケーションが落ちてしまうバグを修正。
2271     *
2272   * Revision 1.17  2005/03/27 04:39:55  yutakakn   * Revision 1.17  2005/03/27 04:39:55  yutakakn
2273   * SSH2のログ採取(verbose)のデータを追加した。   * SSH2のログ採取(verbose)のデータを追加した。
2274   *   *

Legend:
Removed from v.2809  
changed lines
  Added in v.2811

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