From 34b0b80ad302d873f00be5f9c8051b73b2e86a01 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz via openwrt-devel Date: Sat, 16 Jun 2018 04:05:14 +0000 Subject: 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 --- openssl_bio_compat.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 openssl_bio_compat.h (limited to 'openssl_bio_compat.h') 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 +#if OPENSSL_VERSION_NUMBER < 0x10100000L + +#include +#include + +#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 */ -- cgit v1.2.1