aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl/evp.py
diff options
context:
space:
mode:
authorTerry Chia <terrycwk1994@gmail.com>2016-08-27 16:25:54 +0800
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-08-27 16:25:54 +0800
commitd6871fe568983b46a3b688c3222289357a7f56cd (patch)
treefe83e9959dfd04cee6633e703c8e96a069d133f8 /src/_cffi_src/openssl/evp.py
parent3b83fc21eb1abe1b53efe5f6920885676158be5c (diff)
downloadcryptography-d6871fe568983b46a3b688c3222289357a7f56cd.tar.gz
cryptography-d6871fe568983b46a3b688c3222289357a7f56cd.tar.bz2
cryptography-d6871fe568983b46a3b688c3222289357a7f56cd.zip
Scrypt bindings (#3114)
* Add Scrypt bindings. * Add check for OPENSSL_NO_SCRYPT. * Fix CUSTOMIZATIONS. * Account for LibreSSL. * Remove argument names. * Remove more argument names.
Diffstat (limited to 'src/_cffi_src/openssl/evp.py')
-rw-r--r--src/_cffi_src/openssl/evp.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/evp.py b/src/_cffi_src/openssl/evp.py
index e233e818..477d035f 100644
--- a/src/_cffi_src/openssl/evp.py
+++ b/src/_cffi_src/openssl/evp.py
@@ -28,6 +28,7 @@ static const int EVP_CTRL_GCM_SET_TAG;
static const int Cryptography_HAS_GCM;
static const int Cryptography_HAS_PBKDF2_HMAC;
static const int Cryptography_HAS_PKEY_CTX;
+static const int Cryptography_HAS_SCRYPT;
"""
FUNCTIONS = """
@@ -162,6 +163,10 @@ int PKCS5_PBKDF2_HMAC(const char *, int, const unsigned char *, int, int,
const EVP_MD *, int, unsigned char *);
int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *, const EVP_MD *);
+
+int EVP_PBE_scrypt(const char *, size_t, const unsigned char *, size_t,
+ uint64_t, uint64_t, uint64_t, uint64_t, unsigned char *,
+ size_t);
"""
CUSTOMIZATIONS = """
@@ -201,4 +206,13 @@ void Cryptography_EVP_MD_CTX_free(EVP_MD_CTX *ctx) {
EVP_MD_CTX_free(ctx);
#endif
}
+#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 || defined(LIBRESSL_VERSION_NUMBER) \
+ || defined(OPENSSL_NO_SCRYPT)
+static const long Cryptography_HAS_SCRYPT = 0;
+int (*EVP_PBE_scrypt)(const char *, size_t, const unsigned char *, size_t,
+ uint64_t, uint64_t, uint64_t, uint64_t, unsigned char *,
+ size_t) = NULL;
+#else
+static const long Cryptography_HAS_SCRYPT = 1;
+#endif
"""