From 114c485a65fcf7575463a7ced94f2f2d0245e8fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Fri, 15 May 2020 13:50:05 +0200 Subject: [PATCH] move openssl::version to cxx file due to link problems --- src/makefile.am | 2 +- src/openssl-compatibility.hxx | 28 ++++++++------------------ src/openssl.cxx | 37 +++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 21 deletions(-) create mode 100644 src/openssl.cxx diff --git a/src/makefile.am b/src/makefile.am index 410c142..7189eea 100644 --- a/src/makefile.am +++ b/src/makefile.am @@ -16,7 +16,7 @@ EXTRA_DIST = ${top_srcdir}/src/overview.cxx lib_LTLIBRARIES = libpcscxx.la libpcscxx_la_SOURCES = cryptoki.cxx cryptoki.hxx pcsc.cxx version.cxx \ - openssl-engine.cxx + openssl.cxx openssl-engine.cxx libpcscxx_la_LDFLAGS = -version-info ${LIB_VERSION} bin_PROGRAMS = diff --git a/src/openssl-compatibility.hxx b/src/openssl-compatibility.hxx index b43c541..13c2bf5 100644 --- a/src/openssl-compatibility.hxx +++ b/src/openssl-compatibility.hxx @@ -5,6 +5,9 @@ // 1 2 3 4 5 6 7 8 // 45678901234567890123456789012345678901234567890123456789012345678901234567890 +#ifndef OPENSSL_COMPATIBILITY_HXX +#define OPENSSL_COMPATIBILITY_HXX + #undef DATADIR #include #ifndef OPENSSL_VERSION_NUMBER @@ -50,34 +53,17 @@ #include #include #include +#include namespace openssl { //============================================================================== //! @addtogroup opensslcompat - //@{ - + //@{ /// Get OpenSSL runtime and buildtime version information /** To be displyed in an about box. It also shows mandatory license information. */ - inline std::string version() { - std::string v - ((std::string(OPENSSL_VERSION_TEXT)==SSLeay_version(SSLEAY_VERSION)) - ? SSLeay_version(SSLEAY_VERSION) - : std::string(OPENSSL_VERSION_TEXT) + " (Buildtime)" - + "\n - Runtime: " + SSLeay_version(SSLEAY_VERSION)); - return v - + "\n - OpenSSL API "+SHLIB_VERSION_NUMBER+" compatible" - + "\n - " + SSLeay_version(SSLEAY_BUILT_ON) - + "\n - " + SSLeay_version(SSLEAY_PLATFORM) - + "\n\n" - "This product includes software developed by the OpenSSL Project" - " for use in the OpenSSL Toolkit (http://www.openssl.org/)" - "\n\n" - "This product includes cryptographic software written by Eric Young" - " (eay@cryptsoft.com)"; - } - + std::string version(); //------------------------------------------------------------------------------ #if OPENSSL_VERSION_NUMBER < 0x10100000L @@ -762,3 +748,5 @@ inline int RSA_meth_set_keygen(RSA_METHOD *meth, //@} } + +#endif diff --git a/src/openssl.cxx b/src/openssl.cxx new file mode 100644 index 0000000..1a6d9e4 --- /dev/null +++ b/src/openssl.cxx @@ -0,0 +1,37 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#include +#include + +namespace openssl { + + //============================================================================== + //! @addtogroup opensslcompat + //@{ + /// Get OpenSSL runtime and buildtime version information + /** To be displyed in an about box. It also shows mandatory license + information. */ + std::string version() { + std::string v + ((std::string(OPENSSL_VERSION_TEXT)==SSLeay_version(SSLEAY_VERSION)) + ? SSLeay_version(SSLEAY_VERSION) + : std::string(OPENSSL_VERSION_TEXT) + " (Buildtime)" + + "\n - Runtime: " + SSLeay_version(SSLEAY_VERSION)); + return v + + "\n - OpenSSL API "+SHLIB_VERSION_NUMBER+" compatible" + + "\n - " + SSLeay_version(SSLEAY_BUILT_ON) + + "\n - " + SSLeay_version(SSLEAY_PLATFORM) + + "\n\n" + "This product includes software developed by the OpenSSL Project" + " for use in the OpenSSL Toolkit (http://www.openssl.org/)" + "\n\n" + "This product includes cryptographic software written by Eric Young" + " (eay@cryptsoft.com)"; + } + +}