[Ttssh2-commit] [4601] Camellia を正式サポート

svnno****@sourc***** svnno****@sourc*****
2011年 8月 28日 (日) 23:23:33 JST


Revision: 4601
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4601
Author:   maya
Date:     2011-08-28 23:23:32 +0900 (Sun, 28 Aug 2011)

Log Message:
-----------
Camellia を正式サポート
  "@openssh.org" 付きのほうはコメントアウトしたまま

Modified Paths:
--------------
    trunk/doc/en/html/about/copyright.html
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/copyright.html
    trunk/doc/ja/html/about/history.html
    trunk/ttssh2/ttxssh/cipher-ctr.c
    trunk/ttssh2/ttxssh/config.h
    trunk/ttssh2/ttxssh/crypt.c
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ssh.h
    trunk/ttssh2/ttxssh/ttxssh.c


-------------- next part --------------
Modified: trunk/doc/en/html/about/copyright.html
===================================================================
--- trunk/doc/en/html/about/copyright.html	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/doc/en/html/about/copyright.html	2011-08-28 14:23:32 UTC (rev 4601)
@@ -185,7 +185,7 @@
 TTSSH uses following technologies:
 Key exchange method: diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha1, diffie-hellman-group-exchange-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521
 Public key algorithm of server host key: ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521
-Encryption algorithm: DES, 3DES, AES(128bit,192bit,256bit), Blowfish(128bit), ARCFOUR(128bit,256bit), CAST-128(128bit)
+Encryption algorithm: DES, 3DES, AES(128bit,192bit,256bit), Blowfish(128bit), ARCFOUR(128bit,256bit), CAST-128(128bit). Camellia(128bit,192bit,256bit)
 MAC algorithm: hmac-sha1, hmac-md5, hmac-sha1-96, hmac-md5-96, hmac-****@opens*****, hmac-sha2-256, hmac-sha2-256-96, hmac-sha2-512, hmac-sha2-512-96
 Public key algorithm of public key authentication: ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521
 </pre>

Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/doc/en/html/about/history.html	2011-08-28 14:23:32 UTC (rev 4601)
@@ -1719,6 +1719,7 @@
 <ul class="history">
   <li>Changes
     <ul>
+      <li>added Camellia128-CBC, Camellia128-CTR, Camellia192-CBC, Camellia192-CTR, Camellia256-CBC, Camellia256-CTR symmetric key cipher algorithm for SSH2 protocol.</li>
       <li>added support for SSH2 MAC algorithms: hmac-sha2-256, hmac-sha2-256-96, hmac-sha2-512, hmac-sha2-512-96</li>
       <li>added the PuTTY version on the version dialog.</li>
       <li>removed the random initialization because it takes a long time to connect.</li>

