View | Details | Raw Unified | Return to bug 219781 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-libressl (+68 lines)
Line 0 Link Here
1
--- libraries/libldap/tls_o.c.orig	2017-06-04 16:31:28 UTC
2
+++ libraries/libldap/tls_o.c
3
@@ -47,7 +47,7 @@
4
 #include <ssl.h>
5
 #endif
6
 
7
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
8
+#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
9
 #define ASN1_STRING_data(x)	ASN1_STRING_get0_data(x)
10
 #endif
11
 
12
@@ -157,7 +157,7 @@ tlso_init( void )
13
 	(void) tlso_seed_PRNG( lo->ldo_tls_randfile );
14
 #endif
15
 
16
-#if OPENSSL_VERSION_NUMBER < 0x10100000
17
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
18
 	SSL_load_error_strings();
19
 	SSL_library_init();
20
 	OpenSSL_add_all_digests();
21
@@ -205,7 +205,7 @@ static void
22
 tlso_ctx_ref( tls_ctx *ctx )
23
 {
24
 	tlso_ctx *c = (tlso_ctx *)ctx;
25
-#if OPENSSL_VERSION_NUMBER < 0x10100000
26
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
27
 #define	SSL_CTX_up_ref(ctx)	CRYPTO_add( &(ctx->references), 1, CRYPTO_LOCK_SSL_CTX )
28
 #endif
29
 	SSL_CTX_up_ref( c );
30
@@ -464,7 +464,7 @@ tlso_session_my_dn( tls_session *sess, struct berval *
31
 	if (!x) return LDAP_INVALID_CREDENTIALS;
32
 	
33
 	xn = X509_get_subject_name(x);
34
-#if OPENSSL_VERSION_NUMBER < 0x10100000
35
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
36
 	der_dn->bv_len = i2d_X509_NAME( xn, NULL );
37
 	der_dn->bv_val = xn->bytes->data;
38
 #else
39
@@ -500,7 +500,7 @@ tlso_session_peer_dn( tls_session *sess, struct berval
40
 		return LDAP_INVALID_CREDENTIALS;
41
 
42
 	xn = X509_get_subject_name(x);
43
-#if OPENSSL_VERSION_NUMBER < 0x10100000
44
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
45
 	der_dn->bv_len = i2d_X509_NAME( xn, NULL );
46
 	der_dn->bv_val = xn->bytes->data;
47
 #else
48
@@ -721,7 +721,7 @@ struct tls_data {
49
 	Sockbuf_IO_Desc		*sbiod;
50
 };
51
 
52
-#if OPENSSL_VERSION_NUMBER < 0x10100000
53
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
54
 #define BIO_set_init(b, x)	b->init = x
55
 #define BIO_set_data(b, x)	b->ptr = x
56
 #define BIO_clear_flags(b, x)	b->flags &= ~(x)
57
@@ -822,7 +822,7 @@ tlso_bio_puts( BIO *b, const char *str )
58
 	return tlso_bio_write( b, str, strlen( str ) );
59
 }
60
 
61
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
62
+#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
63
 struct bio_method_st {
64
     int type;
65
     const char *name;
66
yes
67
native
68
text/plain

Return to bug 219781