ports/security/xmlsec1/files/patch-src_openssl_openssl__compat.h
Bernard Spil bf18cc7b48 security/xmlsec1: Fix build with LibreSSL 2.7
- LibreSSL 2.7 implements most of OpenSSL 1.1 API

PR:		D14851
Submitted by:	Charlie Li <ml+freebsd vishwin info>
Approved by:	maintainer time-out
Obtained from:	https://github.com/lsh123/xmlsec/pull/167
Differential Revision:	https://reviews.freebsd.org/D14851
2018-04-23 18:24:25 +00:00

22 lines
864 B
C

--- src/openssl/openssl_compat.h.orig 2017-09-12 13:21:09 UTC
+++ src/openssl/openssl_compat.h
@@ -49,4 +49,19 @@
#endif /* !defined(XMLSEC_OPENSSL_API_110) */
+/******************************************************************************
+ *
+ * LibreSSL 2.7+ compatibility (implements most of OpenSSL 1.1 API)
+ *
+ *****************************************************************************/
+#if defined(XMLSEC_OPENSSL_API_110) && defined(LIBRESSL_VERSION_NUMBER)
+/* EVP_CIPHER_CTX stuff */
+#define EVP_CIPHER_CTX_encrypting(x) ((x)->encrypt)
+
+/* X509 stuff */
+#define X509_STORE_CTX_get_by_subject X509_STORE_get_by_subject
+#define X509_OBJECT_new() (calloc(1, sizeof(X509_OBJECT)))
+#define X509_OBJECT_free(x) { X509_OBJECT_free_contents(x); free(x); }
+#endif
+
#endif /* __XMLSEC_OPENSSL_OPENSSL_COMPAT_H__ */