diff options
Diffstat (limited to 'src/_cffi_src/openssl/rand.py')
| -rw-r--r-- | src/_cffi_src/openssl/rand.py | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/src/_cffi_src/openssl/rand.py b/src/_cffi_src/openssl/rand.py index 6330482c..c0cd6836 100644 --- a/src/_cffi_src/openssl/rand.py +++ b/src/_cffi_src/openssl/rand.py @@ -9,43 +9,23 @@ INCLUDES = """ """ TYPES = """ +typedef ... RAND_METHOD; + static const long Cryptography_HAS_EGD; """ FUNCTIONS = """ -void ERR_load_RAND_strings(void); -void RAND_seed(const void *, int); +int RAND_set_rand_method(const RAND_METHOD *); void RAND_add(const void *, int, double); int RAND_status(void); -const char *RAND_file_name(char *, size_t); -int RAND_load_file(const char *, long); -int RAND_write_file(const char *); -void RAND_cleanup(void); int RAND_bytes(unsigned char *, int); -int RAND_pseudo_bytes(unsigned char *, int); -""" - -MACROS = """ -int RAND_egd(const char *); -int RAND_egd_bytes(const char *, int); -int RAND_query_egd_bytes(const char *, unsigned char *, int); +/* ERR_load_RAND_strings started returning an int in 1.1.0. Unfortunately we + can't declare a conditional signature like that. Since it always returns + 1 we'll just lie about the signature to preserve compatibility for + pyOpenSSL (which calls this in its rand.py as of mid-2016) */ +void ERR_load_RAND_strings(void); """ CUSTOMIZATIONS = """ -#if defined(LIBRESSL_VERSION_NUMBER) static const long Cryptography_HAS_EGD = 0; -int (*RAND_egd)(const char *) = NULL; -int (*RAND_egd_bytes)(const char *, int) = NULL; -int (*RAND_query_egd_bytes)(const char *, unsigned char *, int) = NULL; -#else -static const long Cryptography_HAS_EGD = 1; -#endif """ - -CONDITIONAL_NAMES = { - "Cryptography_HAS_EGD": [ - "RAND_egd", - "RAND_egd_bytes", - "RAND_query_egd_bytes", - ] -} |
