Skip to content

Commit

Permalink
Move to easyssl (#65)
Browse files Browse the repository at this point in the history
* update QuasarApp

* updat qusrapp lib

* begin to add opensll 3 support

* update links to ssl lib

* added new depends (easyssl)

* easyssl update

* update easy ssl

* update easy ssl

* update easyssl

* remove old code (x509)

* update submodules
  • Loading branch information
EndrII authored Jul 21, 2023
1 parent 541e552 commit bc48851
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 1,262 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "submodules/QuasarAppLib"]
path = submodules/QuasarAppLib
url = https://github.com/QuasarApp/QuasarAppLib.git
[submodule "submodules/easyssl"]
path = submodules/easyssl
url = https://github.com/QuasarApp/easyssl.git
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# of this license document, but changing it is not allowed.
#

cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.18)

project(Heart)
if(TARGET ${PROJECT_NAME})
Expand Down Expand Up @@ -51,6 +51,14 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Sql Concurrent REQUIR

add_subdirectory(submodules/QuasarAppLib)
add_subdirectory(submodules/crc)

if (HEART_SSL)
option(EASYSSL_TESTS "disable tests of the easyssl submodule " OFF)
option(EASYSSL_STATIC_SSL "disable tests of the easyssl submodule " ${HEART_STATIC_SSL})

add_subdirectory(submodules/easyssl)
endif()

add_subdirectory(src)

if (HEART_TESTS)
Expand Down
5 changes: 0 additions & 5 deletions HeartTests/tst_testprotockol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "abstractnodetest.h"
#include <shedullertest.h>
#include <bigdatatest.h>
#include <ecdsaauthtest.h>
#include <upgradedatabasetest.h>
#include <multiversiontest.h>

Expand All @@ -35,10 +34,6 @@ private slots:
TestCase(bigDataTest, BigDataTest);
TestCase(shedullerTest, ShedullerTest);

#ifdef USE_HEART_SSL
TestCase(ecdsaAuthTest, ECDSAAuthTest);
#endif

TestCase(upgradeDataBaseTest, UpgradeDataBaseTest)
TestCase(multiVersionTest, MultiVersionTest)

Expand Down
100 changes: 0 additions & 100 deletions HeartTests/units/ecdsaauthtest.cpp

This file was deleted.

27 changes: 0 additions & 27 deletions HeartTests/units/ecdsaauthtest.h

This file was deleted.

34 changes: 2 additions & 32 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ if (HEART_VALIDATE_PACKS)
endif()

set(SLL_DEFINE "WITHOUT_SSL")

if (HEART_SSL)

list(APPEND CMAKE_FIND_ROOT_PATH "$ENV{OPENSSL_ROOT_DIR}")
find_package(OpenSSL 1.1.1 REQUIRED)
set(SLL_DEFINE "USE_HEART_SSL")
endif()

Expand All @@ -45,8 +41,6 @@ file(GLOB SOURCE_CPP
"public/*.cpp" "public/*.h" "public/*.qrc"
"public/packages/*.cpp" "public/packages/*.h" "public/packages/*.qrc"
"private/*.cpp" "private/*.h" "private/*.qrc"
"public/hcrypto/*.cpp" "public/hcrypto/*.h" "public/hcrypto/*.qrc"
"public/hcryptoFeatures/*.cpp" "public/hcryptoFeatures/*.h" "public/hcryptoFeatures/*.qrc"
)

set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
Expand All @@ -56,33 +50,9 @@ set(PRIVATE_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/private")


add_library(${PROJECT_NAME} ${SOURCE_CPP})
target_link_libraries(${PROJECT_NAME} PUBLIC Qt::Core Qt::Network Qt::Sql Qt::Concurrent QuasarApp crc)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt::Core Qt::Network Qt::Sql Qt::Concurrent QuasarApp crc )
if (HEART_SSL)

if (HEART_STATIC_SSL)

message("Use static ssl")
target_link_libraries(${PROJECT_NAME} PUBLIC libcrypto.a libssl.a)

else()

message("Use shared ssl ")
target_link_libraries(${PROJECT_NAME} PUBLIC OpenSSL::Crypto OpenSSL::SSL)


if (ANDROID)
set(OPENSSL_ROOT_PATH "$ENV{OPENSSL_ROOT_DIR}")

set(ANDROID_EXTRA_LIBS
${OPENSSL_ROOT_PATH}/lib/libcrypto_1_1.so
${OPENSSL_ROOT_PATH}/lib/libssl_1_1.so
CACHE INTERNAL "")

message(ANDROID_EXTRA_LIBS = ${ANDROID_EXTRA_LIBS})
endif()
endif()
message("Use the OpenSSL libraries: ${OPENSSL_LIBRARIES}")

target_link_libraries(${PROJECT_NAME} PUBLIC easyssl)
endif()

target_include_directories(${PROJECT_NAME} PUBLIC ${PUBLIC_INCUDE_DIR})
Expand Down
3 changes: 1 addition & 2 deletions src/heart.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
#ifndef NETWORKPROTOCOL_H
#define NETWORKPROTOCOL_H

#include "package.h"
#include "abstractnode.h"
#include "heart_global.h"

inline void initResources() { Q_INIT_RESOURCE(ProtockolResusces); }

Expand Down
Loading

0 comments on commit bc48851

Please sign in to comment.