Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 614756
Collapse All | Expand All

(-)podofo-0.9.6_pre20170629-orig/cmake/modules/FindOpenSSL.cmake (-74 lines)
Removed Link Here
1
# - Try to find the OpenSSL encryption library
2
# Once done this will define
3
#
4
#  OPENSSL_FOUND - system has the OpenSSL library
5
#  OPENSSL_INCLUDE_DIR - the OpenSSL include directory
6
#  OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
7
8
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
9
# Modified by Craig Ringer, 2008:
10
#	- Handle !REQUIRED
11
#
12
# Redistribution and use is allowed according to the terms of the BSD license.
13
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14
15
16
IF(OPENSSL_LIBRARIES)
17
   SET(OpenSSL_FIND_QUIETLY TRUE)
18
ENDIF(OPENSSL_LIBRARIES)
19
20
IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
21
   SET(LIB_FOUND 1)
22
ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
23
24
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h )
25
26
IF(WIN32 AND MSVC)
27
   # /MD and /MDd are the standard values - if somone wants to use
28
   # others, the libnames have to change here too
29
   # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
30
31
   FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd ssl ssleay32)
32
   FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD ssl ssleay32)
33
34
   IF(MSVC_IDE)
35
      IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
36
         SET(OPENSSL_LIBRARIES optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG})
37
      ELSE(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
38
         MESSAGE("OpenSSL: Could not find the debug and release version of openssl")
39
	 MESSAGE("OpenSSL: Disabling OpenSSL")
40
	 SET(OPENSSL_LIBRARIES)
41
      ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
42
   ELSE(MSVC_IDE)
43
      STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
44
      IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
45
         SET(OPENSSL_LIBRARIES ${SSL_EAY_DEBUG})
46
      ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
47
         SET(OPENSSL_LIBRARIES ${SSL_EAY_RELEASE})
48
      ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
49
   ENDIF(MSVC_IDE)
50
   MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE)
51
ELSE(WIN32 AND MSVC)
52
53
   FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD )
54
55
ENDIF(WIN32 AND MSVC)
56
57
IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
58
   SET(OPENSSL_FOUND TRUE)
