summaryrefslogtreecommitdiff
path: root/openssl_bio_compat.h
diff options
context:
space:
mode:
authorEneas U de Queiroz via openwrt-devel <openwrt-devel@lists.openwrt.org>2018-06-16 04:05:14 +0000
committerJohn Crispin <john@phrozen.org>2018-07-27 11:14:25 +0200
commit34b0b80ad302d873f00be5f9c8051b73b2e86a01 (patch)
tree5a0fb9617e3d0370e5dd661e07dabacd444fb2f2 /openssl_bio_compat.h
parent189cd38b4188bfcb4c8cf67d8ae71741ffc2b906 (diff)
downloadustream-ssl-34b0b80ad302d873f00be5f9c8051b73b2e86a01.tar.gz
ustream-ssl: add openssl-1.1.0 compatibility
The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Patch to compile ustream-ssl with openssl-1.1.0, maintaining compatibility with openssl 1.0.2. Fixed flag handling in ustream-io-openssl.c. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
Diffstat (limited to 'openssl_bio_compat.h')
-rw-r--r--openssl_bio_compat.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/openssl_bio_compat.h b/openssl_bio_compat.h
new file mode 100644
index 0000000..9355c86
--- /dev/null
+++ b/openssl_bio_compat.h
@@ -0,0 +1,33 @@
+#ifndef OPENSSL_BIO_COMPAT_H
+#define OPENSSL_BIO_COMPAT_H
+
+#include <openssl/opensslv.h>
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+
+#include <openssl/bio.h>
+#include <string.h>
+
+#define BIO_get_data(b) (b->ptr)
+#define BIO_set_data(b, v) (b->ptr = v)
+#define BIO_set_init(b, v) (b->init = v)
+#define BIO_meth_set_write(m, f) (m->bwrite = f)
+#define BIO_meth_set_read(m, f) (m->bread = f)
+#define BIO_meth_set_puts(m, f) (m->bputs = f)
+#define BIO_meth_set_gets(m, f) (m->bgets = f)
+#define BIO_meth_set_ctrl(m, f) (m->ctrl = f)
+#define BIO_meth_set_create(m, f) (m->create = f)
+#define BIO_meth_set_destroy(m, f) (m->destroy = f)
+
+static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
+{
+ BIO_METHOD *bm = calloc(1, sizeof(BIO_METHOD));
+ if (bm) {
+ bm->type = type;
+ bm->name = name;
+ }
+ return bm;
+}
+
+#endif /* OPENSSL_VERSION_NUMBER */
+
+#endif /* OPENSSL_BIO_COMPAT_H */