aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl/bio.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-11-19 11:07:28 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2016-11-18 22:07:28 -0500
commit84e4e3111d6008373813a7f2810f7ebc2d0f4e46 (patch)
tree01ee73bea300b5765824509e2f86854599fa9d3f /src/_cffi_src/openssl/bio.py
parent533a3c909d59698259456233041a3d4e232bf87e (diff)
downloadcryptography-84e4e3111d6008373813a7f2810f7ebc2d0f4e46.tar.gz
cryptography-84e4e3111d6008373813a7f2810f7ebc2d0f4e46.tar.bz2
cryptography-84e4e3111d6008373813a7f2810f7ebc2d0f4e46.zip
add some BIO functions for pypy's ssl stdlib (#3249)
refs #3248
Diffstat (limited to 'src/_cffi_src/openssl/bio.py')
-rw-r--r--src/_cffi_src/openssl/bio.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/bio.py b/src/_cffi_src/openssl/bio.py
index 58b20a3e..a134d9b6 100644
--- a/src/_cffi_src/openssl/bio.py
+++ b/src/_cffi_src/openssl/bio.py
@@ -85,6 +85,9 @@ int BIO_method_type(const BIO *);
"""
MACROS = """
+/* Added in 1.1.0 */
+int BIO_up_ref(BIO *);
+
/* These added const to BIO_METHOD in 1.1.0 */
BIO *BIO_new(BIO_METHOD *);
BIO_METHOD *BIO_s_mem(void);
@@ -130,7 +133,15 @@ long BIO_set_write_buffer_size(BIO *, long);
long BIO_set_buffer_size(BIO *, long);
long BIO_set_buffer_read_data(BIO *, void *, long);
long BIO_set_nbio(BIO *, long);
+void BIO_set_retry_read(BIO *);
+void BIO_clear_retry_flags(BIO *);
"""
CUSTOMIZATIONS = """
+#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE4 || defined(LIBRESSL_VERSION_NUMBER)
+int BIO_up_ref(BIO *b) {
+ CRYPTO_add(&b->references, 1, CRYPTO_LOCK_BIO);
+ return 1;
+}
+#endif
"""