aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-03-09 06:50:54 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2016-03-09 06:50:54 -0500
commit7830dd2111ac968f039660dd077e9c43a0f32c56 (patch)
tree4b606599c9b612a7b91661d88d5210f00eb71f13 /src
parentb6363906f239daafda6af7fd18e90505738684b0 (diff)
parent264cb53035bce5dc1d29014879bb6b28078f7c12 (diff)
downloadcryptography-7830dd2111ac968f039660dd077e9c43a0f32c56.tar.gz
cryptography-7830dd2111ac968f039660dd077e9c43a0f32c56.tar.bz2
cryptography-7830dd2111ac968f039660dd077e9c43a0f32c56.zip
Merge pull request #2777 from reaperhulk/110-patch-1
In OpenSSL 1.1.0 AES_ctr128_encrypt no longer exists
Diffstat (limited to 'src')
-rw-r--r--src/_cffi_src/openssl/aes.py11
-rw-r--r--src/cryptography/hazmat/bindings/openssl/_conditional.py3
2 files changed, 13 insertions, 1 deletions
diff --git a/src/_cffi_src/openssl/aes.py b/src/_cffi_src/openssl/aes.py
index 8a5d0471..438431b5 100644
--- a/src/_cffi_src/openssl/aes.py
+++ b/src/_cffi_src/openssl/aes.py
@@ -10,6 +10,7 @@ INCLUDES = """
TYPES = """
static const int Cryptography_HAS_AES_WRAP;
+static const int Cryptography_HAS_AES_CTR128_ENCRYPT;
struct aes_key_st {
...;
@@ -50,5 +51,13 @@ int (*AES_wrap_key)(AES_KEY *, const unsigned char *, unsigned char *,
int (*AES_unwrap_key)(AES_KEY *, const unsigned char *, unsigned char *,
const unsigned char *, unsigned int) = NULL;
#endif
-
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+static const int Cryptography_HAS_AES_CTR128_ENCRYPT = 0;
+void (*AES_ctr128_encrypt)(const unsigned char *, unsigned char *,
+ const size_t, const AES_KEY *,
+ unsigned char[], unsigned char[],
+ unsigned int *) = NULL;
+#else
+static const int Cryptography_HAS_AES_CTR128_ENCRYPT = 1;
+#endif
"""
diff --git a/src/cryptography/hazmat/bindings/openssl/_conditional.py b/src/cryptography/hazmat/bindings/openssl/_conditional.py
index 206c2915..8bd9551d 100644
--- a/src/cryptography/hazmat/bindings/openssl/_conditional.py
+++ b/src/cryptography/hazmat/bindings/openssl/_conditional.py
@@ -411,4 +411,7 @@ CONDITIONAL_NAMES = {
"SSL_CTX_set_cert_cb",
"SSL_set_cert_cb",
],
+ "Cryptography_HAS_AES_CTR128_ENCRYPT": [
+ "AES_ctr128_encrypt",
+ ],
}