aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl/evp.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-09-26 13:38:36 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2018-09-26 14:38:36 -0400
commit1717f8c998b22fbbebec4b5514aee42fb3a2f68d (patch)
tree5992e22e5b74ae27a118b8859388a5e2ab53dbac /src/_cffi_src/openssl/evp.py
parent0a7bebfaf710d3691cec311d13be7725af4b93cc (diff)
downloadcryptography-1717f8c998b22fbbebec4b5514aee42fb3a2f68d.tar.gz
cryptography-1717f8c998b22fbbebec4b5514aee42fb3a2f68d.tar.bz2
cryptography-1717f8c998b22fbbebec4b5514aee42fb3a2f68d.zip
add ed25519 bindings (#4476)
* add ed25519 bindings * var name
Diffstat (limited to 'src/_cffi_src/openssl/evp.py')
-rw-r--r--src/_cffi_src/openssl/evp.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/evp.py b/src/_cffi_src/openssl/evp.py
index 715bfe19..2fb724d2 100644
--- a/src/_cffi_src/openssl/evp.py
+++ b/src/_cffi_src/openssl/evp.py
@@ -33,6 +33,7 @@ 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_get_set_tls_encodedpoint;
+static const int Cryptography_HAS_ONESHOT_EVP_DIGEST_SIGN_VERIFY;
"""
FUNCTIONS = """
@@ -98,6 +99,12 @@ const EVP_MD *EVP_sha256(void);
const EVP_MD *EVP_sha384(void);
const EVP_MD *EVP_sha512(void);
+int EVP_DigestSignInit(EVP_MD_CTX *, EVP_PKEY_CTX **, const EVP_MD *,
+ ENGINE *, EVP_PKEY *);
+int EVP_DigestVerifyInit(EVP_MD_CTX *, EVP_PKEY_CTX **, const EVP_MD *,
+ ENGINE *, EVP_PKEY *);
+
+
int PKCS5_PBKDF2_HMAC_SHA1(const char *, int, const unsigned char *, int, int,
int, unsigned char *);
@@ -147,6 +154,11 @@ int Cryptography_EVP_PKEY_id(const EVP_PKEY *);
without worrying about what OpenSSL we're running against. */
EVP_MD_CTX *Cryptography_EVP_MD_CTX_new(void);
void Cryptography_EVP_MD_CTX_free(EVP_MD_CTX *);
+/* Added in 1.1.1 */
+int EVP_DigestSign(EVP_MD_CTX *, unsigned char *, size_t *,
+ const unsigned char *, size_t);
+int EVP_DigestVerify(EVP_MD_CTX *, const unsigned char *, size_t,
+ const unsigned char *, size_t);
/* Added in 1.1.0 */
size_t EVP_PKEY_get1_tls_encodedpoint(EVP_PKEY *, unsigned char **);
int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *, const unsigned char *,
@@ -232,6 +244,16 @@ int (*EVP_PKEY_set1_tls_encodedpoint)(EVP_PKEY *, const unsigned char *,
size_t) = NULL;
#endif
+#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_111
+static const long Cryptography_HAS_ONESHOT_EVP_DIGEST_SIGN_VERIFY = 0;
+int (*EVP_DigestSign)(EVP_MD_CTX *, unsigned char *, size_t *,
+ const unsigned char *tbs, size_t) = NULL;
+int (*EVP_DigestVerify)(EVP_MD_CTX *, const unsigned char *, size_t,
+ const unsigned char *, size_t) = NULL;
+#else
+static const long Cryptography_HAS_ONESHOT_EVP_DIGEST_SIGN_VERIFY = 1;
+#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