Revision: 9673 https://osdn.net/projects/ttssh2/scm/svn/commits/9673 Author: zmatsuo Date: 2022-01-04 23:10:46 +0900 (Tue, 04 Jan 2022) Log Message: ----------- r9623 で削除した OpenSSL 1.1 以降用のコードを戻し、#ifdef で使い分ける - r9658 Revision Links: -------------- https://osdn.net/projects/ttssh2/scm/svn/commits/9623 https://osdn.net/projects/ttssh2/scm/svn/commits/9658 Modified Paths: -------------- branches/libressl_3_4_2_cmake/ttssh2/ttxssh/cipher-3des1.c -------------- next part -------------- Modified: branches/libressl_3_4_2_cmake/ttssh2/ttxssh/cipher-3des1.c =================================================================== --- branches/libressl_3_4_2_cmake/ttssh2/ttxssh/cipher-3des1.c 2022-01-04 14:08:52 UTC (rev 9672) +++ branches/libressl_3_4_2_cmake/ttssh2/ttxssh/cipher-3des1.c 2022-01-04 14:10:46 UTC (rev 9673) @@ -125,6 +125,22 @@ const EVP_CIPHER *evp_ssh1_3des(void) { +#ifndef LIBRESSL_VERSION_NUMBER + static EVP_CIPHER *p = NULL; + + if (p == NULL) { + p = EVP_CIPHER_meth_new(NID_undef, /*block_size*/8, /*key_len*/16); + /*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/ + } + if (p) { + EVP_CIPHER_meth_set_iv_length(p, 0); + EVP_CIPHER_meth_set_init(p, ssh1_3des_init); + EVP_CIPHER_meth_set_cleanup(p, ssh1_3des_cleanup); + EVP_CIPHER_meth_set_do_cipher(p, ssh1_3des_cbc); + EVP_CIPHER_meth_set_flags(p, EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH); + } + return (p); +#else static EVP_CIPHER ssh1_3des; memset(&ssh1_3des, 0, sizeof(EVP_CIPHER)); @@ -137,4 +153,5 @@ ssh1_3des.do_cipher = ssh1_3des_cbc; ssh1_3des.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH; return (&ssh1_3des); +#endif }