59
ELSE(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
60
   SET(OPENSSL_FOUND FALSE)
61
ENDIF (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
62
63
IF (OPENSSL_FOUND)
64
   IF (NOT OpenSSL_FIND_QUIETLY)
65
      MESSAGE(STATUS "Found OpenSSL: ${OPENSSL_LIBRARIES}")
66
   ENDIF (NOT OpenSSL_FIND_QUIETLY)
67
ELSE (OPENSSL_FOUND)
68
   IF (OpenSSL_FIND_REQUIRED)
69
      MESSAGE(FATAL_ERROR "Could NOT find OpenSSL")
70
   ENDIF (OpenSSL_FIND_REQUIRED)
71
ENDIF (OPENSSL_FOUND)
72
73
MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
74
(-)podofo-0.9.6_pre20170629-orig/cmake/modules/FindLIBCRYPTO.cmake (-88 lines)
Removed Link Here
1
# - Find libCrypto
2
# Find the native OpenSSL LIBCRYPTO includes and library
3
#
4
#  LIBCRYPTO_INCLUDE_DIR - where to find sha.h, etc.
5
#  LIBCRYPTO_LIBRARIES   - List of libraries when using libCrypto.
6
#  LIBCRYPTO_FOUND       - True if libCrypto found.
7
8
9
IF (LIBCRYPTO_INCLUDE_DIR)
10
  # Already in cache, be silent
11
  SET(LIBCRYPTO_FIND_QUIETLY TRUE)
12
ENDIF (LIBCRYPTO_INCLUDE_DIR)
13
14
IF (NOT LIBCRYPTO_INCLUDE_DIR OR NOT LIBCRYPTO_LIBRARIES)
15
  FIND_PACKAGE(PkgConfig)
16
17
  IF (PKG_CONFIG_FOUND)
18
    PKG_CHECK_MODULES (LIBCRYPTO libcrypto)
19
    IF (LIBCRYPTO_FOUND)
20
      SET (LIBCRYPTO_INCLUDE_DIR ${LIBCRYPTO_INCLUDE_DIRS})
21
    ENDIF (LIBCRYPTO_FOUND)
22
  ENDIF (PKG_CONFIG_FOUND)
23
ENDIF (NOT LIBCRYPTO_INCLUDE_DIR OR NOT LIBCRYPTO_LIBRARIES)
24
25
IF (NOT LIBCRYPTO_INCLUDE_DIR OR NOT LIBCRYPTO_LIBRARIES)
26
  # Require a regular OpenSSL even on OSX/iOS
27
  # IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
28
  #   # MacOSX has deprecated the use of openssl crypto functions
29
  #   # and replaced it with API-compatible CommonCrypto
30
  #   FIND_PATH(LIBCRYPTO_INCLUDE_DIR CommonCrypto/CommonDigest.h)
31
  #   SET(LIBCRYPTO_LIBRARY_NAMES_RELEASE ${LIBCRYPTO_LIBRARY_NAMES_RELEASE} ${LIBCRYPTO_LIBRARY_NAMES} ssl)
32
  #   SET(LIBCRYPTO_LIBRARY_NAMES_DEBUG ${LIBCRYPTO_LIBRARY_NAMES_DEBUG} ssld)
33
  # ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 
34
    FIND_PATH(LIBCRYPTO_INCLUDE_DIR openssl/sha.h)
35
    SET(LIBCRYPTO_LIBRARY_NAMES_RELEASE ${LIBCRYPTO_LIBRARY_NAMES_RELEASE} ${LIBCRYPTO_LIBRARY_NAMES} crypto)
36
    SET(LIBCRYPTO_LIBRARY_NAMES_DEBUG ${LIBCRYPTO_LIBRARY_NAMES_DEBUG} cryptod)
37
  # ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 
38
39
  FIND_LIBRARY(LIBCRYPTO_LIBRARY_RELEASE NAMES ${LIBCRYPTO_LIBRARY_NAMES_RELEASE} )
40
41
  # Find a debug library if one exists and use that for debug builds.
42
  # This really only does anything for win32, but does no harm on other
43
  # platforms.
44
  FIND_LIBRARY(LIBCRYPTO_LIBRARY_DEBUG NAMES ${LIBCRYPTO_LIBRARY_NAMES_DEBUG})
45
46
  INCLUDE(LibraryDebugAndRelease)
47
  SET_LIBRARY_FROM_DEBUG_AND_RELEASE(LIBCRYPTO)
48
49
  # handle the QUIETLY and REQUIRED arguments and set LIBCRYPTO_FOUND to TRUE if 
50
  # all listed variables are TRUE
51
  INCLUDE(FindPackageHandleStandardArgs)
52
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBCRYPTO DEFAULT_MSG LIBCRYPTO_LIBRARY LIBCRYPTO_INCLUDE_DIR)
53
54
  IF(LIBCRYPTO_FOUND)
55
    SET( LIBCRYPTO_LIBRARIES ${LIBCRYPTO_LIBRARY} )
56
  ELSE(LIBCRYPTO_FOUND)
57
    SET( LIBCRYPTO_LIBRARIES )
58
  ENDIF(LIBCRYPTO_FOUND)
59
60
  MARK_AS_ADVANCED( LIBCRYPTO_LIBRARY LIBCRYPTO_INCLUDE_DIR )
61
62
ENDIF (NOT LIBCRYPTO_INCLUDE_DIR OR NOT LIBCRYPTO_LIBRARIES)
63
64
# check whether using OpenSSL 1.1 API
65
IF (DEFINED LIBCRYPTO_INCLUDE_DIR AND DEFINED LIBCRYPTO_LIBRARIES)
66
  INCLUDE(CheckCSourceCompiles)
67
68
  SET(CMAKE_REQUIRED_INCLUDES ${LIBCRYPTO_INCLUDE_DIR})
69
  SET(CMAKE_REQUIRED_LIBRARIES ${LIBCRYPTO_LIBRARIES})
70
71
  CHECK_C_SOURCE_COMPILES("#include <openssl/opensslv.h>
72
			#ifndef OPENSSL_VERSION_NUMBER
73
			#error No OPENSSL_VERSION_NUMBER defined
74
			#endif
75
			#if OPENSSL_VERSION_NUMBER < 0x10100000L
76
			#error This is not OpenSSL 1.1 or higher
77
			#endif
78
			int main(void) { return 0; }" PODOFO_HAVE_OPENSSL_1_1)
79
80
  CHECK_C_SOURCE_COMPILES("#include <openssl/opensslconf.h>
81
			#ifndef OPENSSL_NO_RC4
82
			#error No OPENSSL_NO_RC4 defined
83
			#endif
84
			int main(void) { return 0; }" PODOFO_HAVE_OPENSSL_NO_RC4)
85
86
  UNSET(CMAKE_REQUIRED_INCLUDES)
87
  UNSET(CMAKE_REQUIRED_LIBRARIES)
88
ENDIF (DEFINED LIBCRYPTO_INCLUDE_DIR AND DEFINED LIBCRYPTO_LIBRARIES)
(-)podofo-0.9.6_pre20170629-orig/tools/podofosign/podofosign.cpp (+7 lines)
Lines 27-32 Link Here
27
#include <openssl/evp.h>
27
#include <openssl/evp.h>
28
#include <openssl/err.h>
28
#include <openssl/err.h>
29
#include <openssl/pem.h>
29
#include <openssl/pem.h>
30
#include <openssl/ssl.h>
30
#include <openssl/x509.h>
31
#include <openssl/x509.h>
31
32
32
#if defined(_WIN64)
33
#if defined(_WIN64)
Lines 874-884 Link Here
874
        outputfile = NULL;
875
        outputfile = NULL;
875
    }
876
    }
876
877
878
#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000
879
    OPENSSL_init_ssl(0, NULL);
880
#else
877
    OpenSSL_add_all_algorithms();
881
    OpenSSL_add_all_algorithms();
878
    ERR_load_crypto_strings();
882
    ERR_load_crypto_strings();
879
    ERR_load_PEM_strings();
883
    ERR_load_PEM_strings();
880
    ERR_load_ASN1_strings();
884
    ERR_load_ASN1_strings();
881
    ERR_load_EVP_strings();
885
    ERR_load_EVP_strings();
886
#endif
882
887
883
    X509* cert = NULL;
888
    X509* cert = NULL;
884
    EVP_PKEY* pkey = NULL;
889
    EVP_PKEY* pkey = NULL;
Lines 1082-1088 Link Here
1082
        result = e.GetError();
1087
        result = e.GetError();
1083
    }
