Revision: 9266 https://osdn.net/projects/ttssh2/scm/svn/commits/9266 Author: zmatsuo Date: 2021-05-20 23:56:29 +0900 (Thu, 20 May 2021) Log Message: ----------- cmakeビルドできるよう修正 (PPK3対応) - PPK3 = PuTTY private key format version 3 - r9258 を cmake でビルドできるよう調整 Revision Links: -------------- https://osdn.net/projects/ttssh2/scm/svn/commits/9258 Modified Paths: -------------- trunk/libs/buildall.cmake trunk/libs/putty.cmake trunk/ttssh2/CMakeLists.txt trunk/ttssh2/ttxssh/CMakeLists.txt Added Paths: ----------- trunk/libs/argon2.cmake trunk/ttssh2/argon2/CMakeLists.txt -------------- next part -------------- Added: trunk/libs/argon2.cmake =================================================================== --- trunk/libs/argon2.cmake (rev 0) +++ trunk/libs/argon2.cmake 2021-05-20 14:56:29 UTC (rev 9266) @@ -0,0 +1,33 @@ +# cmake -P argon2.cmake + +set(SRC_DIR_BASE "phc-winner-argon2-20190702") +set(SRC_ARC "20190702.tar.gz") +set(SRC_URL "https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/20190702.tar.gz") +set(SRC_ARC_HASH_SHA256 daf972a89577f8772602bf2eb38b6a3dd3d922bf5724d45e7f9589b5e830442c) + +set(DOWN_DIR "${CMAKE_SOURCE_DIR}/download/argon2") +set(EXTRACT_DIR "${CMAKE_SOURCE_DIR}/build/argon2/src") +set(SRC_DIR "${CMAKE_SOURCE_DIR}/build/argon2/src/${SRC_DIR_BASE}") +set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/argon2") + +if(NOT EXISTS ${INSTALL_DIR}/README.md) + + file(DOWNLOAD + ${SRC_URL} + ${DOWN_DIR}/${SRC_ARC} + EXPECTED_HASH SHA256=${SRC_ARC_HASH_SHA256} + SHOW_PROGRESS + ) + + file(MAKE_DIRECTORY ${EXTRACT_DIR}) + + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar "xvf" ${DOWN_DIR}/${SRC_ARC} + WORKING_DIRECTORY ${EXTRACT_DIR} + ) + + file(REMOVE_RECURSE ${INSTALL_DIR}) + file(RENAME ${SRC_DIR} ${INSTALL_DIR}) + file(REMOVE_RECURSE ${EXTRACT_DIR}) + +endif() Modified: trunk/libs/buildall.cmake =================================================================== --- trunk/libs/buildall.cmake 2021-05-20 14:16:39 UTC (rev 9265) +++ trunk/libs/buildall.cmake 2021-05-20 14:56:29 UTC (rev 9266) @@ -49,4 +49,9 @@ execute_process( COMMAND ${CMAKE_COMMAND} -P cJSON.cmake ) +message("argon2") +execute_process( + COMMAND ${CMAKE_COMMAND} -P argon2.cmake + ) + message("done buildall.cmake") Modified: trunk/libs/putty.cmake =================================================================== --- trunk/libs/putty.cmake 2021-05-20 14:16:39 UTC (rev 9265) +++ trunk/libs/putty.cmake 2021-05-20 14:56:29 UTC (rev 9266) @@ -13,8 +13,8 @@ if(NOT EXISTS ${INSTALL_DIR}/README) file(DOWNLOAD - ${SRC_URL} - ${DOWN_DIR}/${SRC_ARC} + ${SRC_URL} + ${DOWN_DIR}/${SRC_ARC} EXPECTED_HASH SHA256=${SRC_ARC_HASH_SHA256} SHOW_PROGRESS ) Modified: trunk/ttssh2/CMakeLists.txt =================================================================== --- trunk/ttssh2/CMakeLists.txt 2021-05-20 14:16:39 UTC (rev 9265) +++ trunk/ttssh2/CMakeLists.txt 2021-05-20 14:56:29 UTC (rev 9266) @@ -14,3 +14,6 @@ add_subdirectory(putty) set_target_properties(libputty PROPERTIES FOLDER ttssh2) +add_subdirectory(argon2) +set_target_properties(argon2 PROPERTIES FOLDER ttssh2) + Added: trunk/ttssh2/argon2/CMakeLists.txt =================================================================== --- trunk/ttssh2/argon2/CMakeLists.txt (rev 0) +++ trunk/ttssh2/argon2/CMakeLists.txt 2021-05-20 14:56:29 UTC (rev 9266) @@ -0,0 +1,50 @@ +set(PACKAGE_NAME "argon2") + +project(${PACKAGE_NAME}) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/") + +add_library( + ${PACKAGE_NAME} + argon2.h + ../../libs/argon2/src/argon2.c + ../../libs/argon2/src/blake2/blake2-impl.h + ../../libs/argon2/src/blake2/blake2.h + ../../libs/argon2/src/blake2/blake2b.c + ../../libs/argon2/src/blake2/blamka-round-opt.h + ../../libs/argon2/src/blake2/blamka-round-ref.h + ../../libs/argon2/src/core.c + ../../libs/argon2/src/core.h + ../../libs/argon2/src/encoding.c + ../../libs/argon2/src/encoding.h + ../../libs/argon2/src/ref.c + ../../libs/argon2/src/thread.c + ../../libs/argon2/src/thread.h + ) + +if(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005") + target_sources( + ${PACKAGE_NAME} + PRIVATE + compat/stdint.h + ) + target_include_directories( + ${PACKAGE_NAME} + PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/compat + ) +endif() + +source_group( + "libs_argon2" + REGULAR_EXPRESSION + "libs/argon2/") + +target_include_directories( + ${PACKAGE_NAME} + PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/ + PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/../../libs/argon2/src + ) + Modified: trunk/ttssh2/ttxssh/CMakeLists.txt =================================================================== --- trunk/ttssh2/ttxssh/CMakeLists.txt 2021-05-20 14:16:39 UTC (rev 9265) +++ trunk/ttssh2/ttxssh/CMakeLists.txt 2021-05-20 14:56:29 UTC (rev 9266) @@ -69,6 +69,8 @@ key.h keyfiles.c keyfiles.h + keyfiles-putty.c + keyfiles-putty.h mac.c mac.h pkt.c @@ -179,6 +181,7 @@ common_static libputty ttpcmn + argon2 ${ZLIB_LIB} ${OPENSSL_LIB} #