svnno****@sourc*****
svnno****@sourc*****
2010年 12月 10日 (金) 16:58:34 JST
Revision: 4212 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4212 Author: doda Date: 2010-12-10 16:58:34 +0900 (Fri, 10 Dec 2010) Log Message: ----------- åæå·æ¹å¼ã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ãå ±éã«ããã # ä¸å¿ä¸éããã§ãã¯ããã¤ããã ãã©â¦ ãã¹ãã¦ãã¾ããããã«â¦ Modified Paths: -------------- 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/crypt.c -------------- next part -------------- Modified: trunk/installer/release/lang/English.lng =================================================================== --- trunk/installer/release/lang/English.lng 2010-12-10 05:41:50 UTC (rev 4211) +++ trunk/installer/release/lang/English.lng 2010-12-10 07:58:34 UTC (rev 4212) @@ -632,26 +632,10 @@ DLG_UNKNOWNHOST_ADD=&Add this machine and its key to the known hosts list ; crypt.c -MSG_AES128_ENCRYPT_ERROR1=AES128/192/256 encrypt error(1): bytes %d (%d) -MSG_AES128_ENCRYPT_ERROR2=AES128/192/256 encrypt error(2) -MSG_AES128_DECRYPT_ERROR1=AES128/192/256 decrypt error(1): bytes %d (%d) -MSG_AES128_DECRYPT_ERROR2=AES128/192/256 decrypt error(2) -MSG_3DESCBC_ENCRYPT_ERROR1=3DES-CBC encrypt error(1): bytes %d (%d) -MSG_3DESCBC_ENCRYPT_ERROR2=3DES-CBC encrypt error(2) -MSG_3DESCBC_DECRYPT_ERROR1=3DES-CBC decrypt error(1): bytes %d (%d) -MSG_3DESCBC_DECRYPT_ERROR2=3DES-CBC decrypt error(2) -MSG_BLOWFISH_ENCRYPT_ERROR1=Blowfish encrypt error(1): bytes %d (%d) -MSG_BLOWFISH_ENCRYPT_ERROR2=Blowfish encrypt error(2) -MSG_BLOWFISH_DECRYPT_ERROR1=Blowfish decrypt error(1): bytes %d (%d) -MSG_BLOWFISH_DECRYPT_ERROR2=Blowfish decrypt error(2) -MSG_ARCFOUR_ENCRYPT_ERROR1=Arcfour encrypt error(1): bytes %d (%d) -MSG_ARCFOUR_ENCRYPT_ERROR2=Arcfour encrypt error(2) -MSG_ARCFOUR_DECRYPT_ERROR1=Arcfour decrypt error(1): bytes %d (%d) -MSG_ARCFOUR_DECRYPT_ERROR2=Arcfour decrypt error(2) -MSG_CAST128_ENCRYPT_ERROR1=CAST128 encrypt error(1): bytes %d (%d) -MSG_CAST128_ENCRYPT_ERROR2=CAST128 encrypt error(2) -MSG_CAST128_DECRYPT_ERROR1=CAST128 decrypt error(1): bytes %d (%d) -MSG_CAST128_DECRYPT_ERROR2=CAST128 decrypt error(2) +MSG_ENCRYPT_ERROR1=%s encrypt error(1): bytes %d (%d) +MSG_ENCRYPT_ERROR2=%s encrypt error(2) +MSG_DECRYPT_ERROR1=%s decrypt error(1): bytes %d (%d) +MSG_DECRYPT_ERROR2=%s decrypt error(2) MSG_CIPHER_INIT_ERROR=Cipher initialize error(%d) MSG_RSAKEY_SETUP_ERROR=Error setting up RSA keys MSG_UNAVAILABLE_CIPHERS_ERROR=The server does not support any of the TTSSH encryption algorithms.\nA secure connection cannot be made in the TTSSH-to-server direction.\nThe connection will be closed. Modified: trunk/installer/release/lang/French.lng =================================================================== --- trunk/installer/release/lang/French.lng 2010-12-10 05:41:50 UTC (rev 4211) +++ trunk/installer/release/lang/French.lng 2010-12-10 07:58:34 UTC (rev 4212) @@ -631,26 +631,10 @@ DLG_UNKNOWNHOST_ADD=&Ajouter cette machine et sa clé à la liste des hôtes connus ; crypt.c -MSG_AES128_ENCRYPT_ERROR1=AES128/192/256 erreur cryptage(1): octets %d (%d) -MSG_AES128_ENCRYPT_ERROR2=AES128/192/256 erreur cryptage(2) -MSG_AES128_DECRYPT_ERROR1=AES128/192/256 erreur décryptage(1): octets %d (%d) -MSG_AES128_DECRYPT_ERROR2=AES128/192/256 erreur décryptage(2) -MSG_3DESCBC_ENCRYPT_ERROR1=3DES-CBC erreur cryptage(1): octets %d (%d) -MSG_3DESCBC_ENCRYPT_ERROR2=3DES-CBC erreur cryptage(2) -MSG_3DESCBC_DECRYPT_ERROR1=3DES-CBC erreur décryptage(1): octets %d (%d) -MSG_3DESCBC_DECRYPT_ERROR2=3DES-CBC erreur décryptage(2) -MSG_BLOWFISH_ENCRYPT_ERROR1=Blowfish erreur cryptage(1): octets %d (%d) -MSG_BLOWFISH_ENCRYPT_ERROR2=Blowfish erreur cryptage(2) -MSG_BLOWFISH_DECRYPT_ERROR1=Blowfish erreur décryptage(1): octets %d (%d) -MSG_BLOWFISH_DECRYPT_ERROR2=Blowfish erreur décryptage(2) -MSG_ARCFOUR_ENCRYPT_ERROR1=Arcfour erreur cryptage(1): octets %d (%d) -MSG_ARCFOUR_ENCRYPT_ERROR2=Arcfour erreur cryptage(2) -MSG_ARCFOUR_DECRYPT_ERROR1=Arcfour erreur décryptage(1): octets %d (%d) -MSG_ARCFOUR_DECRYPT_ERROR2=Arcfour erreur décryptage(2) -MSG_CAST128_ENCRYPT_ERROR1=CAST128 erreur cryptage(1): octets %d (%d) -MSG_CAST128_ENCRYPT_ERROR2=CAST128 erreur cryptage(2) -MSG_CAST128_DECRYPT_ERROR1=CAST128 erreur décryptage(1): octets %d (%d) -MSG_CAST128_DECRYPT_ERROR2=CAST128 erreur décryptage(2) +MSG_ENCRYPT_ERROR1=%s erreur cryptage(1): octets %d (%d) +MSG_ENCRYPT_ERROR2=%s erreur cryptage(2) +MSG_DECRYPT_ERROR1=%s erreur décryptage(1): octets %d (%d) +MSG_DECRYPT_ERROR2=%s erreur décryptage(2) MSG_CIPHER_INIT_ERROR=Erreur initialisation chiffrement(%d) MSG_RSAKEY_SETUP_ERROR=Erreur configurations clés RSA MSG_UNAVAILABLE_CIPHERS_ERROR=Le serveur ne suppote aucun des algorithmes de cryptage TTSSH.\nUne connexion sécurisée ne peut être établie avec le serveur.\nLa connexion va être fermée. Modified: trunk/installer/release/lang/German.lng =================================================================== --- trunk/installer/release/lang/German.lng 2010-12-10 05:41:50 UTC (rev 4211) +++ trunk/installer/release/lang/German.lng 2010-12-10 07:58:34 UTC (rev 4212) @@ -629,26 +629,10 @@ DLG_UNKNOWNHOST_ADD=Den Server zur "known hosts"-Liste hinzufügen. ; crypt.c -MSG_AES128_ENCRYPT_ERROR1=AES128/192/256 encrypt error(1): bytes %d (%d) -MSG_AES128_ENCRYPT_ERROR2=AES128/192/256 encrypt error(2) -MSG_AES128_DECRYPT_ERROR1=AES128/192/256 decrypt error(1): bytes %d (%d) -MSG_AES128_DECRYPT_ERROR2=AES128/192/256 decrypt error(2) -MSG_3DESCBC_ENCRYPT_ERROR1=3DES-CBC encrypt error(1): bytes %d (%d) -MSG_3DESCBC_ENCRYPT_ERROR2=3DES-CBC encrypt error(2) -MSG_3DESCBC_DECRYPT_ERROR1=3DES-CBC decrypt error(1): bytes %d (%d) -MSG_3DESCBC_DECRYPT_ERROR2=3DES-CBC decrypt error(2) -MSG_BLOWFISH_ENCRYPT_ERROR1=Blowfish encrypt error(1): bytes %d (%d) -MSG_BLOWFISH_ENCRYPT_ERROR2=Blowfish encrypt error(2) -MSG_BLOWFISH_DECRYPT_ERROR1=Blowfish decrypt error(1): bytes %d (%d) -MSG_BLOWFISH_DECRYPT_ERROR2=Blowfish decrypt error(2) -MSG_ARCFOUR_ENCRYPT_ERROR1=Arcfour encrypt error(1): bytes %d (%d) -MSG_ARCFOUR_ENCRYPT_ERROR2=Arcfour encrypt error(2) -MSG_ARCFOUR_DECRYPT_ERROR1=Arcfour decrypt error(1): bytes %d (%d) -MSG_ARCFOUR_DECRYPT_ERROR2=Arcfour decrypt error(2) -MSG_CAST128_ENCRYPT_ERROR1=CAST128 encrypt error(1): bytes %d (%d) -MSG_CAST128_ENCRYPT_ERROR2=CAST128 encrypt error(2) -MSG_CAST128_DECRYPT_ERROR1=CAST128 decrypt error(1): bytes %d (%d) -MSG_CAST128_DECRYPT_ERROR2=CAST128 decrypt error(2) +MSG_ENCRYPT_ERROR1=%s encrypt error(1): bytes %d (%d) +MSG_ENCRYPT_ERROR2=%s encrypt error(2) +MSG_DECRYPT_ERROR1=%s decrypt error(1): bytes %d (%d) +MSG_DECRYPT_ERROR2=%s decrypt error(2) MSG_CIPHER_INIT_ERROR=Cipher initialize error(%d) MSG_RSAKEY_SETUP_ERROR=Error setting up RSA keys MSG_UNAVAILABLE_CIPHERS_ERROR=The server does not support any of the TTSSH encryption algorithms.\nA secure connection cannot be made in the TTSSH-to-server direction.\nThe connection will be closed. Modified: trunk/installer/release/lang/Japanese.lng =================================================================== --- trunk/installer/release/lang/Japanese.lng 2010-12-10 05:41:50 UTC (rev 4211) +++ trunk/installer/release/lang/Japanese.lng 2010-12-10 07:58:34 UTC (rev 4212) @@ -632,26 +632,10 @@ DLG_UNKNOWNHOST_ADD=±ÌzXgðknown hostsXgÉÇÁ·é(&A) ; crypt.c -MSG_AES128_ENCRYPT_ERROR1=AES128/192/256ûG[(1): bytes %d (%d) -MSG_AES128_ENCRYPT_ERROR2=AES128/192/256ûG[(2) -MSG_AES128_DECRYPT_ERROR1=AES128/192/256G[(1): bytes %d (%d) -MSG_AES128_DECRYPT_ERROR2=AES128/192/256G[(2) -MSG_3DESCBC_ENCRYPT_ERROR1=3DES-CBCûG[(1): bytes %d (%d) -MSG_3DESCBC_ENCRYPT_ERROR2=3DES-CBCûG[(2) -MSG_3DESCBC_DECRYPT_ERROR1=3DES-CBCG[(1): bytes %d (%d) -MSG_3DESCBC_DECRYPT_ERROR2=3DES-CBCG[(2) -MSG_BLOWFISH_ENCRYPT_ERROR1=BlowfishûG[(1): bytes %d (%d) -MSG_BLOWFISH_ENCRYPT_ERROR2=BlowfishûG[(2) -MSG_BLOWFISH_DECRYPT_ERROR1=BlowfishG[(1): bytes %d (%d) -MSG_BLOWFISH_DECRYPT_ERROR2=BlowfishG[(2) -MSG_ARCFOUR_ENCRYPT_ERROR1=ArcfourûG[(1): bytes %d (%d) -MSG_ARCFOUR_ENCRYPT_ERROR2=ArcfourûG[(2) -MSG_ARCFOUR_DECRYPT_ERROR1=ArcfourG[(1): bytes %d (%d) -MSG_ARCFOUR_DECRYPT_ERROR2=ArcfourG[(2) -MSG_CAST128_ENCRYPT_ERROR1=CAST128ûG[(1): bytes %d (%d) -MSG_CAST128_ENCRYPT_ERROR2=CAST128ûG[(2) -MSG_CAST128_DECRYPT_ERROR1=CAST128G[(1): bytes %d (%d) -MSG_CAST128_DECRYPT_ERROR2=CAST128G[(2) +MSG_ENCRYPT_ERROR1=%sûG[(1): bytes %d (%d) +MSG_ENCRYPT_ERROR2=%sûG[(2) +MSG_DECRYPT_ERROR1=%sG[(1): bytes %d (%d) +MSG_DECRYPT_ERROR2=%sG[(2) MSG_CIPHER_INIT_ERROR=Ãú»G[(%d) MSG_RSAKEY_SETUP_ERROR=RSA ®ÝèG[ MSG_UNAVAILABLE_CIPHERS_ERROR=±ÌT[oÍTTSSH ÃASYðT|[gµÄ¢Ü¹ñ.\nTTSSHÆT[oÔÌZL AÈÚ±ðm§Å«Ü¹ñ.\nÚ±ð¶ܷ. Modified: trunk/ttssh2/ttxssh/crypt.c =================================================================== --- trunk/ttssh2/ttxssh/crypt.c 2010-12-10 05:41:50 UTC (rev 4211) +++ trunk/ttssh2/ttxssh/crypt.c 2010-12-10 07:58:34 UTC (rev 4212) @@ -221,6 +221,7 @@ { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_OUT].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -230,19 +231,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_AES128_ENCRYPT_ERROR1", pvar, - "AES128/192/256 encrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, - pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR1", pvar, + "%s encrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "AES128/192/256", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_AES128_ENCRYPT_ERROR2", pvar, - "AES128/192/256 encrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "AES128/192/256"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -268,6 +269,7 @@ { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_IN].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -277,18 +279,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_AES128_DECRYPT_ERROR1", pvar, - "AES128/192/256 decrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR1", pvar, + "%s decrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "AES128/192/256", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_AES128_DECRYPT_ERROR2", pvar, - "AES128/192/256 decrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "AES128/192/256"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -310,13 +313,13 @@ } - // for SSH2(yutaka) static void c3DES_encrypt2(PTInstVar pvar, unsigned char FAR * buf, - int bytes) + int bytes) { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_OUT].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -326,19 +329,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_3DESCBC_ENCRYPT_ERROR1", pvar, - "3DES-CBC encrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, - pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR1", pvar, + "%s encrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "3DES-CBC", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_3DESCBC_ENCRYPT_ERROR2", pvar, - "3DES-CBC encrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "3DES-CBC"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -360,10 +363,11 @@ } static void c3DES_decrypt2(PTInstVar pvar, unsigned char FAR * buf, - int bytes) + int bytes) { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_IN].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -373,18 +377,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_3DESCBC_DECRYPT_ERROR1", pvar, - "3DES-CBC decrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR1", pvar, + "%s decrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "3DES-CBC", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_3DESCBC_DECRYPT_ERROR2", pvar, - "3DES-CBC decrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "3DES-CBC"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -411,6 +416,7 @@ { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_OUT].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -420,19 +426,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_BLOWFISH_ENCRYPT_ERROR1", pvar, - "Blowfish encrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, - pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR1", pvar, + "%s encrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "Blowfish", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_BLOWFISH_ENCRYPT_ERROR2", pvar, - "Blowfish encrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "Blowfish"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -449,6 +455,7 @@ { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_IN].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -458,18 +465,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_BLOWFISH_DECRYPT_ERROR1", pvar, - "Blowfish decrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR1", pvar, + "%s decrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "Blowfish", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_BLOWFISH_DECRYPT_ERROR2", pvar, - "Blowfish decrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "Blowfish"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -481,11 +489,13 @@ free(newbuf); } + static void cArcfour_encrypt(PTInstVar pvar, unsigned char FAR * buf, - int bytes) + int bytes) { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_OUT].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -495,19 +505,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_ARCFOUR_ENCRYPT_ERROR1", pvar, - "Arcfour encrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, - pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR1", pvar, + "%s encrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "Arcfour", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_ARCFOUR_ENCRYPT_ERROR2", pvar, - "Arcfour encrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "Arcfour"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -520,10 +530,11 @@ } static void cArcfour_decrypt(PTInstVar pvar, unsigned char FAR * buf, - int bytes) + int bytes) { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_IN].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -533,18 +544,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_ARCFOUR_DECRYPT_ERROR1", pvar, - "Arcfour decrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR1", pvar, + "%s decrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "Arcfour", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_ARCFOUR_DECRYPT_ERROR2", pvar, - "Arcfour decrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "Arcfour"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -556,11 +568,13 @@ free(newbuf); } + static void cCast128_encrypt(PTInstVar pvar, unsigned char FAR * buf, int bytes) { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_OUT].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -570,19 +584,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_CAST128_ENCRYPT_ERROR1", pvar, - "CAST128 encrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, - pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR1", pvar, + "%s encrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "CAST128", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_CAST128_ENCRYPT_ERROR2", pvar, - "CAST128 encrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "CAST128"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -599,6 +613,7 @@ { unsigned char *newbuf = malloc(bytes); int block_size = pvar->ssh2_keys[MODE_IN].enc.block_size; + char tmp[80]; // O»ÉæèASyC[hª»³êÄ¢éêÍA0oCgÉÈéB(2004.11.7 yutaka) if (bytes == 0) @@ -608,18 +623,19 @@ return; if (bytes % block_size) { - char tmp[80]; - UTIL_get_lang_msg("MSG_CAST128_DECRYPT_ERROR1", pvar, - "CAST128 decrypt error(1): bytes %d (%d)"); - _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, bytes, block_size); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR1", pvar, + "%s decrypt error(1): bytes %d (%d)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "CAST128", bytes, block_size); notify_fatal_error(pvar, tmp); goto error; } if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) { - UTIL_get_lang_msg("MSG_CAST128_DECRYPT_ERROR2", pvar, - "CAST128 decrypt error(2)"); - notify_fatal_error(pvar, pvar->ts->UIMsg); + UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)"); + _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg, + "CAST128"); + notify_fatal_error(pvar, tmp); goto error; } else { @@ -632,7 +648,6 @@ } - static void c3DES_encrypt(PTInstVar pvar, unsigned char FAR * buf, int bytes) {