From 873fc6f83727e421492b0a4d116330ba3ccaa55d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 17 Apr 2021 22:00:53 -0500 Subject: [PATCH] Build fixes --- src/Platform.h | 2 +- src/PlatformCrypto.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Platform.h b/src/Platform.h index bdda9a3..f7cd6dc 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -77,7 +77,7 @@ #define BSWAP32(x) __builtin_bswap32(x) #define BSWAP64(x) __builtin_bswap64(x) #else -#error Please define your platform's byteswap macros! +#error Please define your platform byteswap macros! #endif #if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || defined(__BIG_ENDIAN__) diff --git a/src/PlatformCrypto.c b/src/PlatformCrypto.c index 18ced76..c8bbebe 100644 --- a/src/PlatformCrypto.c +++ b/src/PlatformCrypto.c @@ -11,6 +11,10 @@ bool RandomStateInitialized = false; #include #include +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#define EVP_CIPHER_CTX_reset(x) EVP_CIPHER_CTX_cleanup(x); EVP_CIPHER_CTX_init(x) +#endif + static int addPkcs7PaddingInPlace(unsigned char* plaintext, int plaintextLen) { int paddedLength = ROUND_TO_PKCS7_PADDED_LEN(plaintextLen); unsigned char paddingByte = (unsigned char)(16 - (plaintextLen % 16));