mirror of
https://github.com/QuasarApp/qca.git
synced 2025-05-06 07:49:34 +00:00
Actually detect whether MD2 is avalable for OpenSSL plugin
CCMAIL: fundawang@linux.net.cn svn path=/trunk/kdesupport/qca/; revision=1115936
This commit is contained in:
parent
4c9afd56cc
commit
38a76161a3
@ -1,5 +1,12 @@
|
|||||||
# QCA OSSL
|
# QCA OSSL
|
||||||
|
|
||||||
|
INCLUDE(CheckFunctionExists)
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
|
||||||
|
CHECK_FUNCTION_EXISTS(EVP_md2 HAVE_OPENSSL_MD2)
|
||||||
|
IF (HAVE_OPENSSL_MD2)
|
||||||
|
ADD_DEFINITIONS(-DHAVE_OPENSSL_MD2)
|
||||||
|
ENDIF (HAVE_OPENSSL_MD2)
|
||||||
|
|
||||||
SET(QCA_OSSL_SOURCES qca-ossl.cpp)
|
SET(QCA_OSSL_SOURCES qca-ossl.cpp)
|
||||||
|
|
||||||
MY_AUTOMOC( QCA_OSSL_SOURCES )
|
MY_AUTOMOC( QCA_OSSL_SOURCES )
|
||||||
@ -9,9 +16,11 @@ INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
|
|||||||
TARGET_LINK_LIBRARIES(qca-ossl ${QT_QTCORE_LIBRARY})
|
TARGET_LINK_LIBRARIES(qca-ossl ${QT_QTCORE_LIBRARY})
|
||||||
TARGET_LINK_LIBRARIES(qca-ossl qca)
|
TARGET_LINK_LIBRARIES(qca-ossl qca)
|
||||||
TARGET_LINK_LIBRARIES(qca-ossl ${OPENSSL_LIBRARIES})
|
TARGET_LINK_LIBRARIES(qca-ossl ${OPENSSL_LIBRARIES})
|
||||||
if(APPLE)
|
|
||||||
TARGET_LINK_LIBRARIES(qca-ossl crypto)
|
IF (APPLE)
|
||||||
endif(APPLE)
|
TARGET_LINK_LIBRARIES(qca-ossl crypto)
|
||||||
|
ENDIF (APPLE)
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
ADD_DEFINITIONS(-DOSSL_097)
|
ADD_DEFINITIONS(-DOSSL_097)
|
||||||
TARGET_LINK_LIBRARIES(qca-ossl gdi32)
|
TARGET_LINK_LIBRARIES(qca-ossl gdi32)
|
||||||
|
@ -1782,7 +1782,7 @@ public:
|
|||||||
md = EVP_sha1();
|
md = EVP_sha1();
|
||||||
else if(alg == EMSA3_MD5)
|
else if(alg == EMSA3_MD5)
|
||||||
md = EVP_md5();
|
md = EVP_md5();
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
else if(alg == EMSA3_MD2)
|
else if(alg == EMSA3_MD2)
|
||||||
md = EVP_md2();
|
md = EVP_md2();
|
||||||
#endif
|
#endif
|
||||||
@ -1810,7 +1810,7 @@ public:
|
|||||||
md = EVP_sha1();
|
md = EVP_sha1();
|
||||||
else if(alg == EMSA3_MD5)
|
else if(alg == EMSA3_MD5)
|
||||||
md = EVP_md5();
|
md = EVP_md5();
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
else if(alg == EMSA3_MD2)
|
else if(alg == EMSA3_MD2)
|
||||||
md = EVP_md2();
|
md = EVP_md2();
|
||||||
#endif
|
#endif
|
||||||
@ -3416,7 +3416,7 @@ public:
|
|||||||
case NID_md5WithRSAEncryption:
|
case NID_md5WithRSAEncryption:
|
||||||
p.sigalgo = QCA::EMSA3_MD5;
|
p.sigalgo = QCA::EMSA3_MD5;
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
case NID_md2WithRSAEncryption:
|
case NID_md2WithRSAEncryption:
|
||||||
p.sigalgo = QCA::EMSA3_MD2;
|
p.sigalgo = QCA::EMSA3_MD2;
|
||||||
break;
|
break;
|
||||||
@ -3916,7 +3916,7 @@ public:
|
|||||||
case NID_md5WithRSAEncryption:
|
case NID_md5WithRSAEncryption:
|
||||||
p.sigalgo = QCA::EMSA3_MD5;
|
p.sigalgo = QCA::EMSA3_MD5;
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
case NID_md2WithRSAEncryption:
|
case NID_md2WithRSAEncryption:
|
||||||
p.sigalgo = QCA::EMSA3_MD2;
|
p.sigalgo = QCA::EMSA3_MD2;
|
||||||
break;
|
break;
|
||||||
@ -4108,7 +4108,7 @@ public:
|
|||||||
case NID_md5WithRSAEncryption:
|
case NID_md5WithRSAEncryption:
|
||||||
p.sigalgo = QCA::EMSA3_MD5;
|
p.sigalgo = QCA::EMSA3_MD5;
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
case NID_md2WithRSAEncryption:
|
case NID_md2WithRSAEncryption:
|
||||||
p.sigalgo = QCA::EMSA3_MD2;
|
p.sigalgo = QCA::EMSA3_MD2;
|
||||||
break;
|
break;
|
||||||
@ -6650,7 +6650,7 @@ static QStringList all_hash_types()
|
|||||||
list += "sha1";
|
list += "sha1";
|
||||||
list += "sha0";
|
list += "sha0";
|
||||||
list += "ripemd160";
|
list += "ripemd160";
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
list += "md2";
|
list += "md2";
|
||||||
#endif
|
#endif
|
||||||
list += "md4";
|
list += "md4";
|
||||||
@ -6861,7 +6861,7 @@ public:
|
|||||||
list += all_hash_types();
|
list += all_hash_types();
|
||||||
list += all_mac_types();
|
list += all_mac_types();
|
||||||
list += all_cipher_types();
|
list += all_cipher_types();
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
list += "pbkdf1(md2)";
|
list += "pbkdf1(md2)";
|
||||||
#endif
|
#endif
|
||||||
list += "pbkdf1(sha1)";
|
list += "pbkdf1(sha1)";
|
||||||
@ -6896,7 +6896,7 @@ public:
|
|||||||
return new opensslHashContext( EVP_sha(), this, type);
|
return new opensslHashContext( EVP_sha(), this, type);
|
||||||
else if ( type == "ripemd160" )
|
else if ( type == "ripemd160" )
|
||||||
return new opensslHashContext( EVP_ripemd160(), this, type);
|
return new opensslHashContext( EVP_ripemd160(), this, type);
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
else if ( type == "md2" )
|
else if ( type == "md2" )
|
||||||
return new opensslHashContext( EVP_md2(), this, type);
|
return new opensslHashContext( EVP_md2(), this, type);
|
||||||
#endif
|
#endif
|
||||||
@ -6928,7 +6928,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
else if ( type == "pbkdf1(sha1)" )
|
else if ( type == "pbkdf1(sha1)" )
|
||||||
return new opensslPbkdf1Context( EVP_sha1(), this, type );
|
return new opensslPbkdf1Context( EVP_sha1(), this, type );
|
||||||
#ifdef HAVE_OPENSSL_MD2_H
|
#ifdef HAVE_OPENSSL_MD2
|
||||||
else if ( type == "pbkdf1(md2)" )
|
else if ( type == "pbkdf1(md2)" )
|
||||||
return new opensslPbkdf1Context( EVP_md2(), this, type );
|
return new opensslPbkdf1Context( EVP_md2(), this, type );
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user