Modified: trunk/doc/ja/html/about/copyright.html
===================================================================
--- trunk/doc/ja/html/about/copyright.html	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/doc/ja/html/about/copyright.html	2011-08-28 14:23:32 UTC (rev 4601)
@@ -172,7 +172,7 @@
 TTSSH‚͈ȉº‚Ì‹Zp‚ð—˜—p‚µ‚Ä‚¢‚Ü‚·:
 Œ®ŒðŠ·•ûŽ®: diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha1, diffie-hellman-group-exchange-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521
 ƒT[ƒoƒzƒXƒgŒ®‚ÌŒöŠJŒ®ƒAƒ‹ƒSƒŠƒYƒ€: ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521
-ˆÃ†‰»ƒAƒ‹ƒSƒŠƒYƒ€: DES, 3DES, AES(128bit,192bit,256bit), Blowfish(128bit), ARCFOUR(128bit,256bit), CAST-128(128bit)
+ˆÃ†‰»ƒAƒ‹ƒSƒŠƒYƒ€: DES, 3DES, AES(128bit,192bit,256bit), Blowfish(128bit), ARCFOUR(128bit,256bit), CAST-128(128bit), Camellia(128bit,192bit,256bit)
 MACƒAƒ‹ƒSƒŠƒYƒ€: hmac-sha1, hmac-md5, hmac-sha1-96, hmac-md5-96, hmac-****@opens*****, hmac-sha2-256, hmac-sha2-256-96, hmac-sha2-512, hmac-sha2-512-96
 ŒöŠJŒ®”FØ‚ÌŒöŠJŒ®ƒAƒ‹ƒSƒŠƒYƒ€: ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521
 </pre>

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/doc/ja/html/about/history.html	2011-08-28 14:23:32 UTC (rev 4601)
@@ -1720,6 +1720,7 @@
 <ul class="history">
   <li>•ÏX
     <ul>
+      <li>SSH2 ‚Ì‹¤’ÊŒ®ˆÃ†•ûŽ®‚É Camellia128-CBC, Camellia128-CTR, Camellia192-CBC, Camellia192-CTR, Camellia256-CBC, Camellia256-CTR ‚ð’ljÁ‚µ‚½B</li>
       <li>SSH2 ‚Ì MAC ƒAƒ‹ƒSƒŠƒYƒ€‚Æ‚µ‚Ä hmac-sha2-256, hmac-sha2-256-96, hmac-sha2-512, hmac-sha2-512-96 ‚ðƒTƒ|[ƒg‚µ‚½B</li>
       <li>ƒo[ƒWƒ‡ƒ“ƒ_ƒCƒAƒƒO‚ɁAPuTTY‚̃o[ƒWƒ‡ƒ“‚ð•\‹L‚·‚é‚悤‚É‚µ‚½B</li>
       <li>Ú‘±Žž‚ÉŽžŠÔ‚ª‚©‚©‚邽‚߁AÈ—ª‚Å‚«‚闐”‚̏‰Šú‰»‚ðíœ‚µ‚½B</li>

Modified: trunk/ttssh2/ttxssh/cipher-ctr.c
===================================================================
--- trunk/ttssh2/ttxssh/cipher-ctr.c	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/ttssh2/ttxssh/cipher-ctr.c	2011-08-28 14:23:32 UTC (rev 4601)
@@ -28,14 +28,10 @@
 #include <openssl/des.h>
 #include <openssl/blowfish.h>
 #include <openssl/cast.h>
-#ifdef WITH_CAMELLIA_DRAFT
 #include <openssl/camellia.h>
-#endif // WITH_CAMELLIA_DRAFT
 
 extern const EVP_CIPHER *evp_aes_128_ctr(void);
-#ifdef WITH_CAMELLIA_DRAFT
 extern const EVP_CIPHER *evp_camellia_128_ctr(void);
-#endif // WITH_CAMELLIA_DRAFT
 
 struct ssh_aes_ctr_ctx
 {
@@ -62,13 +58,11 @@
 	unsigned char	cast5_counter[CAST_BLOCK];
 };
 
-#ifdef WITH_CAMELLIA_DRAFT
 struct ssh_camellia_ctr_ctx
 {
 	CAMELLIA_KEY	camellia_ctx;
 	unsigned char	camellia_counter[CAMELLIA_BLOCK_SIZE];
 };
-#endif // WITH_CAMELLIA_DRAFT
 
 static void
 ssh_ctr_inc(unsigned char *ctr, unsigned int len)
@@ -421,7 +415,6 @@
 	return (&cast5_ctr);
 }
 
-#ifdef WITH_CAMELLIA_DRAFT
 //============================================================================
 // Camellia
 //============================================================================
@@ -507,4 +500,3 @@
 #endif
 	return (&camellia_ctr);
 }
-#endif // WITH_CAMELLIA_DRAFT

Modified: trunk/ttssh2/ttxssh/config.h
===================================================================
--- trunk/ttssh2/ttxssh/config.h	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/ttssh2/ttxssh/config.h	2011-08-28 14:23:32 UTC (rev 4601)
@@ -5,9 +5,4 @@
 // Camellia support draft
 // http://tools.ietf.org/html/draft-kanno-secsh-camellia-02
 // https://bugzilla.mindrot.org/show_bug.cgi?id=1340
-#undef WITH_CAMELLIA_DRAFT
 #undef WITH_CAMELLIA_PRIVATE
-
-#if defined(WITH_CAMELLIA_PRIVATE) && !defined(WITH_CAMELLIA_DRAFT)
-#define WITH_CAMELLIA_DRAFT
-#endif

Modified: trunk/ttssh2/ttxssh/crypt.c
===================================================================
--- trunk/ttssh2/ttxssh/crypt.c	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/ttssh2/ttxssh/crypt.c	2011-08-28 14:23:32 UTC (rev 4601)
@@ -647,7 +647,6 @@
 	free(newbuf);
 }
 
-#ifdef WITH_CAMELLIA_DRAFT
 static void cCamellia_encrypt(PTInstVar pvar, unsigned char FAR * buf,
                              int bytes)
 {
@@ -725,7 +724,6 @@
 error:
 	free(newbuf);
 }
-#endif // WITH_CAMELLIA_DRAFT
 
 static void c3DES_encrypt(PTInstVar pvar, unsigned char FAR * buf,
                           int bytes)
@@ -964,14 +962,12 @@
 		            | (1 << SSH2_CIPHER_3DES_CTR)
 		            | (1 << SSH2_CIPHER_BLOWFISH_CTR)
 		            | (1 << SSH2_CIPHER_CAST128_CTR)
-#ifdef WITH_CAMELLIA_DRAFT
 		            | (1 << SSH2_CIPHER_CAMELLIA128_CBC)
 		            | (1 << SSH2_CIPHER_CAMELLIA192_CBC)
 		            | (1 << SSH2_CIPHER_CAMELLIA256_CBC)
 		            | (1 << SSH2_CIPHER_CAMELLIA128_CTR)
 		            | (1 << SSH2_CIPHER_CAMELLIA192_CTR)
 		            | (1 << SSH2_CIPHER_CAMELLIA256_CTR)
-#endif // WITH_CAMELLIA_DRAFT
 		);
 	}
 
