os_cert: only build with http

This commit is contained in:
Adrien Béraud committed 2020-11-17 15:20:46 -05:00
1 parent 81cdd9650b
commit b5fcd49b7b
3 files changed
+10 -8

No files matched your search

+5 -7
View File
@@ -1,10 +1,11 @@
cmake_minimum_required (VERSION 3.1)
project (opendht)
include(CMakePackageConfigHelpers)
include(CMakeDependentOption)
include(FindPkgConfig)
include(cmake/CheckAtomic.cmake)
project (opendht)
set (opendht_VERSION_MAJOR 2)
set (opendht_VERSION_MINOR 1.7)
set (opendht_VERSION ${opendht_VERSION_MAJOR}.${opendht_VERSION_MINOR})
@@ -301,9 +302,11 @@ if (OPENDHT_HTTP)
list (APPEND opendht_HEADERS
include/opendht/proxy.h
include/opendht/http.h
src/compat/os_cert.h
)
list (APPEND opendht_SOURCES
src/http.cpp
src/compat/os_cert.cpp
)
endif ()
@@ -324,13 +327,8 @@ if(OPENDHT_ARGON2)
include_directories(argon2/include/)
endif()
# cross-platform compatibility sources
set (COMPAT_DIR ${PROJECT_SOURCE_DIR}/src/compat/)
list (APPEND opendht_SOURCES ${COMPAT_DIR}/os_cert.cpp)
if (MSVC)
set (MSC_COMPAT_DIR ${COMPAT_DIR}/msvc/)
list (APPEND opendht_SOURCES ${MSC_COMPAT_DIR}/unistd.h)
list (APPEND opendht_HEADERS src/compat/msvc/unistd.h)
endif ()
# Targets
+3 -1
View File
@@ -39,6 +39,7 @@
#define GENTIME_LENGTH 15
#define UTCTIME_LENGTH 13
#define ATOI2(ar) ((ar) += 2, ((ar)[-2] - '0') * 10 + ((ar)[-1] - '0'))
extern "C" {
// Taken from libressl/src/crypto/asn1/a_time_tm.c
int
ASN1_time_parse(const char* bytes, size_t len, struct tm* tm, int mode)
@@ -116,7 +117,8 @@ ASN1_time_parse(const char* bytes, size_t len, struct tm* tm, int mode)
return (-1);
}
return (type);
return type;
}
}
#endif /* EMBEDDED_ASN1_TIME_PARSE */
+2
View File
@@ -34,6 +34,7 @@
#define V_ASN1_UTCTIME 23
#define V_ASN1_GENERALIZEDTIME 24
extern "C" {
/*
* Parse an RFC 5280 format ASN.1 time string.
*
@@ -50,6 +51,7 @@
* Fills in *tm with the corresponding time if tm is non NULL.
*/
int ASN1_time_parse(const char* bytes, size_t len, struct tm* tm, int mode);
}
#endif
namespace dht {