File 0023-CPPXT-110-OpenSSL-1.1-removes-BIO_s_file_internal.patch of Package xmltooling.15367

From 492d908044018f25d30b81b99f2e77c4f5531857 Mon Sep 17 00:00:00 2001
From: Rod Widdowson <rdw@steadingsoftware.com>
Date: Sat, 16 Jul 2016 15:59:01 +0100
Subject: [PATCH 23/31] CPPXT-110 OpenSSL 1.1 removes BIO_s_file_internal

https://issues.shibboleth.net/jira/browse/CPPXT-110

This is real in 0.9.8 and a #define in 1.0.0 through 1.0.2.

Add the #define back in for >= 1.1

(reapplied - previously backed out in bae0dd53)
---
 xmltooling/security/impl/FilesystemCredentialResolver.cpp |  1 +
 xmltooling/security/impl/OpenSSLSupport.h                 | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/xmltooling/security/impl/FilesystemCredentialResolver.cpp b/xmltooling/security/impl/FilesystemCredentialResolver.cpp
index dfeccf7..f9a337d 100644
--- a/xmltooling/security/impl/FilesystemCredentialResolver.cpp
+++ b/xmltooling/security/impl/FilesystemCredentialResolver.cpp
@@ -34,6 +34,7 @@
 #include "security/OpenSSLCredential.h"
 #include "security/SecurityHelper.h"
 #include "security/XSECCryptoX509CRL.h"
+#include "security/impl/OpenSSLSupport.h"
 #include "util/NDC.h"
 #include "util/PathResolver.h"
 #include "util/Threads.h"
diff --git a/xmltooling/security/impl/OpenSSLSupport.h b/xmltooling/security/impl/OpenSSLSupport.h
index 7519091..2d267be 100644
--- a/xmltooling/security/impl/OpenSSLSupport.h
+++ b/xmltooling/security/impl/OpenSSLSupport.h
@@ -40,6 +40,16 @@
 #   define EVP_PKEY_id(_evp_) ((_evp_)->type)
 #endif
 
+// BIO_s_file and BIO_s_file_internal
+// in 0.9.8 #define BIO_s_file          BIO_s_file_internal, uses both
+// in 1.0.0 #define BIO_s_file_internal BIO_s_file, uses both
+// in 1.0.1 #define BIO_s_file_internal BIO_s_file, uses both
+// in 1.0.1 #define BIO_s_file_internal BIO_s_file, uses both
+// in 1.1 no BIO_s_file_internal
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
+#   define BIO_s_file_internal BIO_s_file
+#endif
+
 namespace xmltooling {
     // RAII for the now opaque X509_STORE_CTX
     class X509StoreCtxRAII
-- 
2.13.6

openSUSE Build Service is sponsored by