summaryrefslogtreecommitdiff
path: root/lib/crypto/CipherContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/crypto/CipherContext.cpp')
-rwxr-xr-xlib/crypto/CipherContext.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/crypto/CipherContext.cpp b/lib/crypto/CipherContext.cpp
index 42707497..8c3b25b2 100755
--- a/lib/crypto/CipherContext.cpp
+++ b/lib/crypto/CipherContext.cpp
@@ -29,7 +29,7 @@ CipherContext::CipherContext()
: mInitialised(false),
mWithinTransform(false),
mPaddingOn(true)
-#ifdef PLATFORM_OLD_OPENSSL
+#ifdef HAVE_OLD_SSL
, mFunction(Decrypt),
mpDescription(0)
#endif
@@ -52,7 +52,7 @@ CipherContext::~CipherContext()
EVP_CIPHER_CTX_cleanup(&ctx);
mInitialised = false;
}
-#ifdef PLATFORM_OLD_OPENSSL
+#ifdef HAVE_OLD_SSL
if(mpDescription != 0)
{
delete mpDescription;
@@ -83,7 +83,7 @@ void CipherContext::Init(CipherContext::CipherFunction Function, const CipherDes
}
// Initialise the cipher
-#ifndef PLATFORM_OLD_OPENSSL
+#ifndef HAVE_OLD_SSL
EVP_CIPHER_CTX_init(&ctx); // no error return code, even though the docs says it does
if(EVP_CipherInit_ex(&ctx, rDescription.GetCipher(), NULL, NULL, NULL, Function) != 1)
@@ -100,7 +100,7 @@ void CipherContext::Init(CipherContext::CipherFunction Function, const CipherDes
try
{
-#ifndef PLATFORM_OLD_OPENSSL
+#ifndef HAVE_OLD_SSL
// Let the description set up everything else
rDescription.SetupParameters(&ctx);
#else
@@ -137,7 +137,7 @@ void CipherContext::Reset()
EVP_CIPHER_CTX_cleanup(&ctx);
mInitialised = false;
}
-#ifdef PLATFORM_OLD_OPENSSL
+#ifdef HAVE_OLD_SSL
if(mpDescription != 0)
{
delete mpDescription;
@@ -270,7 +270,7 @@ int CipherContext::Final(void *pOutBuffer, int OutLength)
// Do the transform
int outLength = OutLength;
-#ifndef PLATFORM_OLD_OPENSSL
+#ifndef HAVE_OLD_SSL
if(EVP_CipherFinal_ex(&ctx, (unsigned char*)pOutBuffer, &outLength) != 1)
{
THROW_EXCEPTION(CipherException, EVPFinalFailure)
@@ -285,7 +285,7 @@ int CipherContext::Final(void *pOutBuffer, int OutLength)
}
-#ifdef PLATFORM_OLD_OPENSSL
+#ifdef HAVE_OLD_SSL
// --------------------------------------------------------------------------
//
// Function
@@ -458,7 +458,7 @@ int CipherContext::TransformBlock(void *pOutBuffer, int OutLength, const void *p
}
// Finalise
int outLength2 = OutLength - outLength;
-#ifndef PLATFORM_OLD_OPENSSL
+#ifndef HAVE_OLD_SSL
if(EVP_CipherFinal_ex(&ctx, ((unsigned char*)pOutBuffer) + outLength, &outLength2) != 1)
{
THROW_EXCEPTION(CipherException, EVPFinalFailure)
@@ -472,7 +472,7 @@ int CipherContext::TransformBlock(void *pOutBuffer, int OutLength, const void *p
{
// Finalise the context, so definately ready for the next caller
int outs = OutLength;
-#ifndef PLATFORM_OLD_OPENSSL
+#ifndef HAVE_OLD_SSL
EVP_CipherFinal_ex(&ctx, (unsigned char*)pOutBuffer, &outs);
#else
OldOpenSSLFinal((unsigned char*)pOutBuffer, outs);
@@ -530,7 +530,7 @@ void CipherContext::SetIV(const void *pIV)
THROW_EXCEPTION(CipherException, EVPInitFailure)
}
-#ifdef PLATFORM_OLD_OPENSSL
+#ifdef HAVE_OLD_SSL
// Update description
if(mpDescription != 0)
{
@@ -578,7 +578,7 @@ const void *CipherContext::SetRandomIV(int &rLengthOut)
THROW_EXCEPTION(CipherException, EVPInitFailure)
}
-#ifdef PLATFORM_OLD_OPENSSL
+#ifdef HAVE_OLD_SSL
// Update description
if(mpDescription != 0)
{
@@ -602,7 +602,7 @@ const void *CipherContext::SetRandomIV(int &rLengthOut)
// --------------------------------------------------------------------------
void CipherContext::UsePadding(bool Padding)
{
-#ifndef PLATFORM_OLD_OPENSSL
+#ifndef HAVE_OLD_SSL
if(EVP_CIPHER_CTX_set_padding(&ctx, Padding) != 1)
{
THROW_EXCEPTION(CipherException, EVPSetPaddingFailure)