Added partial verification of server public key on client side - needs hostname verification. Added startup flag to ignore verification fail.
This commit is contained in:
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.16)
|
||||
# If MAJOR is 0, and MINOR > 0, Version is BETA
|
||||
|
||||
project(ColumnLynx
|
||||
VERSION 0.0.1
|
||||
VERSION 0.0.3
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ include(FetchContent)
|
||||
if(APPLE)
|
||||
# Build universal (arm64 + x86_64), or limit to one arch if you prefer
|
||||
# e.g., set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "" FORCE)
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "Build architectures" FORCE)
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Build architectures" FORCE)
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------------------
|
||||
@@ -58,6 +58,15 @@ set(SODIUM_CMAKE_ARGS
|
||||
|
||||
FetchContent_MakeAvailable(Sodium)
|
||||
|
||||
# OpenSSL
|
||||
find_package(OpenSSL REQUIRED)
|
||||
if(OPENSSL_FOUND)
|
||||
message(STATUS "Found OpenSSL version ${OPENSSL_VERSION}")
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
else()
|
||||
message(FATAL_ERROR "OpenSSL not found")
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# Output directories
|
||||
# ---------------------------------------------------------
|
||||
@@ -77,7 +86,7 @@ endforeach()
|
||||
# ---------------------------------------------------------
|
||||
file(GLOB_RECURSE COMMON_SRC CONFIGURE_DEPENDS src/common/*.cpp)
|
||||
add_library(common STATIC ${COMMON_SRC})
|
||||
target_link_libraries(common PUBLIC sodium)
|
||||
target_link_libraries(common PUBLIC sodium OpenSSL::SSL OpenSSL::Crypto)
|
||||
target_include_directories(common PUBLIC
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${sodium_SOURCE_DIR}/src/libsodium/include
|
||||
@@ -90,7 +99,7 @@ target_compile_definitions(common PUBLIC ASIO_STANDALONE)
|
||||
# ---------------------------------------------------------
|
||||
file(GLOB_RECURSE CLIENT_SRC CONFIGURE_DEPENDS src/client/*.cpp)
|
||||
add_executable(client ${CLIENT_SRC})
|
||||
target_link_libraries(client PRIVATE common sodium)
|
||||
target_link_libraries(client PRIVATE common sodium OpenSSL::SSL OpenSSL::Crypto)
|
||||
target_include_directories(client PRIVATE
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${sodium_SOURCE_DIR}/src/libsodium/include
|
||||
@@ -104,7 +113,7 @@ set_target_properties(client PROPERTIES OUTPUT_NAME "columnlynx_client")
|
||||
# ---------------------------------------------------------
|
||||
file(GLOB_RECURSE SERVER_SRC CONFIGURE_DEPENDS src/server/*.cpp)
|
||||
add_executable(server ${SERVER_SRC})
|
||||
target_link_libraries(server PRIVATE common sodium)
|
||||
target_link_libraries(server PRIVATE common sodium OpenSSL::SSL OpenSSL::Crypto)
|
||||
target_include_directories(server PRIVATE
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${sodium_SOURCE_DIR}/src/libsodium/include
|
||||
|
||||
Reference in New Issue
Block a user