aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-05 15:41:27 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-05 15:41:27 -0800
commitb822c27265b28b1e228abd3c1a8830b2d165ed71 (patch)
tree156adc41b2f6c0092e6a9eb6a79b2c89a865508a
parent0eb019b10a82aaa7118064ba0d02ca51a002974a (diff)
downloadcryptography-b822c27265b28b1e228abd3c1a8830b2d165ed71.tar.gz
cryptography-b822c27265b28b1e228abd3c1a8830b2d165ed71.tar.bz2
cryptography-b822c27265b28b1e228abd3c1a8830b2d165ed71.zip
Handle GCM not beign around
-rw-r--r--cryptography/hazmat/bindings/openssl/evp.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/cryptography/hazmat/bindings/openssl/evp.py b/cryptography/hazmat/bindings/openssl/evp.py
index 1a912496..da54f89d 100644
--- a/cryptography/hazmat/bindings/openssl/evp.py
+++ b/cryptography/hazmat/bindings/openssl/evp.py
@@ -29,9 +29,9 @@ typedef struct evp_pkey_st {
} EVP_PKEY;
static const int EVP_PKEY_RSA;
static const int EVP_PKEY_DSA;
-static const int EVP_CTRL_GCM_SET_IVLEN;
-static const int EVP_CTRL_GCM_GET_TAG;
-static const int EVP_CTRL_GCM_SET_TAG;
+static const int Cryptography_EVP_CTRL_GCM_SET_IVLEN;
+static const int Cryptography_EVP_CTRL_GCM_GET_TAG;
+static const int Cryptography_EVP_CTRL_GCM_SET_TAG;
"""
FUNCTIONS = """
@@ -97,4 +97,13 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *, int, int, void *);
"""
CUSTOMIZATIONS = """
+#ifdef EVP_CTRL_GCM_SET_TAG
+const int Cryptography_EVP_CTRL_GCM_GET_TAG = EVP_CTRL_GCM_GET_TAG;
+const int Cryptography_EVP_CTRL_GCM_SET_TAG = EVP_CTRL_GCM_SET_TAG;
+const int Cryptography_EVP_CTRL_GCM_SET_IVLEN = EVP_CTRL_GCM_SET_IVLEN;
+#else
+const int Cryptography_EVP_CTRL_GCM_GET_TAG = -1;
+const int Cryptography_EVP_CTRL_GCM_SET_TAG = -1;
+const int Cryptography_EVP_CTRL_GCM_SET_IVLEN = -1;
+#endif
"""