1088
    }
1084
1089
1090
#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000
1085
    ERR_free_strings();
1091
    ERR_free_strings();
1092
#endif
1086
1093
1087
    if( pSignField )
1094
    if( pSignField )
1088
        delete pSignField;
1095
        delete pSignField;
(-)podofo-0.9.6_pre20170629-orig/CMakeLists.txt (-10 / +36 lines)
Lines 325-339 Link Here
325
FIND_PACKAGE(ZLIB REQUIRED)
325
FIND_PACKAGE(ZLIB REQUIRED)
326
MESSAGE("Found zlib headers in ${ZLIB_INCLUDE_DIR}, library at ${ZLIB_LIBRARIES}")
326
MESSAGE("Found zlib headers in ${ZLIB_INCLUDE_DIR}, library at ${ZLIB_LIBRARIES}")
327
327
328
FIND_PACKAGE(LIBCRYPTO)
328
FIND_PACKAGE(OpenSSL REQUIRED) 
329
329
if(OpenSSL_FOUND)
330
IF(LIBCRYPTO_FOUND)
331
	SET(PODOFO_HAVE_OPENSSL TRUE)
330
	SET(PODOFO_HAVE_OPENSSL TRUE)
332
	INCLUDE_DIRECTORIES(${LIBCRYPTO_INCLUDE_DIR})
