diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-08-26 21:48:24 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2016-08-26 09:48:24 -0400 |
commit | 07ea3cd3ea23608ad5dfea008674d89e03cb1d33 (patch) | |
tree | 244ccf4ac6c001fad0e7036ce01615c92b7f643a /src | |
parent | 9736716017aac1d9da14b858903b20bb65b426e6 (diff) | |
download | cryptography-07ea3cd3ea23608ad5dfea008674d89e03cb1d33.tar.gz cryptography-07ea3cd3ea23608ad5dfea008674d89e03cb1d33.tar.bz2 cryptography-07ea3cd3ea23608ad5dfea008674d89e03cb1d33.zip |
OpenSSL 1.1.0 support (#2826)
* make pre5 work
* add a blank line to make the diff happier
* 1.1.0-pre6 working
* support the changes since 1.1.0-pre6
* fixes
* add 1.1.0 to travis
* expose the symbol
* better testing for numericstring
* handle libre...
* actually use the 1.1.0 we compile
* cache the ossl-110 dir on travis
* add some newlines
* changelog entry for 1.1.0 support
* note that we test on 1.1.0
* proper skip on this test
* reorder
Diffstat (limited to 'src')
-rw-r--r-- | src/_cffi_src/openssl/cryptography.py | 10 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/_cffi_src/openssl/cryptography.py b/src/_cffi_src/openssl/cryptography.py index c3b0a1dc..69824010 100644 --- a/src/_cffi_src/openssl/cryptography.py +++ b/src/_cffi_src/openssl/cryptography.py @@ -36,12 +36,22 @@ INCLUDES = """ (OPENSSL_VERSION_NUMBER < 0x10100000) #define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE5 \ (OPENSSL_VERSION_NUMBER < 0x10100005) + +#if defined(LIBRESSL_VERSION_NUMBER) +#define CRYPTOGRAPHY_IS_LIBRESSL 1 +#else +#define CRYPTOGRAPHY_IS_LIBRESSL 0 +#endif """ TYPES = """ static const int CRYPTOGRAPHY_OPENSSL_101_OR_GREATER; +static const int CRYPTOGRAPHY_OPENSSL_110_OR_GREATER; + static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_101; + +static const int CRYPTOGRAPHY_IS_LIBRESSL; """ FUNCTIONS = """ diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 3449e217..a1de1a89 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -1475,7 +1475,9 @@ class Backend(object): check_y = self._lib.BN_CTX_get(bn_ctx) res = set_func(group, point, bn_x, bn_y, bn_ctx) - self.openssl_assert(res == 1) + if res != 1: + self._consume_errors() + raise ValueError("EC point not on curve") res = get_func(group, point, check_x, check_y, bn_ctx) self.openssl_assert(res == 1) |