@@ -1545,7 +1541,6 @@
 				break;
 			}
 
-#ifdef WITH_CAMELLIA_DRAFT
 		case SSH2_CIPHER_CAMELLIA128_CBC:
 		case SSH2_CIPHER_CAMELLIA192_CBC:
 		case SSH2_CIPHER_CAMELLIA256_CBC:
@@ -1570,7 +1565,6 @@
 				pvar->crypt_state.encrypt = cCamellia_encrypt;
 				break;
 			}
-#endif // WITH_CAMELLIA_DRAFT
 
 		case SSH_CIPHER_3DES:{
 				c3DES_init(encryption_key, &pvar->crypt_state.enc.c3DES);
@@ -1719,7 +1713,6 @@
 				break;
 			}
 
-#ifdef WITH_CAMELLIA_DRAFT
 		case SSH2_CIPHER_CAMELLIA128_CBC:
 		case SSH2_CIPHER_CAMELLIA192_CBC:
 		case SSH2_CIPHER_CAMELLIA256_CBC:
@@ -1744,7 +1737,6 @@
 				pvar->crypt_state.decrypt = cCamellia_decrypt;
 				break;
 			}
-#endif // WITH_CAMELLIA_DRAFT
 
 		case SSH_CIPHER_3DES:{
 				c3DES_init(decryption_key, &pvar->crypt_state.dec.c3DES);
@@ -1851,7 +1843,6 @@
 		return "Blowfish-CTR";
 	case SSH2_CIPHER_CAST128_CTR:
 		return "CAST-128-CTR";
-#ifdef WITH_CAMELLIA_DRAFT
 	case SSH2_CIPHER_CAMELLIA128_CBC:
 		return "Camellia128-CBC";
 	case SSH2_CIPHER_CAMELLIA192_CBC:
@@ -1864,7 +1855,6 @@
 		return "Camellia192-CTR";
 	case SSH2_CIPHER_CAMELLIA256_CTR:
 		return "Camellia256-CTR";
-#endif // WITH_CAMELLIA_DRAFT
 
 	default:
 		return "Unknown";

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/ttssh2/ttxssh/ssh.c	2011-08-28 14:23:32 UTC (rev 4601)
@@ -4264,7 +4264,6 @@
 			case SSH2_CIPHER_CAST128_CTR:
 				c_str = "cast128-ctr,";
 				break;
-#ifdef WITH_CAMELLIA_DRAFT
 #ifdef WITH_CAMELLIA_PRIVATE
 			case SSH2_CIPHER_CAMELLIA128_CBC:
 				c_str = "camellia128-cbc,camel****@opens*****,";
@@ -4284,7 +4283,7 @@
 			case SSH2_CIPHER_CAMELLIA256_CTR:
 				c_str = "camellia256-ctr,camel****@opens*****,";
 				break;
-#else // WITH_CAMELLIA_PRIVATE
+#endif // WITH_CAMELLIA_PRIVATE
 			case SSH2_CIPHER_CAMELLIA128_CBC:
 				c_str = "camellia128-cbc,";
 				break;
@@ -4303,8 +4302,6 @@
 			case SSH2_CIPHER_CAMELLIA256_CTR:
 				c_str = "camellia256-ctr,";
 				break;
-#endif // WITH_CAMELLIA_PRIVATE
-#endif // WITH_CAMELLIA_DRAFT
 			default:
 				continue;
 		}
