[Ttssh2-commit] [6559] ※これはブランチへのコミットです

svnno****@sourc***** svnno****@sourc*****
2017年 1月 5日 (木) 00:02:09 JST


Revision: 6559
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6559
Author:   yutakapon
Date:     2017-01-05 00:02:08 +0900 (Thu, 05 Jan 2017)
Log Message:
-----------
※これはブランチへのコミットです
EVP_CIPHER_CTX 構造体の定義をポインタ化した。

Modified Paths:
--------------
    branches/openssl_1_1_0/ttssh2/ttxssh/crypt.c
    branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.c
    branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.h

-------------- next part --------------
Modified: branches/openssl_1_1_0/ttssh2/ttxssh/crypt.c
===================================================================
--- branches/openssl_1_1_0/ttssh2/ttxssh/crypt.c	2017-01-03 15:50:15 UTC (rev 6558)
+++ branches/openssl_1_1_0/ttssh2/ttxssh/crypt.c	2017-01-04 15:02:08 UTC (rev 6559)
@@ -239,7 +239,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "AES128/192/256");
@@ -287,7 +287,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "AES128/192/256");
@@ -337,7 +337,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "3DES-CBC");
@@ -385,7 +385,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "3DES-CBC");
@@ -434,7 +434,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "Blowfish");
@@ -473,7 +473,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "Blowfish");
@@ -513,7 +513,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "Arcfour");
@@ -552,7 +552,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "Arcfour");
@@ -592,7 +592,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "CAST128");
@@ -631,7 +631,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "CAST128");
@@ -670,7 +670,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "Camellia128/192/256");
@@ -709,7 +709,7 @@
 		goto error;
 	}
 
-	if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
+	if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
 		UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
 		_snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
 		            "Camellia128/192/256");
@@ -1454,7 +1454,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_OUT].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
+				cipher_init_SSH2(pvar->evpcip[MODE_OUT],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
 				                 CIPHER_ENCRYPT,
@@ -1480,7 +1480,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_OUT].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
+				cipher_init_SSH2(pvar->evpcip[MODE_OUT],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
 				                 CIPHER_ENCRYPT,
@@ -1501,7 +1501,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_OUT].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
+				cipher_init_SSH2(pvar->evpcip[MODE_OUT],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
 				                 CIPHER_ENCRYPT,
@@ -1523,7 +1523,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_OUT].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
+				cipher_init_SSH2(pvar->evpcip[MODE_OUT],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
 				                 CIPHER_ENCRYPT,
@@ -1543,7 +1543,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_OUT].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
+				cipher_init_SSH2(pvar->evpcip[MODE_OUT],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
 				                 CIPHER_ENCRYPT,
@@ -1567,7 +1567,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_OUT].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
+				cipher_init_SSH2(pvar->evpcip[MODE_OUT],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
 				                 CIPHER_ENCRYPT,
@@ -1624,7 +1624,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_IN].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_IN],
+				cipher_init_SSH2(pvar->evpcip[MODE_IN],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
 				                 CIPHER_DECRYPT,
@@ -1650,7 +1650,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_IN].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_IN],
+				cipher_init_SSH2(pvar->evpcip[MODE_IN],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
 				                 CIPHER_DECRYPT,
@@ -1671,7 +1671,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_IN].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_IN],
+				cipher_init_SSH2(pvar->evpcip[MODE_IN],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
 				                 CIPHER_DECRYPT,
@@ -1693,7 +1693,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_IN].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_IN],
+				cipher_init_SSH2(pvar->evpcip[MODE_IN],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
 				                 CIPHER_DECRYPT,
@@ -1714,7 +1714,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_IN].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_IN],
+				cipher_init_SSH2(pvar->evpcip[MODE_IN],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
 				                 CIPHER_DECRYPT,
@@ -1739,7 +1739,7 @@
 				struct Enc *enc;
 
 				enc = &pvar->ssh2_keys[MODE_IN].enc;
-				cipher_init_SSH2(&pvar->evpcip[MODE_IN],
+				cipher_init_SSH2(pvar->evpcip[MODE_IN],
 				                 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
 				                 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
 				                 CIPHER_DECRYPT,

Modified: branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.c
===================================================================
--- branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.c	2017-01-03 15:50:15 UTC (rev 6558)
+++ branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.c	2017-01-04 15:02:08 UTC (rev 6559)
@@ -140,6 +140,9 @@
 	FWDUI_init(pvar);
 
 	ssh_heartbeat_lock_initialize();
+
+	pvar->evpcip[MODE_IN] = EVP_CIPHER_CTX_new();
+	pvar->evpcip[MODE_OUT] = EVP_CIPHER_CTX_new();
 }
 
 static void uninit_TTSSH(PTInstVar pvar)
@@ -168,6 +171,9 @@
 	}
 
 	ssh_heartbeat_lock_finalize();
+
+	EVP_CIPHER_CTX_free(pvar->evpcip[MODE_IN]);
+	EVP_CIPHER_CTX_free(pvar->evpcip[MODE_OUT]);
 }
 
 static void PASCAL FAR TTXInit(PTTSet ts, PComVar cv)

Modified: branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.h
===================================================================
--- branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.h	2017-01-03 15:50:15 UTC (rev 6558)
+++ branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.h	2017-01-04 15:02:08 UTC (rev 6559)
@@ -266,7 +266,7 @@
 	char *session_id;
 	int session_id_len;
 	Newkeys ssh2_keys[MODE_MAX];
-	EVP_CIPHER_CTX evpcip[MODE_MAX];
+	EVP_CIPHER_CTX *evpcip[MODE_MAX];
 	int userauth_success;
 	int shell_id;
 	/*int remote_id;*/



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