Commit 6974ec34 authored by jehan's avatar jehan

fix cmake builder integration

parent 47dfcd36
......@@ -33,6 +33,8 @@ set(PACKAGE_TARNAME "bctoolbox")
set(PACKAGE_URL "")
set(VERSION "${PACKAGE_VERSION}")
option(ENABLE_POLARSSL "Enable polarssl support" ON)
option(ENABLE_MBEDTLS "Enable mabedtls support" OFF)
include(CheckLibraryExists)
include(CheckSymbolExists)
......@@ -47,9 +49,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(MbedTLS)
if (MBEDTLS_FOUND)
if (ENABLE_MBEDTLS AND MBEDTLS_FOUND)
message("Use mbedTLS")
else()
elseif (ENABLE_POLARSSL)
find_package(PolarSSL)
if (POLARSSL_FOUND)
message("Use polarSSL")
......@@ -60,6 +62,8 @@ else()
else()
message(FATAL_ERROR " No polarSSL or mbedTLS found")
endif()
else ()
message(FATAL_ERROR "Neither polarSSL nor mbedTLS enabled")
endif()
set(prefix ${CMAKE_INSTALL_PREFIX})
......
......@@ -378,7 +378,7 @@ int32_t bctoolbox_x509_certificate_get_fingerprint(const bctoolbox_x509_certific
unsigned char buffer[64]={0}; /* buffer is max length of returned hash, which is 64 in case we use sha-512 */
size_t hash_length = 0;
const char *hash_alg_string=NULL;
size_t fingerprint_size;
size_t fingerprint_size = 0;
x509_crt *crt;
md_type_t hash_id;
if (certificate == NULL) return BCTOOLBOX_ERROR_INVALID_CERTIFICATE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment