patch-libraries_libldap_tls_o_c 2.3 KB

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