commit 90fe94e61a307469c0e3c9e4fdeb55ef79aa6bac Author: Felix Tiede Date: Sun May 22 21:16:37 2016 +0200 Quick and dirty fix for new QString API. diff --git a/request.cpp b/request.cpp index add565d..202314b 100644 --- a/request.cpp +++ b/request.cpp @@ -412,7 +412,7 @@ const Certificate Request::selfsign(quint64 serial, const Digest digest, } 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); commit e97d214657c3f909a6c4a2aaaba80a58b28f857b Author: Felix Tiede Date: Sun May 22 21:16:08 2016 +0200 Reactivate building of unit tests. diff --git a/CMakeLists.txt b/CMakeLists.txt index d52ec0a..7a634a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ install( FILES ${kca_ossl_LIB_HDRS} COMPONENT Devel ) -#add_subdirectory(tests) +add_subdirectory(tests) ################################################################################ commit 33b8c085aca27a86ce749bdb1a10daf8685b0697 Author: Felix Tiede Date: Sun May 22 20:45:01 2016 +0200 Fixed tests build system for Qt5 Test library. diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7ae2e29..f3ea8b8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,22 +6,18 @@ set(test_SRCS 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) commit 5b3f1bfbb53758b9df39a3824e2c4b8727f7a58c Author: Felix Tiede Date: Sun May 22 20:34:17 2016 +0200 Definitions are part of the configure phase. diff --git a/CMakeLists.txt b/CMakeLists.txt index fa08b31..d52ec0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,8 @@ IF(NOT WIN32) ENDIF(OPENSSL_CRYPTO_LIBS) ENDIF(NOT WIN32) +add_definitions( -DMAKE_KCAOSSL_LIB ) + ################################################################################ set(kca_ossl_LIB_SRCS @@ -63,8 +65,6 @@ set(kca_ossl_LIB_HDRS 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} ) commit 88309b26602b9cb5ae3158300e4ed84a97d347e3 Author: Felix Tiede Date: Sun May 22 20:23:27 2016 +0200 qt*_wrap_cpp is replaced by CMAKE_AUTOMOC=ON. diff --git a/CMakeLists.txt b/CMakeLists.txt index eced712..fa08b31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,9 +61,6 @@ set(kca_ossl_LIB_HDRS 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 ) commit c2f3d986a65813cfc22c8fd3d3509e7c4e4f5c4c Author: Felix Tiede Date: Sun May 22 20:22:03 2016 +0200 Removed stale unused variable. diff --git a/CMakeLists.txt b/CMakeLists.txt index b0fa832..eced712 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,6 @@ set(kca_ossl_LIB_HDRS # 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 ) commit 0a3918877e768f91b94983c4b61c4df5acc53e30 Author: Felix Tiede Date: Sun May 22 20:21:09 2016 +0200 Reordered package dependencies for proper order. diff --git a/CMakeLists.txt b/CMakeLists.txt index 3af81b8..b0fa832 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,6 @@ set(GENERIC_LIB_SOVERSION "3") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) -find_package(OpenSSL REQUIRED) - find_package(Qt5Core REQUIRED) set(QTLIBS Qt5::Core) @@ -26,7 +24,10 @@ IF(WITH_QtNetwork) 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) commit 70eb8dce1627a5baf7b3c3ac51abeee4d9af1c37 Author: Felix Tiede Date: Sun May 22 20:20:39 2016 +0200 Removed stale commented if-clause. diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e8d778..3af81b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,11 +20,11 @@ find_package(OpenSSL REQUIRED) 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) commit 28399bef6ab8f70bf03f28580107af95cff6b40b Author: Felix Tiede Date: Sun May 22 20:13:02 2016 +0200 Better formatting for Qt5 dependencies. diff --git a/CMakeLists.txt b/CMakeLists.txt index 770ca91..5e8d778 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,8 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) 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) commit 03dc33ebc79026f536c7287cee6da4bf2c124f5f Author: Felix Tiede Date: Fri May 13 06:58:18 2016 +0200 Build system configured for Qt5/new major version. diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cc8e3f..770ca91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -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) @@ -9,19 +9,23 @@ endif(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) @@ -57,35 +61,33 @@ set(kca_ossl_LIB_HDRS ) # 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) ################################################################################ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c437be0..7ae2e29 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,7 +6,7 @@ set(test_SRCS x509extensiontest.cpp ) -find_package(Qt4 COMPONENTS QtTest REQUIRED) +find_package(Qt5::Test REQUIRED) enable_testing() include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) @@ -19,7 +19,7 @@ FOREACH(it ${test_SRCS}) 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} )