Merge branch 'poco-1.8.0' of https://github.com/pocoproject/poco into poco-1.8.0

This commit is contained in:
Alex Fabijanic 2017-09-22 18:31:39 -05:00
commit b7fbdabf5f
3 changed files with 12 additions and 7 deletions

View File

@ -8,7 +8,9 @@ include $(POCO_BASE)/build/rules/global
SYSLIBS += -lssl -lcrypto SYSLIBS += -lssl -lcrypto
objects = Cipher CipherFactory CipherImpl CipherKey CipherKeyImpl CryptoStream CryptoTransform \ objects = Cipher CipherFactory CipherImpl CipherKey CipherKeyImpl \
CryptoException CryptoStream CryptoTransform ECDSADigestEngine \
ECKey ECKeyImpl EVPPKey KeyPair KeyPairImpl PKCS12Container \
RSACipherImpl RSAKey RSAKeyImpl RSADigestEngine DigestEngine \ RSACipherImpl RSAKey RSAKeyImpl RSADigestEngine DigestEngine \
X509Certificate OpenSSLInitializer X509Certificate OpenSSLInitializer

View File

@ -27,6 +27,7 @@
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <sstream> #include <sstream>
#include <typeinfo>
namespace Poco { namespace Poco {
@ -146,8 +147,8 @@ private:
const std::string& keyFile, const std::string& keyFile,
const std::string& pass = "") const std::string& pass = "")
{ {
poco_assert_dbg (((typeid(K) == typeid(RSA) || typeid(K) == typeid(EC_KEY)) && getFunc) || poco_assert_dbg (((typeid(K*) == typeid(RSA*) || typeid(K*) == typeid(EC_KEY*)) && getFunc) ||
((typeid(K) == typeid(EVP_PKEY)) && !getFunc)); ((typeid(K*) == typeid(EVP_PKEY*)) && !getFunc));
poco_check_ptr (ppKey); poco_check_ptr (ppKey);
poco_assert_dbg (!*ppKey); poco_assert_dbg (!*ppKey);
@ -192,8 +193,8 @@ private:
std::istream* pIstr, std::istream* pIstr,
const std::string& pass = "") const std::string& pass = "")
{ {
poco_assert_dbg (((typeid(K) == typeid(RSA) || typeid(K) == typeid(EC_KEY)) && getFunc) || poco_assert_dbg (((typeid(K*) == typeid(RSA*) || typeid(K*) == typeid(EC_KEY*)) && getFunc) ||
((typeid(K) == typeid(EVP_PKEY)) && !getFunc)); ((typeid(K*) == typeid(EVP_PKEY*)) && !getFunc));
poco_check_ptr(ppKey); poco_check_ptr(ppKey);
poco_assert_dbg(!*ppKey); poco_assert_dbg(!*ppKey);

View File

@ -18,6 +18,8 @@
#include "CppUnit/TestSuite.h" #include "CppUnit/TestSuite.h"
#include <sstream> #include <sstream>
#include <fstream> #include <fstream>
#include <iostream>
#include <cstring>
using namespace Poco::Crypto; using namespace Poco::Crypto;
@ -126,7 +128,7 @@ void EVPTest::testRSAEVPPKey()
assert (sizePub1 && (sizePub1 == sizePub2)); assert (sizePub1 && (sizePub1 == sizePub2));
assert (0 == memcmp(pPubData1, pPubData2, sizePub1)); assert (0 == memcmp(pPubData1, pPubData2, sizePub1));
#endif POCO_ENABLE_CPP11 #endif // POCO_ENABLE_CPP11
BIO_free(bioPub2); BIO_free(bioPub2);
BIO_free(bioPriv2); BIO_free(bioPriv2);
@ -269,7 +271,7 @@ void EVPTest::testECEVPPKey()
assert (0 == memcmp(pPrivData1, pPrivData2, sizePriv1)); assert (0 == memcmp(pPrivData1, pPrivData2, sizePriv1));
assert (sizePub1 && (sizePub1 == sizePub2)); assert (sizePub1 && (sizePub1 == sizePub2));
assert (0 == memcmp(pPubData1, pPubData2, sizePub1)); assert (0 == memcmp(pPubData1, pPubData2, sizePub1));
#endif POCO_ENABLE_CPP11 #endif // POCO_ENABLE_CPP11
BIO_free(bioPub2); BIO_free(bioPub2);
BIO_free(bioPriv2); BIO_free(bioPriv2);