From d6871fe568983b46a3b688c3222289357a7f56cd Mon Sep 17 00:00:00 2001 From: Terry Chia Date: Sat, 27 Aug 2016 16:25:54 +0800 Subject: Scrypt bindings (#3114) * Add Scrypt bindings. * Add check for OPENSSL_NO_SCRYPT. * Fix CUSTOMIZATIONS. * Account for LibreSSL. * Remove argument names. * Remove more argument names. --- src/_cffi_src/openssl/evp.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/_cffi_src') 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 """ -- cgit v1.2.3