aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-06-05 14:45:44 -1000
committerAlex Gaynor <alex.gaynor@gmail.com>2017-06-05 20:45:44 -0400
commit023eccfc044c2f6a377f22fe50227175aca6fb4c (patch)
treeb6c0c68228c7923f8df10e7cf7e28e71169f64bc
parent580f434b341abdd53f4031a5a0066547cc3065f9 (diff)
downloadcryptography-023eccfc044c2f6a377f22fe50227175aca6fb4c.tar.gz
cryptography-023eccfc044c2f6a377f22fe50227175aca6fb4c.tar.bz2
cryptography-023eccfc044c2f6a377f22fe50227175aca6fb4c.zip
bind EVP_PKEY_get1_tls_encodedpoint because X25519 (#3682)
-rw-r--r--src/_cffi_src/openssl/evp.py11
-rw-r--r--src/cryptography/hazmat/bindings/openssl/_conditional.py3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/evp.py b/src/_cffi_src/openssl/evp.py
index 57f08893..1b108631 100644
--- a/src/_cffi_src/openssl/evp.py
+++ b/src/_cffi_src/openssl/evp.py
@@ -31,6 +31,7 @@ static const int Cryptography_HAS_PBKDF2_HMAC;
static const int Cryptography_HAS_PKEY_CTX;
static const int Cryptography_HAS_SCRYPT;
static const int Cryptography_HAS_EVP_PKEY_DHX;
+static const int Cryptography_HAS_EVP_PKEY_get1_tls_encodedpoint;
"""
FUNCTIONS = """
@@ -147,6 +148,9 @@ void Cryptography_EVP_MD_CTX_free(EVP_MD_CTX *);
"""
MACROS = """
+/* Added in 1.1.0 */
+size_t EVP_PKEY_get1_tls_encodedpoint(EVP_PKEY *, unsigned char **);
+
/* PKCS8_PRIV_KEY_INFO * became const in 1.1.0 */
EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *);
@@ -218,6 +222,13 @@ int (*EVP_PBE_scrypt)(const char *, size_t, const unsigned char *, size_t,
static const long Cryptography_HAS_SCRYPT = 1;
#endif
+#if CRYPTOGRAPHY_OPENSSL_110_OR_GREATER
+static const long Cryptography_HAS_EVP_PKEY_get1_tls_encodedpoint = 1;
+#else
+static const long Cryptography_HAS_EVP_PKEY_get1_tls_encodedpoint = 0;
+size_t (*EVP_PKEY_get1_tls_encodedpoint)(EVP_PKEY *, unsigned char **) = NULL;
+#endif
+
/* OpenSSL 1.1.0+ does this define for us, but if not present we'll do it */
#if !defined(EVP_CTRL_AEAD_SET_IVLEN)
# define EVP_CTRL_AEAD_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN
diff --git a/src/cryptography/hazmat/bindings/openssl/_conditional.py b/src/cryptography/hazmat/bindings/openssl/_conditional.py
index 942ac60b..8672a599 100644
--- a/src/cryptography/hazmat/bindings/openssl/_conditional.py
+++ b/src/cryptography/hazmat/bindings/openssl/_conditional.py
@@ -176,4 +176,7 @@ CONDITIONAL_NAMES = {
"Cryptography_HAS_X25519": [
"NID_X25519",
],
+ "Cryptography_HAS_EVP_PKEY_get1_tls_encodedpoint": [
+ "EVP_PKEY_get1_tls_encodedpoint",
+ ],
}