Revision: 7801 https://osdn.net/projects/ttssh2/scm/svn/commits/7801 Author: yutakapon Date: 2019-06-24 16:47:07 +0900 (Mon, 24 Jun 2019) Log Message: ----------- EVP_CIPHER_CTX 構造体のメンバーアクセスを関数化した。 encrypt -> EVP_CIPHER_CTX_encrypting に変更。 iv -> EVP_CIPHER_CTX_iv_noconst, EVP_CIPHER_CTX_iv に変更。 チケット #36876 Ticket Links: ------------ https://osdn.net/projects/ttssh2/tracker/detail/36876 Modified Paths: -------------- branches/openssl_1_1_1_v2/ttssh2/ttxssh/ttxssh.c -------------- next part -------------- Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/ttxssh.c =================================================================== --- branches/openssl_1_1_1_v2/ttssh2/ttxssh/ttxssh.c 2019-06-24 07:41:36 UTC (rev 7800) +++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/ttxssh.c 2019-06-24 07:47:07 UTC (rev 7801) @@ -3621,8 +3621,9 @@ } if (key == NULL) return (1); + /********* OPENSSL1.1.1 NOTEST *********/ if (enc == -1) - enc = ctx->encrypt; + enc = EVP_CIPHER_CTX_encrypting(ctx); // ctx->encrypt k1 = k2 = k3 = (u_char *) key; k2 += 8; if (EVP_CIPHER_CTX_key_length(ctx) >= 16+8) { @@ -3691,16 +3692,17 @@ //fatal("%s: no 3des context", __func__); ; + /********* OPENSSL1.1.1 NOTEST *********/ if (doset) { //debug3("%s: Installed 3DES IV", __func__); - memcpy(c->k1.iv, iv, 8); - memcpy(c->k2.iv, iv + 8, 8); - memcpy(c->k3.iv, iv + 16, 8); + memcpy(EVP_CIPHER_CTX_iv_noconst(c->k1), iv, 8); + memcpy(EVP_CIPHER_CTX_iv_noconst(c->k2), iv + 8, 8); + memcpy(EVP_CIPHER_CTX_iv_noconst(c->k3), iv + 16, 8); } else { //debug3("%s: Copying 3DES IV", __func__); - memcpy(iv, c->k1.iv, 8); - memcpy(iv + 8, c->k2.iv, 8); - memcpy(iv + 16, c->k3.iv, 8); + memcpy(iv, EVP_CIPHER_CTX_iv(c->k1), 8); + memcpy(iv + 8, EVP_CIPHER_CTX_iv(c->k2), 8); + memcpy(iv + 16, EVP_CIPHER_CTX_iv(c->k3), 8); } }