• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision9693 (tree)
Time2022-01-17 00:35:24
Authornmaya

Log Message

OpenSSL 3 のビルドに対応

#43469

merge from openssl_3_0_1:
r9621,r9659,r9681,r9691

Change Summary

Incremental Difference

--- trunk/libs/buildopenssl3.bat (nonexistent)
+++ trunk/libs/buildopenssl3.bat (revision 9693)
@@ -0,0 +1,35 @@
1+rem OpenSSLのビルド
2+
3+cd openssl
4+
5+
6+rem nmmake clean すると ossl_static.pdb は *.pdb なので削除されてしまう。
7+rem ossl_static.pdb は *.pdb なので nmake clean すると削除されてしまう。
8+rem debug のときのほうが必要だと思われるので、
9+rem release を先にビルドして debug の ossl_static.pdb が残るようにする。
10+
11+if exist "out32\libcrypto.lib" goto build_end
12+perl Configure no-asm no-async no-shared no-capieng no-dso no-engine VC-WIN32
13+perl -e "open(IN,'makefile');while(<IN>){s| /MD| /MT|;print $_;}close(IN);" > makefile.tmp
14+move /y makefile.tmp makefile
15+nmake -f makefile clean
16+nmake -f makefile build_libs
17+mkdir out32
18+move /y libcrypto.lib out32\
19+move /y ossl_static.pdb out32\
20+:build_end
21+
22+if exist "out32.dbg\libcrypto.lib" goto build_dbg_end
23+perl Configure no-asm no-async no-shared no-capieng no-dso no-engine VC-WIN32 --debug
24+perl -e "open(IN,'makefile');while(<IN>){s| /MDd| /MTd|;print $_;}close(IN);" > makefile.tmp
25+move /y makefile.tmp makefile.dbg
26+nmake -f makefile.dbg clean
27+nmake -f makefile.dbg build_libs
28+mkdir out32.dbg
29+move /y libcrypto.lib out32.dbg\
30+move /y ossl_static.pdb out32.dbg\
31+:build_dbg_end
32+
33+
34+cd ..
35+exit /b 0
--- trunk/ttssh2/ttxssh/CMakeLists.txt (revision 9692)
+++ trunk/ttssh2/ttxssh/CMakeLists.txt (revision 9693)
@@ -1,6 +1,7 @@
11 set(PACKAGE_NAME "ttxssh")
22
33 option(TTXSSH_LIBRESSL "User LibreSSL" on)
4+option(TTXSSH_OPENSSL3 "Use OpenSSL3" off)
45
56 project(${PACKAGE_NAME})
67
@@ -7,6 +8,8 @@
78 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_zlib.cmake)
89 if(TTXSSH_LIBRESSL)
910 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_libressl.cmake)
11+elseif(TTXSSH_OPENSSL3)
12+ include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl3.cmake)
1013 else()
1114 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake)
1215 endif()
@@ -163,6 +166,7 @@
163166 ../putty
164167 ${ZLIB_INCLUDE_DIRS}
165168 )
169+
166170 if(TTXSSH_LIBRESSL)
167171 target_include_directories(
168172 ${PACKAGE_NAME}
@@ -169,6 +173,12 @@
169173 PRIVATE
170174 ${LIBRESSL_INCLUDE_DIRS}
171175 )
176+elseif(TTXSSH_OPENSSL3)
177+ target_include_directories(
178+ ${PACKAGE_NAME}
179+ PRIVATE
180+ ${OPENSSL3_INCLUDE_DIRS}
181+ )
172182 else()
173183 target_include_directories(
174184 ${PACKAGE_NAME}
@@ -216,6 +226,13 @@
216226 ${LIBRESSL_LIB}
217227 bcrypt.lib
218228 )
229+elseif(TTXSSH_OPENSSL3)
230+ target_link_libraries(
231+ ${PACKAGE_NAME}
232+ PRIVATE
233+ ${OPENSSL3_LIB}
234+ bcrypt.lib
235+ )
219236 else()
220237 target_link_libraries(
221238 ${PACKAGE_NAME}
--- trunk/ttssh2/ttxssh/cipher.c (revision 9692)
+++ trunk/ttssh2/ttxssh/cipher.c (revision 9693)
@@ -46,9 +46,9 @@
4646 {SSH2_CIPHER_AES192_CBC, "aes192-cbc", 16, 24, 0, 0, 0, EVP_aes_192_cbc}, // RFC4253
4747 {SSH2_CIPHER_AES256_CBC, "aes256-cbc", 16, 32, 0, 0, 0, EVP_aes_256_cbc}, // RFC4253
4848 {SSH2_CIPHER_BLOWFISH_CBC, "blowfish-cbc", 8, 16, 0, 0, 0, EVP_bf_cbc}, // RFC4253
49- {SSH2_CIPHER_AES128_CTR, "aes128-ctr", 16, 16, 0, 0, 0, evp_aes_128_ctr}, // RFC4344
50- {SSH2_CIPHER_AES192_CTR, "aes192-ctr", 16, 24, 0, 0, 0, evp_aes_128_ctr}, // RFC4344
51- {SSH2_CIPHER_AES256_CTR, "aes256-ctr", 16, 32, 0, 0, 0, evp_aes_128_ctr}, // RFC4344
49+ {SSH2_CIPHER_AES128_CTR, "aes128-ctr", 16, 16, 0, 0, 0, EVP_aes_128_ctr}, // RFC4344
50+ {SSH2_CIPHER_AES192_CTR, "aes192-ctr", 16, 24, 0, 0, 0, EVP_aes_192_ctr}, // RFC4344
51+ {SSH2_CIPHER_AES256_CTR, "aes256-ctr", 16, 32, 0, 0, 0, EVP_aes_256_ctr}, // RFC4344
5252 {SSH2_CIPHER_ARCFOUR, "arcfour", 8, 16, 0, 0, 0, EVP_rc4}, // RFC4253
5353 {SSH2_CIPHER_ARCFOUR128, "arcfour128", 8, 16, 1536, 0, 0, EVP_rc4}, // RFC4345
5454 {SSH2_CIPHER_ARCFOUR256, "arcfour256", 8, 32, 1536, 0, 0, EVP_rc4}, // RFC4345
@@ -59,9 +59,9 @@
5959 {SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc", 16, 16, 0, 0, 0, EVP_camellia_128_cbc}, // draft-kanno-secsh-camellia-02
6060 {SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc", 16, 24, 0, 0, 0, EVP_camellia_192_cbc}, // draft-kanno-secsh-camellia-02
6161 {SSH2_CIPHER_CAMELLIA256_CBC, "camellia256-cbc", 16, 32, 0, 0, 0, EVP_camellia_256_cbc}, // draft-kanno-secsh-camellia-02
62- {SSH2_CIPHER_CAMELLIA128_CTR, "camellia128-ctr", 16, 16, 0, 0, 0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02
63- {SSH2_CIPHER_CAMELLIA192_CTR, "camellia192-ctr", 16, 24, 0, 0, 0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02
64- {SSH2_CIPHER_CAMELLIA256_CTR, "camellia256-ctr", 16, 32, 0, 0, 0, evp_camellia_128_ctr}, // draft-kanno-secsh-camellia-02
62+ {SSH2_CIPHER_CAMELLIA128_CTR, "camellia128-ctr", 16, 16, 0, 0, 0, EVP_camellia_128_ctr}, // draft-kanno-secsh-camellia-02
63+ {SSH2_CIPHER_CAMELLIA192_CTR, "camellia192-ctr", 16, 24, 0, 0, 0, EVP_camellia_192_ctr}, // draft-kanno-secsh-camellia-02
64+ {SSH2_CIPHER_CAMELLIA256_CTR, "camellia256-ctr", 16, 32, 0, 0, 0, EVP_camellia_256_ctr}, // draft-kanno-secsh-camellia-02
6565 #ifdef WITH_CAMELLIA_PRIVATE
6666 {SSH2_CIPHER_CAMELLIA128_CBC, "camellia128-cbc@openssh.org", 16, 16, 0, 0, 0, EVP_camellia_128_cbc},
6767 {SSH2_CIPHER_CAMELLIA192_CBC, "camellia192-cbc@openssh.org", 16, 24, 0, 0, 0, EVP_camellia_192_cbc},
@@ -328,19 +328,30 @@
328328 SSH2_CIPHER_AES128_CTR,
329329 SSH2_CIPHER_CAMELLIA128_CBC,
330330 SSH2_CIPHER_AES128_CBC,
331+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x30000000UL
331332 SSH2_CIPHER_3DES_CTR,
333+#endif
332334 SSH2_CIPHER_3DES_CBC,
335+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x30000000UL
333336 SSH2_CIPHER_BLOWFISH_CTR,
334337 SSH2_CIPHER_BLOWFISH_CBC,
335338 SSH2_CIPHER_CAST128_CTR,
336339 SSH2_CIPHER_CAST128_CBC,
340+#endif
337341 SSH_CIPHER_3DES,
338342 SSH_CIPHER_NONE,
343+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x30000000UL
339344 SSH2_CIPHER_ARCFOUR256,
340345 SSH2_CIPHER_ARCFOUR128,
341346 SSH2_CIPHER_ARCFOUR,
347+#endif
342348 SSH_CIPHER_BLOWFISH,
343349 SSH_CIPHER_DES,
350+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x30000000UL
351+ 0, 0, 0, // Dummy for SSH2_CIPHER_3DES_CTR, SSH2_CIPHER_BLOWFISH_CTR, SSH2_CIPHER_BLOWFISH_CBC,
352+ 0, 0, // Dummy for SSH2_CIPHER_CAST128_CTR, SSH2_CIPHER_CAST128_CBC
353+ 0, 0, 0, // Dummy for SSH2_CIPHER_ARCFOUR256, SSH2_CIPHER_ARCFOUR128, SSH2_CIPHER_ARCFOUR
354+#endif
344355 0, 0, 0 // Dummy for SSH_CIPHER_IDEA, SSH_CIPHER_TSS, SSH_CIPHER_RC4
345356 };
346357
--- trunk/ttssh2/ttxssh/crypt.c (revision 9692)
+++ trunk/ttssh2/ttxssh/crypt.c (revision 9693)
@@ -606,10 +606,13 @@
606606 | (1 << SSH2_CIPHER_AES128_CBC)
607607 | (1 << SSH2_CIPHER_AES192_CBC)
608608 | (1 << SSH2_CIPHER_AES256_CBC)
609+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x30000000UL
609610 | (1 << SSH2_CIPHER_BLOWFISH_CBC)
611+#endif
610612 | (1 << SSH2_CIPHER_AES128_CTR)
611613 | (1 << SSH2_CIPHER_AES192_CTR)
612614 | (1 << SSH2_CIPHER_AES256_CTR)
615+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x30000000UL
613616 | (1 << SSH2_CIPHER_ARCFOUR)
614617 | (1 << SSH2_CIPHER_ARCFOUR128)
615618 | (1 << SSH2_CIPHER_ARCFOUR256)
@@ -617,6 +620,7 @@
617620 | (1 << SSH2_CIPHER_3DES_CTR)
618621 | (1 << SSH2_CIPHER_BLOWFISH_CTR)
619622 | (1 << SSH2_CIPHER_CAST128_CTR)
623+#endif
620624 | (1 << SSH2_CIPHER_CAMELLIA128_CBC)
621625 | (1 << SSH2_CIPHER_CAMELLIA192_CBC)
622626 | (1 << SSH2_CIPHER_CAMELLIA256_CBC)
--- trunk/ttssh2/ttxssh/mac.c (revision 9692)
+++ trunk/ttssh2/ttxssh/mac.c (revision 9693)
@@ -129,8 +129,10 @@
129129 HMAC_SHA2_512,
130130 HMAC_SHA2_256,
131131 HMAC_SHA1,
132+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x30000000UL
132133 HMAC_RIPEMD160_EtM,
133134 HMAC_RIPEMD160,
135+#endif
134136 HMAC_MD5_EtM,
135137 HMAC_MD5,
136138 HMAC_NONE,
@@ -137,7 +139,10 @@
137139 HMAC_SHA1_96_EtM,
138140 HMAC_MD5_96_EtM,
139141 HMAC_SHA1_96,
140- HMAC_MD5_96,
142+ HMAC_MD5_96,
143+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x30000000UL
144+ 0, 0, // Dummy for HMAC_RIPEMD160_EtM, HMAC_RIPEMD160
145+#endif
141146 0, // Dummy for HMAC_SHA2_512_96,
142147 0, // Dummy for HMAC_SHA2_256_96,
143148 };
--- trunk/ttssh2/ttxssh/ssh.c (revision 9692)
+++ trunk/ttssh2/ttxssh/ssh.c (revision 9693)
@@ -6413,10 +6413,13 @@
64136413 | 1 << SSH2_CIPHER_AES128_CBC
64146414 | 1 << SSH2_CIPHER_AES192_CBC
64156415 | 1 << SSH2_CIPHER_AES256_CBC
6416+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x30000000UL
64166417 | 1 << SSH2_CIPHER_BLOWFISH_CBC
6418+#endif
64176419 | 1 << SSH2_CIPHER_AES128_CTR
64186420 | 1 << SSH2_CIPHER_AES192_CTR
64196421 | 1 << SSH2_CIPHER_AES256_CTR
6422+#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x30000000UL
64206423 | 1 << SSH2_CIPHER_ARCFOUR
64216424 | 1 << SSH2_CIPHER_ARCFOUR128
64226425 | 1 << SSH2_CIPHER_ARCFOUR256
@@ -6424,6 +6427,7 @@
64246427 | 1 << SSH2_CIPHER_3DES_CTR
64256428 | 1 << SSH2_CIPHER_BLOWFISH_CTR
64266429 | 1 << SSH2_CIPHER_CAST128_CTR
6430+#endif
64276431 | 1 << SSH2_CIPHER_CAMELLIA128_CBC
64286432 | 1 << SSH2_CIPHER_CAMELLIA192_CBC
64296433 | 1 << SSH2_CIPHER_CAMELLIA256_CBC
Show on old repository browser