Lines 47-53
Link Here
|
47 |
#include <ssl.h> |
47 |
#include <ssl.h> |
48 |
#endif |
48 |
#endif |
49 |
|
49 |
|
50 |
#if OPENSSL_VERSION_NUMBER >= 0x10100000 |
50 |
#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER) |
51 |
#define ASN1_STRING_data(x) ASN1_STRING_get0_data(x) |
51 |
#define ASN1_STRING_data(x) ASN1_STRING_get0_data(x) |
52 |
#endif |
52 |
#endif |
53 |
|
53 |
|
Lines 157-163
tlso_init( void )
Link Here
|
157 |
(void) tlso_seed_PRNG( lo->ldo_tls_randfile ); |
157 |
(void) tlso_seed_PRNG( lo->ldo_tls_randfile ); |
158 |
#endif |
158 |
#endif |
159 |
|
159 |
|
160 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 |
160 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER) |
161 |
SSL_load_error_strings(); |
161 |
SSL_load_error_strings(); |
162 |
SSL_library_init(); |
162 |
SSL_library_init(); |
163 |
OpenSSL_add_all_digests(); |
163 |
OpenSSL_add_all_digests(); |
Lines 205-211
static void
Link Here
|
205 |
tlso_ctx_ref( tls_ctx *ctx ) |
205 |
tlso_ctx_ref( tls_ctx *ctx ) |
206 |
{ |
206 |
{ |
207 |
tlso_ctx *c = (tlso_ctx *)ctx; |
207 |
tlso_ctx *c = (tlso_ctx *)ctx; |
208 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 |
208 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER) |
209 |
#define SSL_CTX_up_ref(ctx) CRYPTO_add( &(ctx->references), 1, CRYPTO_LOCK_SSL_CTX ) |
209 |
#define SSL_CTX_up_ref(ctx) CRYPTO_add( &(ctx->references), 1, CRYPTO_LOCK_SSL_CTX ) |
210 |
#endif |
210 |
#endif |
211 |
SSL_CTX_up_ref( c ); |
211 |
SSL_CTX_up_ref( c ); |
Lines 464-470
tlso_session_my_dn( tls_session *sess, struct berval *
Link Here
|
464 |
if (!x) return LDAP_INVALID_CREDENTIALS; |
464 |
if (!x) return LDAP_INVALID_CREDENTIALS; |
465 |
|
465 |
|
466 |
xn = X509_get_subject_name(x); |
466 |
xn = X509_get_subject_name(x); |
467 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 |
467 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER) |
468 |
der_dn->bv_len = i2d_X509_NAME( xn, NULL ); |
468 |
der_dn->bv_len = i2d_X509_NAME( xn, NULL ); |
469 |
der_dn->bv_val = xn->bytes->data; |
469 |
der_dn->bv_val = xn->bytes->data; |
470 |
#else |
470 |
#else |
Lines 500-506
tlso_session_peer_dn( tls_session *sess, struct berval
Link Here
|
500 |
return LDAP_INVALID_CREDENTIALS; |
500 |
return LDAP_INVALID_CREDENTIALS; |
501 |
|
501 |
|
502 |
xn = X509_get_subject_name(x); |
502 |
xn = X509_get_subject_name(x); |
503 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 |
503 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER) |
504 |
der_dn->bv_len = i2d_X509_NAME( xn, NULL ); |
504 |
der_dn->bv_len = i2d_X509_NAME( xn, NULL ); |
505 |
der_dn->bv_val = xn->bytes->data; |
505 |
der_dn->bv_val = xn->bytes->data; |
506 |
#else |
506 |
#else |
Lines 721-727
struct tls_data {
Link Here
|
721 |
Sockbuf_IO_Desc *sbiod; |
721 |
Sockbuf_IO_Desc *sbiod; |
722 |
}; |
722 |
}; |
723 |
|
723 |
|
724 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 |
724 |
#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER) |
725 |
#define BIO_set_init(b, x) b->init = x |
725 |
#define BIO_set_init(b, x) b->init = x |
726 |
#define BIO_set_data(b, x) b->ptr = x |
726 |
#define BIO_set_data(b, x) b->ptr = x |
727 |
#define BIO_clear_flags(b, x) b->flags &= ~(x) |
727 |
#define BIO_clear_flags(b, x) b->flags &= ~(x) |
Lines 822-828
tlso_bio_puts( BIO *b, const char *str )
Link Here
|
822 |
return tlso_bio_write( b, str, strlen( str ) ); |
822 |
return tlso_bio_write( b, str, strlen( str ) ); |
823 |
} |
823 |
} |
824 |
|
824 |
|
825 |
#if OPENSSL_VERSION_NUMBER >= 0x10100000 |
825 |
#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER) |
826 |
struct bio_method_st { |
826 |
struct bio_method_st { |
827 |
int type; |
827 |
int type; |
828 |
const char *name; |
828 |
const char *name; |
|
|
829 |
yes |
830 |
native |
831 |
text/plain |