svnno****@sourc*****
svnno****@sourc*****
2011年 10月 22日 (土) 00:58:49 JST
Revision: 4682 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4682 Author: maya Date: 2011-10-22 00:58:49 +0900 (Sat, 22 Oct 2011) Log Message: ----------- ã¯ã©ã¤ã¢ã³ãã¨ãµã¼ãã®ãã¼ã¸ã§ã³ãä¸è´ããªãå ´åã«æ¥ç¶ããªãããã«ãã ã¯ã©ã¤ã¢ã³ãã SSH1 ã§ãµã¼ãã 1.99 ã®å ´åã« SSH2 ã§æ¥ç¶ãããåé¡ãä¿®æ£ http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=26566 Modified Paths: -------------- trunk/doc/en/html/about/history.html trunk/doc/ja/html/about/history.html trunk/installer/release/lang/English.lng trunk/installer/release/lang/French.lng trunk/installer/release/lang/German.lng trunk/installer/release/lang/Japanese.lng trunk/ttssh2/ttxssh/ssh.c -------------- next part -------------- Modified: trunk/doc/en/html/about/history.html =================================================================== --- trunk/doc/en/html/about/history.html 2011-10-17 15:48:21 UTC (rev 4681) +++ trunk/doc/en/html/about/history.html 2011-10-21 15:58:49 UTC (rev 4682) @@ -1745,9 +1745,16 @@ <h3><a name="ttssh_2.59">2011.11.xx (Ver 2.59)</a></h3> <ul class="history"> + <li>Changes + <ul> + <!--li>T[oÌvgRo[WÆwèµ½ SSH Ìo[WªêvµÈ¢êAÚ±µÈ¢æ¤Éµ½B</li--> + </ul> + </li> + <li>Bug fixes <ul> <li>The control characters(^A-^_) can be inputed as the password string on the key generator dialog.</li> + <!--li>T[oÌvgRo[Wª 1.99 ÌêÉAvgRÉ SSH1 ðwèµÄà SSH2 ÅÚ±³êéâèðC³µ½B</li--> </ul> </li> Modified: trunk/doc/ja/html/about/history.html =================================================================== --- trunk/doc/ja/html/about/history.html 2011-10-17 15:48:21 UTC (rev 4681) +++ trunk/doc/ja/html/about/history.html 2011-10-21 15:58:49 UTC (rev 4682) @@ -1746,9 +1746,16 @@ <h3><a name="ttssh_2.59">2011.11.xx (Ver 2.59)</a></h3> <ul class="history"> + <li>ÏX + <ul> + <li>T[oÌvgRo[WÆwèµ½ SSH Ìo[WªêvµÈ¢êAÚ±µÈ¢æ¤Éµ½B</li> + </ul> + </li> + <li>oOC³ <ul> <li>®¶¬_CAOÅpX[hɧä¶(^A-^_)ðüÍÅ«éæ¤Éµ½B</li> + <li>T[oÌvgRo[Wª 1.99 ÌêÉAvgRÉ SSH1 ðwèµÄà SSH2 ÅÚ±³êéâèðC³µ½B</li> </ul> </li> Modified: trunk/installer/release/lang/English.lng =================================================================== --- trunk/installer/release/lang/English.lng 2011-10-17 15:48:21 UTC (rev 4681) +++ trunk/installer/release/lang/English.lng 2011-10-21 15:58:49 UTC (rev 4682) @@ -744,6 +744,7 @@ MSG_SSH_SERVER_DISCON_ERROR=Server disconnected with message '%s'.%s MSG_SSH_SERVER_DISCON_NORES_ERROR=Server disconnected (no reason given).%s MSG_SSH_VERSION_ERROR=This program does not understand the server's version of the protocol. +MSG_SSH_VERSION_MISMATCH=Protocol version mismatch. server:%d.%d client:%d MSG_SSH_SEND_ID_ERROR=An error occurred while sending the SSH ID string.\nThe connection will close. MSG_SSH_UNEXP_MSG2_ERROR=Unexpected SSH2 message(%d) on current stage(%d) MSG_SSH_UNEXP_MSG_ERROR=Unexpected packet type received: %d Modified: trunk/installer/release/lang/French.lng =================================================================== --- trunk/installer/release/lang/French.lng 2011-10-17 15:48:21 UTC (rev 4681) +++ trunk/installer/release/lang/French.lng 2011-10-21 15:58:49 UTC (rev 4682) @@ -736,6 +736,7 @@ MSG_SSH_SERVER_DISCON_ERROR=Serveur déconnecté avec le message '%s'.%s MSG_SSH_SERVER_DISCON_NORES_ERROR=Serveur déconnecté (cause inconnue).%s MSG_SSH_VERSION_ERROR=Ce programme ne comprend pas la version de protocole du serveur. +MSG_SSH_VERSION_MISMATCH=Protocol version mismatch. server:%d.%d client:%d MSG_SSH_SEND_ID_ERROR=Une erreur est survenue en cours d'envoi du SSH ID.\nConnexion coupée. MSG_SSH_UNEXP_MSG2_ERROR=Message inattendu de SSH2(%d) à l'étape courante (%d) MSG_SSH_UNEXP_MSG_ERROR=Reçu un type de paquet inattendu: %d Modified: trunk/installer/release/lang/German.lng =================================================================== --- trunk/installer/release/lang/German.lng 2011-10-17 15:48:21 UTC (rev 4681) +++ trunk/installer/release/lang/German.lng 2011-10-21 15:58:49 UTC (rev 4682) @@ -734,6 +734,7 @@ MSG_SSH_SERVER_DISCON_ERROR=Server disconnected with message '%s'.%s MSG_SSH_SERVER_DISCON_NORES_ERROR=Server disconnected (no reason given).%s MSG_SSH_VERSION_ERROR=This program does not understand the server's version of the protocol. +MSG_SSH_VERSION_MISMATCH=Protocol version mismatch. server:%d.%d client:%d MSG_SSH_SEND_ID_ERROR=An error occurred while sending the SSH ID string.\nThe connection will close. MSG_SSH_UNEXP_MSG2_ERROR=Unexpected SSH2 message(%d) on current stage(%d) MSG_SSH_UNEXP_MSG_ERROR=Unexpected packet type received: %d Modified: trunk/installer/release/lang/Japanese.lng =================================================================== --- trunk/installer/release/lang/Japanese.lng 2011-10-17 15:48:21 UTC (rev 4681) +++ trunk/installer/release/lang/Japanese.lng 2011-10-21 15:58:49 UTC (rev 4682) @@ -744,6 +744,7 @@ MSG_SSH_SERVER_DISCON_ERROR=T[oÉÌRÅØf³êܵ½. '%s'.%s MSG_SSH_SERVER_DISCON_NORES_ERROR=T[o©çØf³êܵ½ (ØfRÍ èܹñ). %s MSG_SSH_VERSION_ERROR=T[oÌvgRo[Wªs¾Å·. +MSG_SSH_VERSION_MISMATCH=vgRo[WªêvµÜ¹ñ. T[o:%d.%d NCAg:%d MSG_SSH_SEND_ID_ERROR=SSH ID ¶ñMÉG[ª¶µÜµ½. \nØfµÜ·. MSG_SSH_UNEXP_MSG2_ERROR=»ÝÌXe[WÅÍzèOÌSSH2 bZ[W(%d) Å·. (%d) MSG_SSH_UNEXP_MSG_ERROR=zèOÌíÊÌpPbgðóMµÜµ½: %d Modified: trunk/ttssh2/ttxssh/ssh.c =================================================================== --- trunk/ttssh2/ttxssh/ssh.c 2011-10-17 15:48:21 UTC (rev 4681) +++ trunk/ttssh2/ttxssh/ssh.c 2011-10-21 15:58:49 UTC (rev 4682) @@ -1605,21 +1605,6 @@ pvar->protocol_major = atoi(ID + 4); pvar->protocol_minor = atoi(str + 1); - // for SSH2(yutaka) - // 1.99ÈçSSH2ÅÌÚ±ðs¤ - if (pvar->protocol_major == 1 && pvar->protocol_minor == 99) { - // [Uª SSH2 ðIðµÄ¢éÌÈçÎ - if (pvar->settings.ssh_protocol_version == 2) { - pvar->protocol_major = 2; - pvar->protocol_minor = 0; - } - - } - - // SSH o[Wð teraterm ¤ÉZbg·é - // SCP R}hÌ½ß (2008.2.3 maya) - pvar->cv->isSSH = pvar->protocol_major; - for (str = str + 1; *str >= '0' && *str <= '9'; str++) { } @@ -1631,22 +1616,41 @@ protocol number. We replace the fields with the protocol number we will actually use, or return FALSE if there is no usable protocol version. */ -static BOOL negotiate_protocol(PTInstVar pvar) +static int negotiate_protocol(PTInstVar pvar) { switch (pvar->protocol_major) { case 1: + if (pvar->protocol_minor == 99 && + pvar->settings.ssh_protocol_version == 2) { + // T[oª 1.99 Å[Uª SSH2 ðIðµÄ¢éÌÈçÎ + // 2.0 ڱƷé + pvar->protocol_major = 2; + pvar->protocol_minor = 0; + return 0; + } + + if (pvar->settings.ssh_protocol_version == 2) { + // o[Wᢠ+ return -1; + } + if (pvar->protocol_minor > 5) { pvar->protocol_minor = 5; } - return TRUE; + return 0; // for SSH2(yutaka) case 2: - return TRUE; // SSH2 support + if (pvar->settings.ssh_protocol_version == 1) { + // o[Wᢠ+ return -1; + } + return 0; // SSH2 support + default: - return FALSE; + return 1; } } @@ -1705,6 +1709,8 @@ BOOL SSH_handle_server_ID(PTInstVar pvar, char FAR * ID, int ID_len) { static char prefix[64]; + int negotiate; + char uimsg[MAX_UIMSG]; // initialize SSH2 memory dump (2005.3.7 yutaka) init_memdump(); @@ -1753,15 +1759,32 @@ pvar->ssh_state.server_ID = _strdup(ID); - if (!parse_protocol_ID(pvar, ID) || !negotiate_protocol(pvar)) { + if (!parse_protocol_ID(pvar, ID)) { UTIL_get_lang_msg("MSG_SSH_VERSION_ERROR", pvar, "This program does not understand the server's version of the protocol."); notify_fatal_error(pvar, pvar->ts->UIMsg); - } else { + } + else if ((negotiate = negotiate_protocol(pvar)) == 1) { + UTIL_get_lang_msg("MSG_SSH_VERSION_ERROR", pvar, + "This program does not understand the server's version of the protocol."); + notify_fatal_error(pvar, pvar->ts->UIMsg); + } + else if (negotiate == -1) { + UTIL_get_lang_msg("MSG_SSH_VERSION_MISMATCH", pvar, + "Protocol version mismatch. server:%d.%d client:%d"); + _snprintf_s(uimsg, sizeof(uimsg), _TRUNCATE, pvar->ts->UIMsg, + pvar->protocol_major, pvar->protocol_minor, pvar->settings.ssh_protocol_version); + notify_fatal_error(pvar, uimsg); + } + else { char TTSSH_ID[1024]; int TTSSH_ID_len; int a, b, c, d; + // SSH o[Wð teraterm ¤ÉZbg·é + // SCP R}hÌ½ß (2008.2.3 maya) + pvar->cv->isSSH = pvar->protocol_major; + // ©ª©gÌo[Wðæ¾·é (2005.3.3 yutaka) get_file_version("ttxssh.dll", &a, &b, &c, &d);