mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-26 03:23:05 +01:00
fix(Crypto): EVP_CIPHER_CTX_init is incorrectly defined in Envelope.cpp if it is not defined already by OpenSSL. Fixed to properly use EVP_CIPHER_CTX_reset.
This commit is contained in:
parent
67c1a8a3bc
commit
5b9a405989
@ -14,12 +14,6 @@
|
|||||||
|
|
||||||
#include "Poco/Crypto/Envelope.h"
|
#include "Poco/Crypto/Envelope.h"
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
|
||||||
#if !defined(EVP_CIPHER_CTX_init)
|
|
||||||
#define EVP_CIPHER_CTX_init(a)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
namespace Crypto {
|
namespace Crypto {
|
||||||
|
|
||||||
@ -30,8 +24,8 @@ Envelope::Envelope(int cipherNID): _pCipher(EVP_get_cipherbynid(cipherNID)),
|
|||||||
poco_check_ptr(_pCipher);
|
poco_check_ptr(_pCipher);
|
||||||
poco_check_ptr(_pCtx);
|
poco_check_ptr(_pCtx);
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||||
if (1 != EVP_CIPHER_CTX_init(_pCtx))
|
if (1 != EVP_CIPHER_CTX_reset(_pCtx))
|
||||||
handleErrors(std::string("Envelope():EVP_CIPHER_CTX_init()"));
|
handleErrors(std::string("Envelope():EVP_CIPHER_CTX_reset()"));
|
||||||
#else
|
#else
|
||||||
EVP_CIPHER_CTX_init(_pCtx);
|
EVP_CIPHER_CTX_init(_pCtx);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user