2016-09-19 22:05:15 +02:00
|
|
|
#ifndef OPENSSL_COMPAT_H
|
|
|
|
#define OPENSSL_COMPAT_H
|
|
|
|
|
2017-11-22 10:33:15 +03:00
|
|
|
#include <openssl/bio.h>
|
|
|
|
#include "util-internal.h"
|
|
|
|
|
2018-04-02 13:18:27 +02:00
|
|
|
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || \
|
|
|
|
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
|
2016-09-19 22:05:15 +02:00
|
|
|
|
2016-11-16 01:16:30 +03:00
|
|
|
static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
|
2016-09-19 22:05:15 +02:00
|
|
|
{
|
|
|
|
BIO_METHOD *biom = calloc(1, sizeof(BIO_METHOD));
|
|
|
|
|
|
|
|
if (biom != NULL) {
|
|
|
|
biom->type = type;
|
|
|
|
biom->name = name;
|
|
|
|
}
|
|
|
|
return biom;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BIO_meth_set_write(b, f) (b)->bwrite = (f)
|
|
|
|
#define BIO_meth_set_read(b, f) (b)->bread = (f)
|
|
|
|
#define BIO_meth_set_puts(b, f) (b)->bputs = (f)
|
|
|
|
#define BIO_meth_set_ctrl(b, f) (b)->ctrl = (f)
|
|
|
|
#define BIO_meth_set_create(b, f) (b)->create = (f)
|
|
|
|
#define BIO_meth_set_destroy(b, f) (b)->destroy = (f)
|
|
|
|
|
|
|
|
#define BIO_set_init(b, val) (b)->init = (val)
|
|
|
|
#define BIO_set_data(b, val) (b)->ptr = (val)
|
|
|
|
#define BIO_set_shutdown(b, val) (b)->shutdown = (val)
|
|
|
|
#define BIO_get_init(b) (b)->init
|
|
|
|
#define BIO_get_data(b) (b)->ptr
|
|
|
|
#define BIO_get_shutdown(b) (b)->shutdown
|
|
|
|
|
2016-11-16 01:16:30 +03:00
|
|
|
#define TLS_method SSLv23_method
|
|
|
|
|
2020-01-05 19:02:22 +03:00
|
|
|
#define X509_getm_notBefore X509_get_notBefore
|
|
|
|
#define X509_getm_notAfter X509_get_notAfter
|
|
|
|
|
2018-04-02 13:18:27 +02:00
|
|
|
#endif /* (OPENSSL_VERSION_NUMBER < 0x10100000L) || \
|
|
|
|
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) */
|
|
|
|
|
2021-11-21 21:38:20 +01:00
|
|
|
#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x20700000L && \
|
|
|
|
LIBRESSL_VERSION_NUMBER < 0x30500000L
|
2018-04-02 13:18:27 +02:00
|
|
|
#define BIO_get_init(b) (b)->init
|
|
|
|
#endif
|
2016-09-19 22:05:15 +02:00
|
|
|
|
|
|
|
#endif /* OPENSSL_COMPAT_H */
|