diff options
| author | 2011-02-11 13:22:22 +0000 | |
|---|---|---|
| committer | 2011-02-11 13:22:22 +0000 | |
| commit | d07b987622bfc9fd13398ab412cd847541193c09 (patch) | |
| tree | db5290a5141e36439d520efad560ff07fe940014 /src | |
| parent | added turkish translation (diff) | |
| download | KVIrc-d07b987622bfc9fd13398ab412cd847541193c09.tar.gz KVIrc-d07b987622bfc9fd13398ab412cd847541193c09.tar.bz2 KVIrc-d07b987622bfc9fd13398ab412cd847541193c09.zip | |
Don't make Crypto++ and OpenSSL support mutally exclusive.
This allows using SSL encrypted connections and still use Crypto++ for
the remaining cryptographic functions.
Signed-off-by: Kai Wasserbäch <curan@debian.org>
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5466 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/file/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/modules/file/libkvifile.cpp | 4 | ||||
| -rw-r--r-- | src/modules/fish/libkvifish.cpp | 8 | ||||
| -rw-r--r-- | src/modules/str/CMakeLists.txt | 14 | ||||
| -rw-r--r-- | src/modules/str/libkvistr.cpp | 12 |
5 files changed, 19 insertions, 23 deletions
diff --git a/src/modules/file/CMakeLists.txt b/src/modules/file/CMakeLists.txt index e1cfc32d0..40aa796f9 100644 --- a/src/modules/file/CMakeLists.txt +++ b/src/modules/file/CMakeLists.txt @@ -1,9 +1,5 @@ # CMakeLists for src/modules/file -IF(WANT_NO_EMBEDDED_CODE) - ADD_DEFINITIONS("-DCOMPILE_NO_EMBEDDED_CODE -fexceptions") -ENDIF(WANT_NO_EMBEDDED_CODE) - SET(kvifile_SRCS libkvifile.cpp ) diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp index c30236114..1a3816bbb 100644 --- a/src/modules/file/libkvifile.cpp +++ b/src/modules/file/libkvifile.cpp @@ -37,7 +37,7 @@ #include <QTextCodec> #include <QByteArray> -#if defined(COMPILE_SSL_SUPPORT) +#if defined(COMPILE_SSL_SUPPORT) && !defined(COMPILE_CRYPTOPP_SUPPORT) // The current implementation #include <openssl/evp.h> #elif defined(COMPILE_CRYPTOPP_SUPPORT) @@ -1420,7 +1420,7 @@ static bool file_kvs_fnc_digest(KviKvsModuleFunctionCall * c) return true; } -#if defined(COMPILE_SSL_SUPPORT) +#if defined(COMPILE_SSL_SUPPORT) && !defined(COMPILE_CRYPTOPP_SUPPORT) if(szAlgo.isEmpty()) szAlgo = "md5"; EVP_MD_CTX mdctx; diff --git a/src/modules/fish/libkvifish.cpp b/src/modules/fish/libkvifish.cpp index 0f2d9c81a..2b80d2eff 100644 --- a/src/modules/fish/libkvifish.cpp +++ b/src/modules/fish/libkvifish.cpp @@ -53,7 +53,7 @@ // KviApplication.cpp extern KVIRC_API KviCryptEngineManager * g_pCryptEngineManager; - #ifdef COMPILE_SSL_SUPPORT + #if defined(COMPILE_SSL_SUPPORT) && !defined(COMPILE_CRYPTOPP_SUPPORT) #include <KviSSL.h> #include <openssl/blowfish.h> @@ -90,7 +90,7 @@ static bool fish_DH1080_gen(unsigned char ** szPubKey, int * iLen) { - #ifdef COMPILE_SSL_SUPPORT + #if defined(COMPILE_SSL_SUPPORT) && !defined(COMPILE_CRYPTOPP_SUPPORT) if(!g_fish_dh) { BIGNUM * dhp = BN_new(); @@ -236,7 +236,7 @@ KviCString szFinalKey; - #ifdef COMPILE_SSL_SUPPORT + #if defined(COMPILE_SSL_SUPPORT) && !defined(COMPILE_CRYPTOPP_SUPPORT) unsigned char * secret=(unsigned char *) KviMemory::allocate(DH_size(g_fish_dh)); int secretLen; BIGNUM *bn = BN_bin2bn((unsigned char *) szHisPubKey.data(), szHisPubKey.size(),NULL); @@ -341,7 +341,7 @@ static bool fish_module_init(KviModule * m) { #ifdef COMPILE_CRYPT_SUPPORT - #ifdef COMPILE_SSL_SUPPORT + #if defined( COMPILE_SSL_SUPPORT) && !defined(COMPILE_CRYPTOPP_SUPPORT) KviSSL::globalSSLInit(); #endif m->kvsRegisterAppEventHandler(KviEvent_OnQueryNotice,fish_event_onQueryNotice); diff --git a/src/modules/str/CMakeLists.txt b/src/modules/str/CMakeLists.txt index 55fce625a..c0c5bbf1f 100644 --- a/src/modules/str/CMakeLists.txt +++ b/src/modules/str/CMakeLists.txt @@ -1,14 +1,10 @@ # CMakeLists for src/modules/str -IF(WANT_NO_EMBEDDED_CODE) - ADD_DEFINITIONS("-DCOMPILE_NO_EMBEDDED_CODE -fexceptions") -ELSEIF(WANT_NO_EMBEDDED_CODE) - IF(UNIX) - IF(APPLE) - LIST(APPEND LIBS -lssl -lcrypto) - ENDIF() - ENDIF() -ENDIF(WANT_NO_EMBEDDED_CODE) +IF(UNIX) + IF(APPLE) + LIST(APPEND LIBS -lssl -lcrypto) + ENDIF() +ENDIF() SET(kvistr_SRCS libkvistr.cpp diff --git a/src/modules/str/libkvistr.cpp b/src/modules/str/libkvistr.cpp index 668fc8996..18556ac5c 100644 --- a/src/modules/str/libkvistr.cpp +++ b/src/modules/str/libkvistr.cpp @@ -38,12 +38,14 @@ #include <QRegExp> #include <QClipboard> -#if defined( COMPILE_SSL_SUPPORT ) +#ifdef COMPILE_SSL_SUPPORT // The current implementation #include <KviSSL.h> #include <openssl/evp.h> #include <openssl/pem.h> -#elif defined(COMPILE_CRYPTOPP_SUPPORT) +#endif + +#ifdef COMPILE_CRYPTOPP_SUPPORT // The preferred new implementation (until QCryptographicHash supports all // hashes we want). // As Crypto++ is concerned for security they warn about MD5 and friends, @@ -76,7 +78,9 @@ ); return szDigest; } -#else +#endif + +#if !defined(COMPILE_SSL_SUPPORT) && !defined(COMPILE_CRYPTOPP_SUPPORT) // The fallback we can always use, but with very limited set of // functionality. #include <QCryptographicHash> @@ -1371,7 +1375,7 @@ static bool str_kvs_fnc_digest(KviKvsModuleFunctionCall * c) KVSM_PARAMETER("algorithm",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szType) KVSM_PARAMETERS_END(c) -#if defined(COMPILE_SSL_SUPPORT) +#if defined(COMPILE_SSL_SUPPORT) && !defined(COMPILE_CRYPTOPP_SUPPORT) if(szType.isEmpty()) szType = "md5"; EVP_MD_CTX mdctx; |
