Files » full-changes.diff
request.cpp | ||
---|---|---|
}
|
||
d->keyfile->open(QFile::ReadOnly);
|
||
FILE *keyfile = fdopen(d->keyfile->handle(), "r");
|
||
if (!PEM_read_PrivateKey(keyfile, &d->privateKey, NULL,(void *) password.toAscii().data()))
|
||
if (!PEM_read_PrivateKey(keyfile, &d->privateKey, NULL,(void *) password.toLocal8Bit().data()))
|
||
{
|
||
rewind(keyfile);
|
||
RSA *rsa = d2i_RSAPrivateKey_fp(keyfile, NULL);
|
CMakeLists.txt | ||
---|---|---|
COMPONENT Devel
|
||
)
|
||
#add_subdirectory(tests)
|
||
add_subdirectory(tests)
|
||
################################################################################
|
||
tests/CMakeLists.txt | ||
---|---|---|
x509extensiontest.cpp
|
||
)
|
||
find_package(Qt5::Test REQUIRED)
|
||
find_package(Qt5Test REQUIRED)
|
||
enable_testing()
|
||
include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
|
||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||
FOREACH(it ${test_SRCS})
|
||
GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
|
||
GET_FILENAME_COMPONENT(test ${it} NAME_WE)
|
||
qt4_make_output_file(${it} "" moc outfile)
|
||
qt4_generate_moc(${it} ${outfile})
|
||
add_executable(libkca_ossl-${test} ${it} ${outfile})
|
||
add_executable(libkca_ossl-${test} ${it})
|
||
add_test(libkca_ossl-${test} libkca_ossl-${test})
|
||
target_link_libraries(libkca_ossl-${test}
|
||
kca_ossl-3
|
||
${QT_QTCORE_LIBRARY}
|
||
${QT_QTTEST_LIBRARY}
|
||
kca_ossl-3 Qt5::Core Qt5::Test
|
||
)
|
||
ENDFOREACH(it)
|
||
CMakeLists.txt | ||
---|---|---|
ENDIF(OPENSSL_CRYPTO_LIBS)
|
||
ENDIF(NOT WIN32)
|
||
add_definitions( -DMAKE_KCAOSSL_LIB )
|
||
################################################################################
|
||
set(kca_ossl_LIB_SRCS
|
||
... | ... | |
include_directories( ${OPENSSL_INCLUDE_DIR} )
|
||
add_definitions( -DMAKE_KCAOSSL_LIB )
|
||
add_library( kca_ossl-3 SHARED ${kca_ossl_LIB_SRCS} ${KCA_OSSL_H_MOC} )
|
||
target_link_libraries( kca_ossl-3 ${QTLIBS} ${OPENSSL_LIBRARIES} )
|
CMakeLists.txt | ||
---|---|---|
x509name.h
|
||
)
|
||
# call moc for library headers
|
||
QT5_WRAP_CPP( KCA_OSSL_H_MOC ${kca_ossl_LIB_HDRS} )
|
||
include_directories( ${OPENSSL_INCLUDE_DIR} )
|
||
add_definitions( -DMAKE_KCAOSSL_LIB )
|
CMakeLists.txt | ||
---|---|---|
# call moc for library headers
|
||
QT5_WRAP_CPP( KCA_OSSL_H_MOC ${kca_ossl_LIB_HDRS} )
|
||
# Do not link to QtGui
|
||
set(QT_DONT_USE_QTGUI 1)
|
||
include_directories( ${OPENSSL_INCLUDE_DIR} )
|
||
add_definitions( -DMAKE_KCAOSSL_LIB )
|
CMakeLists.txt | ||
---|---|---|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||
set(CMAKE_AUTOMOC ON)
|
||
find_package(OpenSSL REQUIRED)
|
||
find_package(Qt5Core REQUIRED)
|
||
set(QTLIBS Qt5::Core)
|
||
... | ... | |
add_definitions( -DUSE_QTNETWORK )
|
||
ENDIF(WITH_QtNetwork)
|
||
# We need libcrypto if not compiling under Windows
|
||
# We use OpenSSL X.509 routines
|
||
find_package(OpenSSL REQUIRED)
|
||
# We also need libcrypto if not compiling under Windows
|
||
IF(NOT WIN32)
|
||
find_library(OPENSSL_CRYPTO_LIBS NAMES crypto)
|
||
IF(OPENSSL_CRYPTO_LIBS)
|
CMakeLists.txt | ||
---|---|---|
find_package(Qt5Core REQUIRED)
|
||
set(QTLIBS Qt5::Core)
|
||
IF(WITH_QtNetwork) # OR QT_QTNETWORK_LIB)
|
||
IF(WITH_QtNetwork)
|
||
find_package(Qt5Network REQUIRED)
|
||
set(QTLIBS ${QTLIBS} Qt5::Network)
|
||
add_definitions( -DUSE_QTNETWORK )
|
||
ENDIF(WITH_QtNetwork) # OR QT_QTNETWORK_LIB)
|
||
ENDIF(WITH_QtNetwork)
|
||
# We need libcrypto if not compiling under Windows
|
||
IF(NOT WIN32)
|
CMakeLists.txt | ||
---|---|---|
set(CMAKE_AUTOMOC ON)
|
||
find_package(OpenSSL REQUIRED)
|
||
find_package(Qt5Core REQUIRED)
|
||
find_package(Qt5Core REQUIRED)
|
||
set(QTLIBS Qt5::Core)
|
||
IF(WITH_QtNetwork) # OR QT_QTNETWORK_LIB)
|
CMakeLists.txt | ||
---|---|---|
cmake_minimum_required(VERSION 2.6)
|
||
cmake_minimum_required(VERSION 2.8.11)
|
||
# cmake 2.6 proposed to add this policy
|
||
if(COMMAND cmake_policy)
|
||
... | ... | |
project(libkcaossl)
|
||
set(GENERIC_LIB_VERSION "1.3.0")
|
||
set(GENERIC_LIB_SOVERSION "1")
|
||
set(GENERIC_LIB_VERSION "3.0.0")
|
||
set(GENERIC_LIB_SOVERSION "3")
|
||
set(QTCOMPONENTS QtCore)
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||
set(CMAKE_AUTOMOC ON)
|
||
find_package(OpenSSL REQUIRED)
|
||
find_package(Qt5Core REQUIRED)
|
||
set(QTLIBS Qt5::Core)
|
||
IF(WITH_QtNetwork) # OR QT_QTNETWORK_LIB)
|
||
set(QTCOMPONENTS ${QTCOMPONENTS} QtNetwork)
|
||
find_package(Qt5Network REQUIRED)
|
||
set(QTLIBS ${QTLIBS} Qt5::Network)
|
||
add_definitions( -DUSE_QTNETWORK )
|
||
ENDIF(WITH_QtNetwork) # OR QT_QTNETWORK_LIB)
|
||
find_package(Qt4 COMPONENTS ${QTCOMPONENTS} REQUIRED)
|
||
find_package(OpenSSL REQUIRED)
|
||
# We need libcrypto if not compiling under Windows
|
||
IF(NOT WIN32)
|
||
find_library(OPENSSL_CRYPTO_LIBS NAMES crypto)
|
||
... | ... | |
)
|
||
# call moc for library headers
|
||
QT4_WRAP_CPP( KCA_OSSL_H_MOC ${kca_ossl_LIB_HDRS} )
|
||
QT5_WRAP_CPP( KCA_OSSL_H_MOC ${kca_ossl_LIB_HDRS} )
|
||
# Do not link to QtGui
|
||
set(QT_DONT_USE_QTGUI 1)
|
||
include(${QT_USE_FILE})
|
||
include_directories( ${QT_INCLUDES} ${OPENSSL_INCLUDE_DIR} )
|
||
include_directories( ${OPENSSL_INCLUDE_DIR} )
|
||
add_definitions( -DMAKE_KCAOSSL_LIB )
|
||
add_library( kca_ossl-1 SHARED ${kca_ossl_LIB_SRCS} ${KCA_OSSL_H_MOC} )
|
||
add_library( kca_ossl-3 SHARED ${kca_ossl_LIB_SRCS} ${KCA_OSSL_H_MOC} )
|
||
target_link_libraries( kca_ossl-1 ${QT_LIBRARIES} ${OPENSSL_LIBRARIES} )
|
||
target_link_libraries( kca_ossl-3 ${QTLIBS} ${OPENSSL_LIBRARIES} )
|
||
set_target_properties( kca_ossl-1 PROPERTIES
|
||
set_target_properties( kca_ossl-3 PROPERTIES
|
||
VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
|
||
)
|
||
install( TARGETS kca_ossl-1 LIBRARY DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS} )
|
||
install( TARGETS kca_ossl-3 LIBRARY DESTINATION lib NAMELINK_SKIP)
|
||
install( FILES ${kca_ossl_LIB_HDRS}
|
||
commons.h
|
||
kca_ossl_export.h
|
||
DESTINATION ${INCLUDE_INSTALL_DIR}/kca_ossl-1
|
||
DESTINATION ${INCLUDE_INSTALL_DIR}/kca_ossl-3
|
||
COMPONENT Devel
|
||
)
|
||
add_subdirectory(tests)
|
||
#add_subdirectory(tests)
|
||
################################################################################
|
||
tests/CMakeLists.txt | ||
---|---|---|
x509extensiontest.cpp
|
||
)
|
||
find_package(Qt4 COMPONENTS QtTest REQUIRED)
|
||
find_package(Qt5::Test REQUIRED)
|
||
enable_testing()
|
||
include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
|
||
... | ... | |
add_executable(libkca_ossl-${test} ${it} ${outfile})
|
||
add_test(libkca_ossl-${test} libkca_ossl-${test})
|
||
target_link_libraries(libkca_ossl-${test}
|
||
kca_ossl-1
|
||
kca_ossl-3
|
||
${QT_QTCORE_LIBRARY}
|
||
${QT_QTTEST_LIBRARY}
|
||
)
|