• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision6559 (tree)
Time2017-01-05 00:02:08
Author(del#24082)

Log Message

※これはブランチへのコミットです
EVP_CIPHER_CTX 構造体の定義をポインタ化した。

Change Summary

Incremental Difference

--- branches/openssl_1_1_0/ttssh2/ttxssh/crypt.c (revision 6558)
+++ branches/openssl_1_1_0/ttssh2/ttxssh/crypt.c (revision 6559)
@@ -239,7 +239,7 @@
239239 goto error;
240240 }
241241
242- if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
242+ if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
243243 UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
244244 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
245245 "AES128/192/256");
@@ -287,7 +287,7 @@
287287 goto error;
288288 }
289289
290- if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
290+ if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
291291 UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
292292 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
293293 "AES128/192/256");
@@ -337,7 +337,7 @@
337337 goto error;
338338 }
339339
340- if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
340+ if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
341341 UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
342342 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
343343 "3DES-CBC");
@@ -385,7 +385,7 @@
385385 goto error;
386386 }
387387
388- if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
388+ if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
389389 UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
390390 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
391391 "3DES-CBC");
@@ -434,7 +434,7 @@
434434 goto error;
435435 }
436436
437- if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
437+ if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
438438 UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
439439 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
440440 "Blowfish");
@@ -473,7 +473,7 @@
473473 goto error;
474474 }
475475
476- if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
476+ if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
477477 UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
478478 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
479479 "Blowfish");
@@ -513,7 +513,7 @@
513513 goto error;
514514 }
515515
516- if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
516+ if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
517517 UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
518518 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
519519 "Arcfour");
@@ -552,7 +552,7 @@
552552 goto error;
553553 }
554554
555- if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
555+ if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
556556 UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
557557 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
558558 "Arcfour");
@@ -592,7 +592,7 @@
592592 goto error;
593593 }
594594
595- if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
595+ if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
596596 UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
597597 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
598598 "CAST128");
@@ -631,7 +631,7 @@
631631 goto error;
632632 }
633633
634- if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
634+ if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
635635 UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
636636 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
637637 "CAST128");
@@ -670,7 +670,7 @@
670670 goto error;
671671 }
672672
673- if (EVP_Cipher(&pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
673+ if (EVP_Cipher(pvar->evpcip[MODE_OUT], newbuf, buf, bytes) == 0) {
674674 UTIL_get_lang_msg("MSG_ENCRYPT_ERROR2", pvar, "%s encrypt error(2)");
675675 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
676676 "Camellia128/192/256");
@@ -709,7 +709,7 @@
709709 goto error;
710710 }
711711
712- if (EVP_Cipher(&pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
712+ if (EVP_Cipher(pvar->evpcip[MODE_IN], newbuf, buf, bytes) == 0) {
713713 UTIL_get_lang_msg("MSG_DECRYPT_ERROR2", pvar, "%s decrypt error(2)");
714714 _snprintf_s(tmp, sizeof(tmp), _TRUNCATE, pvar->ts->UIMsg,
715715 "Camellia128/192/256");
@@ -1454,7 +1454,7 @@
14541454 struct Enc *enc;
14551455
14561456 enc = &pvar->ssh2_keys[MODE_OUT].enc;
1457- cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
1457+ cipher_init_SSH2(pvar->evpcip[MODE_OUT],
14581458 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
14591459 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
14601460 CIPHER_ENCRYPT,
@@ -1480,7 +1480,7 @@
14801480 struct Enc *enc;
14811481
14821482 enc = &pvar->ssh2_keys[MODE_OUT].enc;
1483- cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
1483+ cipher_init_SSH2(pvar->evpcip[MODE_OUT],
14841484 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
14851485 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
14861486 CIPHER_ENCRYPT,
@@ -1501,7 +1501,7 @@
15011501 struct Enc *enc;
15021502
15031503 enc = &pvar->ssh2_keys[MODE_OUT].enc;
1504- cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
1504+ cipher_init_SSH2(pvar->evpcip[MODE_OUT],
15051505 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
15061506 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
15071507 CIPHER_ENCRYPT,
@@ -1523,7 +1523,7 @@
15231523 struct Enc *enc;
15241524
15251525 enc = &pvar->ssh2_keys[MODE_OUT].enc;
1526- cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
1526+ cipher_init_SSH2(pvar->evpcip[MODE_OUT],
15271527 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
15281528 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
15291529 CIPHER_ENCRYPT,
@@ -1543,7 +1543,7 @@
15431543 struct Enc *enc;
15441544
15451545 enc = &pvar->ssh2_keys[MODE_OUT].enc;
1546- cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
1546+ cipher_init_SSH2(pvar->evpcip[MODE_OUT],
15471547 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
15481548 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
15491549 CIPHER_ENCRYPT,
@@ -1567,7 +1567,7 @@
15671567 struct Enc *enc;
15681568
15691569 enc = &pvar->ssh2_keys[MODE_OUT].enc;
1570- cipher_init_SSH2(&pvar->evpcip[MODE_OUT],
1570+ cipher_init_SSH2(pvar->evpcip[MODE_OUT],
15711571 enc->key, get_cipher_key_len(pvar->crypt_state.sender_cipher),
15721572 enc->iv, get_cipher_block_size(pvar->crypt_state.sender_cipher),
15731573 CIPHER_ENCRYPT,
@@ -1624,7 +1624,7 @@
16241624 struct Enc *enc;
16251625
16261626 enc = &pvar->ssh2_keys[MODE_IN].enc;
1627- cipher_init_SSH2(&pvar->evpcip[MODE_IN],
1627+ cipher_init_SSH2(pvar->evpcip[MODE_IN],
16281628 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
16291629 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
16301630 CIPHER_DECRYPT,
@@ -1650,7 +1650,7 @@
16501650 struct Enc *enc;
16511651
16521652 enc = &pvar->ssh2_keys[MODE_IN].enc;
1653- cipher_init_SSH2(&pvar->evpcip[MODE_IN],
1653+ cipher_init_SSH2(pvar->evpcip[MODE_IN],
16541654 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
16551655 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
16561656 CIPHER_DECRYPT,
@@ -1671,7 +1671,7 @@
16711671 struct Enc *enc;
16721672
16731673 enc = &pvar->ssh2_keys[MODE_IN].enc;
1674- cipher_init_SSH2(&pvar->evpcip[MODE_IN],
1674+ cipher_init_SSH2(pvar->evpcip[MODE_IN],
16751675 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
16761676 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
16771677 CIPHER_DECRYPT,
@@ -1693,7 +1693,7 @@
16931693 struct Enc *enc;
16941694
16951695 enc = &pvar->ssh2_keys[MODE_IN].enc;
1696- cipher_init_SSH2(&pvar->evpcip[MODE_IN],
1696+ cipher_init_SSH2(pvar->evpcip[MODE_IN],
16971697 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
16981698 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
16991699 CIPHER_DECRYPT,
@@ -1714,7 +1714,7 @@
17141714 struct Enc *enc;
17151715
17161716 enc = &pvar->ssh2_keys[MODE_IN].enc;
1717- cipher_init_SSH2(&pvar->evpcip[MODE_IN],
1717+ cipher_init_SSH2(pvar->evpcip[MODE_IN],
17181718 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
17191719 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
17201720 CIPHER_DECRYPT,
@@ -1739,7 +1739,7 @@
17391739 struct Enc *enc;
17401740
17411741 enc = &pvar->ssh2_keys[MODE_IN].enc;
1742- cipher_init_SSH2(&pvar->evpcip[MODE_IN],
1742+ cipher_init_SSH2(pvar->evpcip[MODE_IN],
17431743 enc->key, get_cipher_key_len(pvar->crypt_state.receiver_cipher),
17441744 enc->iv, get_cipher_block_size(pvar->crypt_state.receiver_cipher),
17451745 CIPHER_DECRYPT,
--- branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.c (revision 6558)
+++ branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.c (revision 6559)
@@ -140,6 +140,9 @@
140140 FWDUI_init(pvar);
141141
142142 ssh_heartbeat_lock_initialize();
143+
144+ pvar->evpcip[MODE_IN] = EVP_CIPHER_CTX_new();
145+ pvar->evpcip[MODE_OUT] = EVP_CIPHER_CTX_new();
143146 }
144147
145148 static void uninit_TTSSH(PTInstVar pvar)
@@ -168,6 +171,9 @@
168171 }
169172
170173 ssh_heartbeat_lock_finalize();
174+
175+ EVP_CIPHER_CTX_free(pvar->evpcip[MODE_IN]);
176+ EVP_CIPHER_CTX_free(pvar->evpcip[MODE_OUT]);
171177 }
172178
173179 static void PASCAL FAR TTXInit(PTTSet ts, PComVar cv)
--- branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.h (revision 6558)
+++ branches/openssl_1_1_0/ttssh2/ttxssh/ttxssh.h (revision 6559)
@@ -266,7 +266,7 @@
266266 char *session_id;
267267 int session_id_len;
268268 Newkeys ssh2_keys[MODE_MAX];
269- EVP_CIPHER_CTX evpcip[MODE_MAX];
269+ EVP_CIPHER_CTX *evpcip[MODE_MAX];
270270 int userauth_success;
271271 int shell_id;
272272 /*int remote_id;*/
Show on old repository browser