aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl/rand.py
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2015-06-08 00:53:15 -0400
committerDonald Stufft <donald@stufft.io>2015-06-08 00:53:15 -0400
commit4ff26abc0f48db53fcc0b321162a7129fd7fbdc6 (patch)
tree64fd7468325fad0d35244451dfa0e7710d4ed801 /src/_cffi_src/openssl/rand.py
parent014b68ead801e23a33e06524c20d2f290ba6772f (diff)
parent73f06c71d6fa8db403dc5999b033552463d48d5e (diff)
downloadcryptography-4ff26abc0f48db53fcc0b321162a7129fd7fbdc6.tar.gz
cryptography-4ff26abc0f48db53fcc0b321162a7129fd7fbdc6.tar.bz2
cryptography-4ff26abc0f48db53fcc0b321162a7129fd7fbdc6.zip
Merge pull request #1986 from reaperhulk/cffi10
cffi 1.0
Diffstat (limited to 'src/_cffi_src/openssl/rand.py')
-rw-r--r--src/_cffi_src/openssl/rand.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/rand.py b/src/_cffi_src/openssl/rand.py
new file mode 100644
index 00000000..6330482c
--- /dev/null
+++ b/src/_cffi_src/openssl/rand.py
@@ -0,0 +1,51 @@
+# This file is dual licensed under the terms of the Apache License, Version
+# 2.0, and the BSD License. See the LICENSE file in the root of this repository
+# for complete details.
+
+from __future__ import absolute_import, division, print_function
+
+INCLUDES = """
+#include <openssl/rand.h>
+"""
+
+TYPES = """
+static const long Cryptography_HAS_EGD;
+"""
+
+FUNCTIONS = """
+void ERR_load_RAND_strings(void);
+void RAND_seed(const void *, int);
+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);
+"""
+
+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",
+ ]
+}