From 673aa9198ec1f88eb1f9f265d0b85f613ee86418 Mon Sep 17 00:00:00 2001 From: Kang Lin Date: Fri, 23 Feb 2024 11:17:45 +0800 Subject: [PATCH] Fix: install libssl bug. Because -DX_VCPKG_APPLOCAL_DEPS_INSTALL:BOOL=ON install dependencies. So the pragram must include the functions of the dependencies libraries. --- ChangeLog.md | 3 +++ ChangeLog_zh_CN.md | 5 +++++ Src/EvpAES.cpp | 10 ++++++++++ Src/EvpAES.h | 3 +++ 4 files changed, 21 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 8bff0779..1120d281 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,6 @@ +### Version: v2.0.2 ++ Fix: install libssl.dll + ### Version: v2.0.1 + Update: fix show progressBar + Use CDownLoad to down the image of contribute in CDlgAbout diff --git a/ChangeLog_zh_CN.md b/ChangeLog_zh_CN.md index c1168a0d..be93796d 100644 --- a/ChangeLog_zh_CN.md +++ b/ChangeLog_zh_CN.md @@ -1,3 +1,8 @@ +### 版本: v2.0.2 ++ 修复安装依赖库 libssl 。 + 因为 -DX_VCPKG_APPLOCAL_DEPS_INSTALL:BOOL=ON + 安装依赖库。所以需要在程序中引用。 + ### 版本: v2.0.1 + 修复更新中的下载进度条错误 + 关于对话框中使用 CDownLoad 下载捐赠图片 diff --git a/Src/EvpAES.cpp b/Src/EvpAES.cpp index 23ae4206..01a7fdd2 100644 --- a/Src/EvpAES.cpp +++ b/Src/EvpAES.cpp @@ -1,6 +1,7 @@ #include "EvpAES.h" #include #include +#include #define KEY_SIZE_16B 16 #define KEY_SIZE_24B 24 @@ -359,3 +360,12 @@ bool EvpAES::encrypt(const QByteArray &in, QByteArray &out, return true; } } + +//TODO: only install the dependencies libraries(libssl) +int EvpAES::testSSL() +{ + SSL_CTX *ssl_ctx = SSL_CTX_new(TLS_client_method()); + if(ssl_ctx) + SSL_CTX_free(ssl_ctx); + return 0; +} diff --git a/Src/EvpAES.h b/Src/EvpAES.h index 297f274a..09cb8a1f 100644 --- a/Src/EvpAES.h +++ b/Src/EvpAES.h @@ -57,6 +57,9 @@ class EvpAES bool encrypt(const QByteArray& in, QByteArray& out, const QByteArray& key, const QByteArray& ivec, const EVP_CIPHER *cipher, bool enc = true); + + //TODO: only install the dependencies libraries(libssl) + int testSSL(); private: EVP_CIPHER_CTX *ctx;