@@ -6065,14 +6062,12 @@
 	                       | 1 << SSH2_CIPHER_3DES_CTR
 	                       | 1 << SSH2_CIPHER_BLOWFISH_CTR
 	                       | 1 << SSH2_CIPHER_CAST128_CTR
-#ifdef WITH_CAMELLIA_DRAFT
 	                       | 1 << SSH2_CIPHER_CAMELLIA128_CBC
 	                       | 1 << SSH2_CIPHER_CAMELLIA192_CBC
 	                       | 1 << SSH2_CIPHER_CAMELLIA256_CBC
 	                       | 1 << SSH2_CIPHER_CAMELLIA128_CTR
 	                       | 1 << SSH2_CIPHER_CAMELLIA192_CTR
 	                       | 1 << SSH2_CIPHER_CAMELLIA256_CTR
-#endif // WITH_CAMELLIA_DRAFT
 	);
 	int type = (1 << SSH_AUTH_PASSWORD) | (1 << SSH_AUTH_RSA) |
 	           (1 << SSH_AUTH_TIS) | (1 << SSH_AUTH_PAGEANT);

Modified: trunk/ttssh2/ttxssh/ssh.h
===================================================================
--- trunk/ttssh2/ttxssh/ssh.h	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/ttssh2/ttxssh/ssh.h	2011-08-28 14:23:32 UTC (rev 4601)
@@ -51,9 +51,7 @@
 extern const EVP_CIPHER *evp_des3_ctr(void);
 extern const EVP_CIPHER *evp_bf_ctr(void);
 extern const EVP_CIPHER *evp_cast5_ctr(void);
-#ifdef WITH_CAMELLIA_DRAFT
 extern const EVP_CIPHER *evp_camellia_128_ctr(void);
-#endif // WITH_CAMELLIA_DRAFT
 
 /* Some of this code has been adapted from Ian Goldberg's Pilot SSH */
 
@@ -91,13 +89,9 @@
 	SSH2_CIPHER_ARCFOUR, SSH2_CIPHER_ARCFOUR128, SSH2_CIPHER_ARCFOUR256,
 	SSH2_CIPHER_CAST128_CBC,
 	SSH2_CIPHER_3DES_CTR, SSH2_CIPHER_BLOWFISH_CTR, SSH2_CIPHER_CAST128_CTR,
-#ifdef WITH_CAMELLIA_DRAFT
 	SSH2_CIPHER_CAMELLIA128_CBC, SSH2_CIPHER_CAMELLIA192_CBC, SSH2_CIPHER_CAMELLIA256_CBC,
 	SSH2_CIPHER_CAMELLIA128_CTR, SSH2_CIPHER_CAMELLIA192_CTR, SSH2_CIPHER_CAMELLIA256_CTR,
 	SSH_CIPHER_MAX = SSH2_CIPHER_CAMELLIA256_CTR,
