diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-07-11 17:03:13 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-07-11 21:03:13 +0000 |
commit | 3e3444fa96a3fa911e99e1c12f1a0d859563ce2c (patch) | |
tree | 0e31161fc63ceb82586c9fcd37851c77a41731a5 /src/_cffi_src/openssl/x509_vfy.py | |
parent | dbb64bd2a4a63f6071b1ac982b96d5d07bbd8a63 (diff) | |
download | cryptography-3e3444fa96a3fa911e99e1c12f1a0d859563ce2c.tar.gz cryptography-3e3444fa96a3fa911e99e1c12f1a0d859563ce2c.tar.bz2 cryptography-3e3444fa96a3fa911e99e1c12f1a0d859563ce2c.zip |
Use a series of constants for OpenSSL version checks (#3037)
* Use a series of constants for OpenSSL version checks.
N.B. I removed several qualifiers that were being used to express beta vs. release in OpenSSL version numbers. Reviewers please look closely!
* Convert some python as well, also add the file
* flake8
* Simplify code, remove functionality that can be expressed more simply
* clean up the tests as well
* more constants
* wrap long lines
* reflect feedback
* unused
* add this back?
Diffstat (limited to 'src/_cffi_src/openssl/x509_vfy.py')
-rw-r--r-- | src/_cffi_src/openssl/x509_vfy.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/_cffi_src/openssl/x509_vfy.py b/src/_cffi_src/openssl/x509_vfy.py index 4e389b36..7821d194 100644 --- a/src/_cffi_src/openssl/x509_vfy.py +++ b/src/_cffi_src/openssl/x509_vfy.py @@ -195,8 +195,9 @@ int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *, const char *); """ CUSTOMIZATIONS = """ -/* OpenSSL 1.0.2+ verification error codes */ -#if OPENSSL_VERSION_NUMBER >= 0x10002002L && !defined(LIBRESSL_VERSION_NUMBER) +/* OpenSSL 1.0.2beta2+ verification error codes */ +#if CRYPTOGRAPHY_OPENSSL_102BETA2_OR_GREATER && \ + !defined(LIBRESSL_VERSION_NUMBER) static const long Cryptography_HAS_102_VERIFICATION_ERROR_CODES = 1; #else static const long Cryptography_HAS_102_VERIFICATION_ERROR_CODES = 0; @@ -211,8 +212,9 @@ static const long X509_V_ERR_EMAIL_MISMATCH = 0; static const long X509_V_ERR_IP_ADDRESS_MISMATCH = 0; #endif -/* OpenSSL 1.0.2+ verification parameters */ -#if OPENSSL_VERSION_NUMBER >= 0x10002002L && !defined(LIBRESSL_VERSION_NUMBER) +/* OpenSSL 1.0.2beta2+ verification parameters */ +#if CRYPTOGRAPHY_OPENSSL_102BETA2_OR_GREATER && \ + !defined(LIBRESSL_VERSION_NUMBER) static const long Cryptography_HAS_102_VERIFICATION_PARAMS = 1; #else static const long Cryptography_HAS_102_VERIFICATION_PARAMS = 0; |