[Ttssh2-commit] [6714] IDEA / RC4(SSH1) 関連のコードを削除。

svnno****@sourc***** svnno****@sourc*****
2017年 5月 12日 (金) 21:41:49 JST


Revision: 6714
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6714
Author:   doda
Date:     2017-05-12 21:41:49 +0900 (Fri, 12 May 2017)
Log Message:
-----------
IDEA / RC4(SSH1) 関連のコードを削除。

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/crypt.c
    trunk/ttssh2/ttxssh/crypt.h
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/crypt.c
===================================================================
--- trunk/ttssh2/ttxssh/crypt.c	2017-05-12 12:41:42 UTC (rev 6713)
+++ trunk/ttssh2/ttxssh/crypt.c	2017-05-12 12:41:49 UTC (rev 6714)
@@ -191,16 +191,11 @@
                          int bytes)
 {
 	if (SSHv1(pvar)) {
-		switch (pvar->crypt_state.sender_cipher) {
-		case SSH_CIPHER_NONE:
+		if (pvar->crypt_state.sender_cipher == SSH_CIPHER_NONE) {
 			return FALSE;
-		case SSH_CIPHER_IDEA:
+		}
+		else {
 			return detect_attack(&pvar->crypt_state.detect_attack_statics,
-			                     buf, bytes,
-			                     pvar->crypt_state.dec.cIDEA.ivec) ==
-			       DEATTACK_DETECTED;
-		default:
-			return detect_attack(&pvar->crypt_state.detect_attack_statics,
 			                     buf, bytes, NULL) == DEATTACK_DETECTED;
 		}
 	} else {
@@ -769,26 +764,6 @@
 	                 &decryptstate->k, &decryptstate->ivec, DES_DECRYPT);
 }
 
-static void cIDEA_encrypt(PTInstVar pvar, unsigned char FAR * buf,
-                          int bytes)
-{
-	CipherIDEAState FAR *encryptstate = &pvar->crypt_state.enc.cIDEA;
-	int num = 0;
-
-	idea_cfb64_encrypt(buf, buf, bytes, &encryptstate->k,
-	                   encryptstate->ivec, &num, IDEA_ENCRYPT);
-}
-
-static void cIDEA_decrypt(PTInstVar pvar, unsigned char FAR * buf,
-                          int bytes)
-{
-	CipherIDEAState FAR *decryptstate = &pvar->crypt_state.dec.cIDEA;
-	int num = 0;
-
-	idea_cfb64_encrypt(buf, buf, bytes, &decryptstate->k,
-	                   decryptstate->ivec, &num, IDEA_DECRYPT);
-}
-
 static void flip_endianness(unsigned char FAR * cbuf, int bytes)
 {
 	uint32 FAR *buf = (uint32 FAR *) cbuf;
@@ -828,24 +803,6 @@
 	flip_endianness(buf, bytes);
 }
 
-static void cRC4_encrypt(PTInstVar pvar, unsigned char FAR * buf,
-                         int bytes)
-{
-	CipherRC4State FAR *encryptstate = &pvar->crypt_state.enc.cRC4;
-	int num = 0;
-
-	RC4(&encryptstate->k, bytes, buf, buf);
-}
-
-static void cRC4_decrypt(PTInstVar pvar, unsigned char FAR * buf,
-                         int bytes)
-{
-	CipherRC4State FAR *decryptstate = &pvar->crypt_state.dec.cRC4;
-	int num = 0;
-
-	RC4(&decryptstate->k, bytes, buf, buf);
-}
-
 void CRYPT_set_random_data(PTInstVar pvar, unsigned char FAR * buf,
                            int bytes)
 {
@@ -1353,12 +1310,6 @@
 	memset(state->ivec, 0, 8);
 }
 
-static void cIDEA_init(char FAR * session_key, CipherIDEAState FAR * state)
-{
-	idea_set_encrypt_key(session_key, &state->k);
-	memset(state->ivec, 0, 8);
-}
-
 static void cBlowfish_init(char FAR * session_key,
                            CipherBlowfishState FAR * state)
 {
@@ -1587,22 +1538,11 @@
 				pvar->crypt_state.encrypt = c3DES_encrypt;
 				break;
 			}
-		case SSH_CIPHER_IDEA:{
-				cIDEA_init(encryption_key, &pvar->crypt_state.enc.cIDEA);
-				pvar->crypt_state.encrypt = cIDEA_encrypt;
-				break;
-			}
 		case SSH_CIPHER_DES:{
 				cDES_init(encryption_key, &pvar->crypt_state.enc.cDES);
 				pvar->crypt_state.encrypt = cDES_encrypt;
 				break;
 			}
-		case SSH_CIPHER_RC4:{
-				RC4_set_key(&pvar->crypt_state.enc.cRC4.k, 16,
-							encryption_key + 16);
-				pvar->crypt_state.encrypt = cRC4_encrypt;
-				break;
-			}
 		case SSH_CIPHER_BLOWFISH:{
 				cBlowfish_init(encryption_key,
 				               &pvar->crypt_state.enc.cBlowfish);
@@ -1759,21 +1699,11 @@
 				pvar->crypt_state.decrypt = c3DES_decrypt;
 				break;
 			}
-		case SSH_CIPHER_IDEA:{
-				cIDEA_init(decryption_key, &pvar->crypt_state.dec.cIDEA);
-				pvar->crypt_state.decrypt = cIDEA_decrypt;
-				break;
-			}
 		case SSH_CIPHER_DES:{
 				cDES_init(decryption_key, &pvar->crypt_state.dec.cDES);
 				pvar->crypt_state.decrypt = cDES_decrypt;
 				break;
 			}
-		case SSH_CIPHER_RC4:{
-				RC4_set_key(&pvar->crypt_state.dec.cRC4.k, 16, decryption_key);
-				pvar->crypt_state.decrypt = cRC4_decrypt;
-				break;
-			}
 		case SSH_CIPHER_BLOWFISH:{
 				cBlowfish_init(decryption_key,
 				               &pvar->crypt_state.dec.cBlowfish);
@@ -1821,10 +1751,6 @@
 		return "3DES (168 key bits)";
 	case SSH_CIPHER_DES:
 		return "DES (56 key bits)";
-	case SSH_CIPHER_IDEA:
-		return "IDEA (128 key bits)";
-	case SSH_CIPHER_RC4:
-		return "RC4 (128 key bits)";
 	case SSH_CIPHER_BLOWFISH:
 		return "Blowfish (256 key bits)";
 
@@ -1975,16 +1901,6 @@
 			break;
 		}
 
-	case SSH_CIPHER_IDEA:{
-			CipherIDEAState state;
-			int num = 0;
-
-			cIDEA_init(passphrase_key, &state);
-			idea_cfb64_encrypt(buf, buf, bytes, &state.k, state.ivec,
-			                   &num, IDEA_DECRYPT);
-			break;
-		}
-
 	case SSH_CIPHER_DES:{
 			CipherDESState state;
 
@@ -1994,15 +1910,6 @@
 			break;
 		}
 
-	case SSH_CIPHER_RC4:{
-			CipherRC4State state;
-			int num = 0;
-
-			RC4_set_key(&state.k, 16, passphrase_key);
-			RC4(&state.k, bytes, buf, buf);
-			break;
-		}
-
 	case SSH_CIPHER_BLOWFISH:{
 			CipherBlowfishState state;
 

Modified: trunk/ttssh2/ttxssh/crypt.h
===================================================================
--- trunk/ttssh2/ttxssh/crypt.h	2017-05-12 12:41:42 UTC (rev 6713)
+++ trunk/ttssh2/ttxssh/crypt.h	2017-05-12 12:41:49 UTC (rev 6714)
@@ -36,8 +36,6 @@
 
 #include <openssl/rsa.h>
 #include <openssl/des.h>
-#include <openssl/idea.h>
-#include <openssl/rc4.h>
 #include <openssl/blowfish.h>
 
 #define SSH_SESSION_KEY_LENGTH    32
@@ -58,20 +56,11 @@
 } Cipher3DESState;
 
 typedef struct {
-  IDEA_KEY_SCHEDULE k;
-  unsigned char ivec[8];
-} CipherIDEAState;
-
-typedef struct {
   DES_key_schedule k;
   DES_cblock ivec;
 } CipherDESState;
 
 typedef struct {
-  RC4_KEY k;
-} CipherRC4State;
-
-typedef struct {
   BF_KEY k;
   unsigned char ivec[8];
 } CipherBlowfishState;
@@ -87,9 +76,7 @@
 
 typedef union {
   Cipher3DESState c3DES;
-  CipherIDEAState cIDEA;
   CipherDESState cDES;
-  CipherRC4State cRC4;
   CipherBlowfishState cBlowfish;
 } CRYPTCipherState;
 

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2017-05-12 12:41:42 UTC (rev 6713)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2017-05-12 12:41:49 UTC (rev 6714)
@@ -2717,18 +2717,10 @@
 		UTIL_get_lang_msg("DLG_SSHSETUP_CIPHER_BORDER", pvar,
 		                  "<ciphers below this line are disabled>");
 		return pvar->ts->UIMsg;
-	case SSH_CIPHER_RC4:
-		return "RC4(SSH1)";
 	case SSH_CIPHER_3DES:
 		return "3DES(SSH1)";
 	case SSH_CIPHER_DES:
 		return "DES(SSH1)";
-	case SSH_CIPHER_IDEA:
-		return "IDEA(SSH1)";
-	case SSH_CIPHER_TSS:
-		return "TSS(SSH1)";
-	case SSH_CIPHER_BLOWFISH:
-		return "Blowfish(SSH1)";
 
 	// for SSH2(yutaka)
 	case SSH2_CIPHER_AES128_CBC:



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