mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 16:48:06 +02:00
#3563: Remove support for OpenSSL < 1.0
This commit is contained in:
@@ -48,6 +48,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if OPENSSL_VERSION_NUMBER < 0x10000000L
|
||||||
|
#error "OpenSSL version too old. At least OpenSSL 1.0.0 is required."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
enum RSAPaddingMode
|
enum RSAPaddingMode
|
||||||
/// The padding mode used for RSA public key encryption.
|
/// The padding mode used for RSA public key encryption.
|
||||||
{
|
{
|
||||||
|
@@ -21,9 +21,7 @@
|
|||||||
#include "Poco/StreamCopier.h"
|
#include "Poco/StreamCopier.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x00908000L
|
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
@@ -20,11 +20,9 @@
|
|||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x0907000L
|
|
||||||
#include <openssl/conf.h>
|
#include <openssl/conf.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||||
#define POCO_STR_HELPER(x) #x
|
#define POCO_STR_HELPER(x) #x
|
||||||
#define POCO_STR(x) POCO_STR_HELPER(x)
|
#define POCO_STR(x) POCO_STR_HELPER(x)
|
||||||
@@ -98,7 +96,7 @@ void OpenSSLInitializer::initialize()
|
|||||||
{
|
{
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||||
CONF_modules_load(NULL, NULL, 0);
|
CONF_modules_load(NULL, NULL, 0);
|
||||||
#elif OPENSSL_VERSION_NUMBER >= 0x0907000L
|
#else
|
||||||
OPENSSL_config(NULL);
|
OPENSSL_config(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -21,9 +21,7 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/rsa.h>
|
#include <openssl/rsa.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x00908000L
|
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@@ -66,7 +64,6 @@ RSAKeyImpl::RSAKeyImpl(const PKCS12Container& cont):
|
|||||||
RSAKeyImpl::RSAKeyImpl(int keyLength, unsigned long exponent): KeyPairImpl("rsa", KT_RSA_IMPL),
|
RSAKeyImpl::RSAKeyImpl(int keyLength, unsigned long exponent): KeyPairImpl("rsa", KT_RSA_IMPL),
|
||||||
_pRSA(0)
|
_pRSA(0)
|
||||||
{
|
{
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x00908000L
|
|
||||||
_pRSA = RSA_new();
|
_pRSA = RSA_new();
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
BIGNUM* bn = 0;
|
BIGNUM* bn = 0;
|
||||||
@@ -83,10 +80,6 @@ RSAKeyImpl::RSAKeyImpl(int keyLength, unsigned long exponent): KeyPairImpl("rsa"
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
if (!ret) throw Poco::InvalidArgumentException("Failed to create RSA context");
|
if (!ret) throw Poco::InvalidArgumentException("Failed to create RSA context");
|
||||||
#else
|
|
||||||
_pRSA = RSA_generate_key(keyLength, exponent, 0, 0);
|
|
||||||
if (!_pRSA) throw Poco::InvalidArgumentException("Failed to create RSA context");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -812,7 +812,7 @@ void Context::initECDH(const std::string& curve)
|
|||||||
throw SSLContextException("Cannot set ECDH groups", groups);
|
throw SSLContextException("Cannot set ECDH groups", groups);
|
||||||
}
|
}
|
||||||
SSL_CTX_set_options(_pSSLContext, SSL_OP_SINGLE_ECDH_USE);
|
SSL_CTX_set_options(_pSSLContext, SSL_OP_SINGLE_ECDH_USE);
|
||||||
#elif OPENSSL_VERSION_NUMBER >= 0x0090800fL
|
#else
|
||||||
int nid = 0;
|
int nid = 0;
|
||||||
if (!curve.empty())
|
if (!curve.empty())
|
||||||
{
|
{
|
||||||
|
@@ -157,12 +157,10 @@ void SecureSocketImpl::connectSSL(bool performHandshake)
|
|||||||
}
|
}
|
||||||
SSL_set_bio(_pSSL, pBIO, pBIO);
|
SSL_set_bio(_pSSL, pBIO, pBIO);
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x0908060L && !defined(OPENSSL_NO_TLSEXT)
|
|
||||||
if (!_peerHostName.empty())
|
if (!_peerHostName.empty())
|
||||||
{
|
{
|
||||||
SSL_set_tlsext_host_name(_pSSL, _peerHostName.c_str());
|
SSL_set_tlsext_host_name(_pSSL, _peerHostName.c_str());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
|
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
|
||||||
if(_pContext->ocspStaplingResponseVerificationEnabled())
|
if(_pContext->ocspStaplingResponseVerificationEnabled())
|
||||||
|
Reference in New Issue
Block a user