Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNG Provider Build Updates #425

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cmake_minimum_required (VERSION 3.5)
cmake_policy(SET CMP0025 NEW)
cmake_policy(SET CMP0042 NEW)
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0091 NEW)

project (yubihsm-shell)

Expand Down
16 changes: 13 additions & 3 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
# limitations under the License.
#

include(${CMAKE_SOURCE_DIR}/cmake/openssl.cmake)
find_libcrypto()
if(${WIN32_BCRYPT})
else(${WIN32_BCRYPT})
include(${CMAKE_SOURCE_DIR}/cmake/openssl.cmake)
find_libcrypto()
endif(${WIN32_BCRYPT})

if(MSVC)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
Expand All @@ -29,7 +32,6 @@ set (
${CMAKE_CURRENT_SOURCE_DIR}/../common/pkcs5.c
${CMAKE_CURRENT_SOURCE_DIR}/../common/rand.c
${CMAKE_CURRENT_SOURCE_DIR}/../common/ecdh.c
${CMAKE_CURRENT_SOURCE_DIR}/../common/openssl-compat.c
error.c
lib_util.c
yubihsm.c
Expand All @@ -40,6 +42,11 @@ if(MSVC)
endif(MSVC)
set(STATIC_SOURCE ${SOURCE})

if(NOT ${WIN32_BCRYPT})
set(SOURCE ${SOURCE} ${CMAKE_CURRENT_SOURCE_DIR}/../common/openssl-compat.c)
endif(NOT ${WIN32_BCRYPT})
set (STATIC_SOURCE ${SOURCE})

if(WIN32)
set(ADDITIONAL_LIBRARY ws2_32)
set (
Expand Down Expand Up @@ -117,6 +124,9 @@ if (ENABLE_STATIC)
add_library (yubihsm_static STATIC ${STATIC_SOURCE})
set_target_properties (yubihsm_static PROPERTIES POSITION_INDEPENDENT_CODE on OUTPUT_NAME yubihsm)
set_target_properties (yubihsm_static PROPERTIES COMPILE_FLAGS "-DSTATIC " )
if(MSVC)
set_property(TARGET yubihsm_static PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif(MSVC)
add_coverage (yubihsm_static)
endif()

Expand Down
3 changes: 2 additions & 1 deletion lib/yubihsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4627,8 +4627,9 @@ yh_rc yh_init(void) {

#ifdef STATIC
static yh_rc load_backend(const char *name,
void **backend __attribute__((unused)),
void **backend,
struct backend_functions **bf) {
(void)backend;
if (name == NULL) {
DBG_ERR("No name given to load_backend");
return YHR_GENERIC_ERROR;
Expand Down
Loading