-#else // WITH_CAMELLIA_DRAFT
-	SSH_CIPHER_MAX = SSH2_CIPHER_CAST128_CTR,
-#endif // WITH_CAMELLIA_DRAFT
 } SSHCipher;
 
 typedef enum {
@@ -300,7 +294,6 @@
 	{SSH2_CIPHER_3DES_CTR,        "3des-ctr",         8, 24,    0, evp_des3_ctr},         // RFC4344
 	{SSH2_CIPHER_BLOWFISH_CTR,    "blowfish-ctr",     8, 16,    0, evp_bf_ctr},           // RFC4344
 	{SSH2_CIPHER_CAST128_CTR,     "cast128-ctr",      8, 16,    0, evp_cast5_ctr},        // RFC4344
-#ifdef WITH_CAMELLIA_DRAFT
 	{SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc", 16, 16,    0, EVP_camellia_128_cbc}, // draft-kanno-secsh-camellia-02
 	{SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc", 16, 24,    0, EVP_camellia_192_cbc}, // draft-kanno-secsh-camellia-02
 	{SSH2_CIPHER_CAMELLIA256_CBC, "camellia256-cbc", 16, 32,    0, EVP_camellia_256_cbc}, // draft-kanno-secsh-camellia-02
@@ -315,7 +308,6 @@
 	{SSH2_CIPHER_CAMELLIA192_CTR, "camel****@opens*****", 16, 24, 0, evp_camellia_128_ctr},
 	{SSH2_CIPHER_CAMELLIA256_CTR, "camel****@opens*****", 16, 32, 0, evp_camellia_128_ctr},
 #endif // WITH_CAMELLIA_PRIVATE
-#endif // WITH_CAMELLIA_DRAFT
 	{SSH_CIPHER_NONE,          NULL,            0,  0, 0,    NULL},
 };
 

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2011-08-28 14:02:55 UTC (rev 4600)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2011-08-28 14:23:32 UTC (rev 4601)
@@ -234,7 +234,6 @@
 #else
 	// for SSH2(yutaka)
 	static char default_strings[] = {
-#ifdef WITH_CAMELLIA_DRAFT
 		SSH2_CIPHER_CAMELLIA256_CTR,
 		SSH2_CIPHER_AES256_CTR,
 		SSH2_CIPHER_CAMELLIA256_CBC,
@@ -247,14 +246,6 @@
 		SSH2_CIPHER_AES128_CTR,
 		SSH2_CIPHER_CAMELLIA128_CBC,
 		SSH2_CIPHER_AES128_CBC,
-#else // WITH_CAMELLIA_DRAFT
-		SSH2_CIPHER_AES256_CTR,
-		SSH2_CIPHER_AES256_CBC,
-		SSH2_CIPHER_AES192_CTR,
-		SSH2_CIPHER_AES192_CBC,
-		SSH2_CIPHER_AES128_CTR,
-		SSH2_CIPHER_AES128_CBC,
-#endif // WITH_CAMELLIA_DRAFT
 		SSH2_CIPHER_3DES_CTR,
 		SSH2_CIPHER_3DES_CBC,
 		SSH2_CIPHER_BLOWFISH_CTR,
@@ -2338,11 +2329,7 @@
 	// TTSSH‚̃o[ƒWƒ‡ƒ“‚ðÝ’è‚·‚é (2005.2.28 yutaka)
 	get_file_version("ttxssh.dll", &a, &b, &c, &d);
 	_snprintf_s(buf, sizeof(buf), _TRUNCATE,
-#ifdef WITH_CAMELLIA_DRAFT
-		"TTSSH\r\nTera Term Secure Shell extension, %d.%d with Camellia support", a, b);
-#else
-		"TTSSH\r\nTera Term Secure Shell extension, %d.%d", a, b);
-#endif
+	            "TTSSH\r\nTera Term Secure Shell extension, %d.%d", a, b);
 	SendMessage(GetDlgItem(dlg, IDC_TTSSH_VERSION), WM_SETTEXT, 0, (LPARAM)buf);
 
 	// OpenSSL‚̃o[ƒWƒ‡ƒ“‚ðÝ’è‚·‚é (2005.1.24 yutaka)
@@ -2557,7 +2544,6 @@
 		return "Blowfish-CTR(SSH2)";
 	case SSH2_CIPHER_CAST128_CTR:
 		return "CAST128-CTR(SSH2)";
-#ifdef WITH_CAMELLIA_DRAFT
 	case SSH2_CIPHER_CAMELLIA128_CBC:
 		return "Camellia128-CBC(SSH2)";
 	case SSH2_CIPHER_CAMELLIA192_CBC:
@@ -2570,7 +2556,6 @@
 		return "Camellia192-CTR(SSH2)";
 	case SSH2_CIPHER_CAMELLIA256_CTR:
 		return "Camellia256-CTR(SSH2)";
-#endif // WITH_CAMELLIA_DRAFT
 
 	default:
 		return NULL;



Ttssh2-commit メーリングリストの案内