This fixes the following compile errors with openssl-1.1.0f:

tools/podofosign/podofosign.cpp:877:32: error:
‘OpenSSL_add_all_algorithms’ was not declared in this scope
OpenSSL_add_all_algorithms();
^
tools/podofosign/podofosign.cpp:878:29: error:
‘ERR_load_crypto_strings’ was not declared in this scope
ERR_load_crypto_strings();
^
tools/podofosign/podofosign.cpp:1085:22: error: ‘ERR_free_strings’ was
not declared in this scope
ERR_free_strings();
  ^

This patch has been tested on Linux with openssl-1.0.2l and
openssl-1.1.0f.

-- 
Thanks,
Zac
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (revision 1859)
+++ CMakeLists.txt      (working copy)
@@ -325,6 +325,14 @@
 FIND_PACKAGE(ZLIB REQUIRED)
 MESSAGE("Found zlib headers in ${ZLIB_INCLUDE_DIR}, library at 
${ZLIB_LIBRARIES}")
 
+FIND_PACKAGE(OpenSSL)
+if(OpenSSL_FOUND)
+  SET(PODOFO_HAVE_OPENSSL TRUE)
+  INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIRS})
+  LINK_DIRECTORIES(${OPENSSL_LIBRARIES})
+  MESSAGE(STATUS "Using OpenSSL ${OPENSSL_VERSION}")
+  MESSAGE("Found OpenSSL ${OPENSSL_VERSION} headers in 
${OPENSSL_INCLUDE_DIRS}, library at ${OPENSSL_LIBRARIES}")
+ELSE(OpenSSL_FOUND)
 FIND_PACKAGE(LIBCRYPTO)
 
 IF(LIBCRYPTO_FOUND)
@@ -334,6 +342,7 @@
 ELSE(LIBCRYPTO_FOUND)
        MESSAGE("OpenSSL's libCrypto not found. Encryption support will be 
disabled")
 ENDIF(LIBCRYPTO_FOUND)
+ENDIF(OpenSSL_FOUND)
 
 FIND_PACKAGE(LIBIDN)
 
@@ -393,8 +402,6 @@
 
 ENDIF(NOT PODOFO_BUILD_LIB_ONLY)
 
-FIND_PACKAGE(OpenSSL)
-
 FIND_PACKAGE(FREETYPE REQUIRED)
 MESSAGE("Found freetype library at ${FREETYPE_LIBRARIES}, headers 
${FREETYPE_INCLUDE_DIR}")
 
@@ -499,6 +506,7 @@
   ${LIBCRYPTO_LDFLAGS}
   ${LIBCRYPTO_LIBRARIES}
   ${LIBJPEG_LIBRARIES}
+  ${OPENSSL_LIBRARIES}
   ${PLATFORM_SYSTEM_LIBRARIES}
   ${stlport_libraries_if_use_stlport}
   ${FREETYPE_LIBRARIES}
Index: tools/podofosign/podofosign.cpp
===================================================================
--- tools/podofosign/podofosign.cpp     (revision 1859)
+++ tools/podofosign/podofosign.cpp     (working copy)
@@ -27,6 +27,7 @@
 #include <openssl/evp.h>
 #include <openssl/err.h>
 #include <openssl/pem.h>
+#include <openssl/ssl.h>
 #include <openssl/x509.h>
 
 #if defined(_WIN64)
@@ -874,11 +875,15 @@
         outputfile = NULL;
     }
 
+#ifdef PODOFO_HAVE_OPENSSL_1_1
+    OPENSSL_init_ssl(0, NULL);
+#else
     OpenSSL_add_all_algorithms();
     ERR_load_crypto_strings();
     ERR_load_PEM_strings();
     ERR_load_ASN1_strings();
     ERR_load_EVP_strings();
+#endif
 
     X509* cert = NULL;
     EVP_PKEY* pkey = NULL;
@@ -1082,7 +1087,9 @@
         result = e.GetError();
     }
 
+#ifndef PODOFO_HAVE_OPENSSL_1_1
     ERR_free_strings();
+#endif
 
     if( pSignField )
         delete pSignField;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to