aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl/cryptography.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/_cffi_src/openssl/cryptography.py')
-rw-r--r--src/_cffi_src/openssl/cryptography.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/_cffi_src/openssl/cryptography.py b/src/_cffi_src/openssl/cryptography.py
index 1ce9d0f4..8372055b 100644
--- a/src/_cffi_src/openssl/cryptography.py
+++ b/src/_cffi_src/openssl/cryptography.py
@@ -6,44 +6,44 @@ from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/opensslv.h>
+
+
+#if defined(LIBRESSL_VERSION_NUMBER)
+#define CRYPTOGRAPHY_IS_LIBRESSL 1
+#else
+#define CRYPTOGRAPHY_IS_LIBRESSL 0
+#endif
+
/*
LibreSSL removed e_os2.h from the public headers so we'll only include it
if we're using vanilla OpenSSL.
*/
-#if !defined(LIBRESSL_VERSION_NUMBER)
+#if !CRYPTOGRAPHY_IS_LIBRESSL
#include <openssl/e_os2.h>
#endif
#if defined(_WIN32)
#include <windows.h>
#endif
-#define CRYPTOGRAPHY_OPENSSL_102_OR_GREATER \
- (OPENSSL_VERSION_NUMBER >= 0x10002000)
#define CRYPTOGRAPHY_OPENSSL_102BETA2_OR_GREATER \
- (OPENSSL_VERSION_NUMBER >= 0x10002002)
+ (OPENSSL_VERSION_NUMBER >= 0x10002002 && !CRYPTOGRAPHY_IS_LIBRESSL)
#define CRYPTOGRAPHY_OPENSSL_110_OR_GREATER \
- (OPENSSL_VERSION_NUMBER >= 0x10100000)
+ (OPENSSL_VERSION_NUMBER >= 0x10100000 && !CRYPTOGRAPHY_IS_LIBRESSL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 \
- (OPENSSL_VERSION_NUMBER < 0x10002000)
+ (OPENSSL_VERSION_NUMBER < 0x10002000 || CRYPTOGRAPHY_IS_LIBRESSL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_102BETA3 \
- (OPENSSL_VERSION_NUMBER < 0x10002003)
+ (OPENSSL_VERSION_NUMBER < 0x10002003 || CRYPTOGRAPHY_IS_LIBRESSL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I \
- (OPENSSL_VERSION_NUMBER < 0x1000209fL)
+ (OPENSSL_VERSION_NUMBER < 0x1000209f || CRYPTOGRAPHY_IS_LIBRESSL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 \
- (OPENSSL_VERSION_NUMBER < 0x10100000)
+ (OPENSSL_VERSION_NUMBER < 0x10100000 || CRYPTOGRAPHY_IS_LIBRESSL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE4 \
- (OPENSSL_VERSION_NUMBER < 0x10100004)
+ (OPENSSL_VERSION_NUMBER < 0x10100004 || CRYPTOGRAPHY_IS_LIBRESSL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE5 \
- (OPENSSL_VERSION_NUMBER < 0x10100005)
+ (OPENSSL_VERSION_NUMBER < 0x10100005 || CRYPTOGRAPHY_IS_LIBRESSL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE6 \
- (OPENSSL_VERSION_NUMBER < 0x10100006)
-
-#if defined(LIBRESSL_VERSION_NUMBER)
-#define CRYPTOGRAPHY_IS_LIBRESSL 1
-#else
-#define CRYPTOGRAPHY_IS_LIBRESSL 0
-#endif
+ (OPENSSL_VERSION_NUMBER < 0x10100006 || CRYPTOGRAPHY_IS_LIBRESSL)
"""
TYPES = """