331
        INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIRS})
333
	MESSAGE("Found OpenSSL's libCrypto headers in ${LIBCRYPTO_INCLUDE_DIR}, library at ${LIBCRYPTO_LIBRARIES}")
332
        LINK_DIRECTORIES(${OPENSSL_LIBRARIES})
334
ELSE(LIBCRYPTO_FOUND)
333
        MESSAGE(STATUS "Using OpenSSL ${OPENSSL_VERSION}")
335
	MESSAGE("OpenSSL's libCrypto not found. Encryption support will be disabled")
334
	MESSAGE("Found OpenSSL ${OPENSSL_VERSION} headers in ${OPENSSL_INCLUDE_DIRS}, library at ${OPENSSL_LIBRARIES}")
336
ENDIF(LIBCRYPTO_FOUND)
335
ELSE(OpenSSL_FOUND)
336
	MESSAGE("OpenSSL not found. Encryption support will be disabled")
337
ENDIF(OpenSSL_FOUND)
338
339
# check whether using OpenSSL 1.1 API
340
IF (DEFINED OPENSSL_INCLUDE_DIR AND DEFINED OPENSSL_LIBRARIES)
341
  INCLUDE(CheckCSourceCompiles)
342
343
  SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
344
  SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
345
346
  CHECK_C_SOURCE_COMPILES("#include <openssl/opensslv.h>
347
			#ifndef OPENSSL_VERSION_NUMBER
348
			#error No OPENSSL_VERSION_NUMBER defined
349
			#endif
350
			#if OPENSSL_VERSION_NUMBER < 0x10100000L
351
			#error This is not OpenSSL 1.1 or higher
352
			#endif
353
			int main(void) { return 0; }" PODOFO_HAVE_OPENSSL_1_1)
354
355
  CHECK_C_SOURCE_COMPILES("#include <openssl/opensslconf.h>
356
			#ifndef OPENSSL_NO_RC4
357
			#error No OPENSSL_NO_RC4 defined
358
			#endif
359
			int main(void) { return 0; }" PODOFO_HAVE_OPENSSL_NO_RC4)
360
361
  UNSET(CMAKE_REQUIRED_INCLUDES)
362
  UNSET(CMAKE_REQUIRED_LIBRARIES)
363
ENDIF (DEFINED OPENSSL_INCLUDE_DIR AND DEFINED OPENSSL_LIBRARIES)
337
364
338
FIND_PACKAGE(LIBIDN)
365
FIND_PACKAGE(LIBIDN)
339
366
Lines 496-503 Link Here
496
SET(PODOFO_LIB_DEPENDS
523
SET(PODOFO_LIB_DEPENDS
497
  ${ZLIB_LIBRARIES}
524
  ${ZLIB_LIBRARIES}
498
  ${LIBIDN_LIBRARIES}
525
  ${LIBIDN_LIBRARIES}
499
  ${LIBCRYPTO_LDFLAGS}
526
  ${OPENSSL_LIBRARIES}
500
  ${LIBCRYPTO_LIBRARIES}
501
  ${LIBJPEG_LIBRARIES}
527
  ${LIBJPEG_LIBRARIES}
502
  ${PLATFORM_SYSTEM_LIBRARIES}
528
  ${PLATFORM_SYSTEM_LIBRARIES}
503
  ${stlport_libraries_if_use_stlport}
529
  ${stlport_libraries_if_use_stlport}

Return to bug 614756