Fix compile/packaging nits.
git-svn-id: https://svn.apache.org/repos/asf/santuario/xml-security-cpp/trunk@1830714 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/configure.ac b/configure.ac
index ada2ea3..194447e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -239,6 +239,10 @@
AC_DEFINE([XSEC_OPENSSL_CONST_BUFFERS],[1],[Define to 1 if OpenSSL uses const input buffers.])],
[AC_MSG_RESULT([no])])
+ AC_CHECK_DECL(EVP_PKEY_id,
+ [AC_DEFINE([XSEC_OPENSSL_HAVE_EVP_PKEY_ID],[1],[Define to 1 if OpenSSL has EVP_PKEY_id function.])],
+ ,[#include <openssl/evp.h>])
+
AC_MSG_CHECKING([for non-broken AES support])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/evp.h>]], [[ EVP_aes_256_cbc();
]])],[AC_MSG_RESULT([yes])
diff --git a/xml-security-c.spec b/xml-security-c.spec
index 18c2ea8..b509fb7 100644
--- a/xml-security-c.spec
+++ b/xml-security-c.spec
@@ -8,13 +8,8 @@
Source: %{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-%if 0%{?rhel} >= 7 || 0%{?centos_version} >= 700
-BuildRequires: xerces-c-devel >= 3.2
-%{?_with_xalan:BuildRequires: xalan-c-devel >= 1.11}
-%else
-BuildRequires: libxerces-c-devel >= 3.2
%{?_with_xalan:BuildRequires: libxalan-c-devel >= 1.11}
-%endif
+BuildRequires: libxerces-c-devel >= 3.2
BuildRequires: openssl-devel gcc-c++ pkgconfig
%if "%{_vendor}" == "redhat"
BuildRequires: redhat-rpm-config
@@ -42,7 +37,6 @@
Summary: Apache XML security C++ library
Group: Development/Libraries/C and C++
Provides: xml-security-c = %{version}-%{release}
-Obsoletes: xml-security-c < %{version}-%{release}
%description -n libxml-security-c20
The xml-security-c library is a C++ implementation of the XML Digital Signature
@@ -57,15 +51,9 @@
Group: Development/Libraries/C and C++
Requires: libxml-security-c18 = %{version}-%{release}
Requires: openssl-devel
-%if 0%{?rhel} >= 7 || 0%{?centos_version} >= 700
-Requires: xerces-c-devel
-%{?_with_xalan:Requires: xalan-c-devel}
-%else
-Requires: libxerces-c-devel
-%{?_with_xalan:Requires: libxalan-c-devel}
-%endif
+Requires: libxerces-c-devel >= 3.2
+%{?_with_xalan:Requires: libxalan-c-devel >= 1.11}
Provides: xml-security-c-devel = %{version}-%{release}
-Obsoletes: xml-security-c-devel < %{version}-%{release}
%description -n libxml-security-c-devel
The xml-security-c library is a C++ implementation of the XML Digital Signature
@@ -110,6 +98,7 @@
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/*.a
+%{_libdir}/pkgconfig/xml-security-c.pc
%changelog
* Mon Nov 13 2017 Scott Cantor <cantor.2@osu.edu> 2.0.0-1
diff --git a/xsec/framework/XSECW32Config.hpp b/xsec/framework/XSECW32Config.hpp
index 1fd3a22..1f4e167 100644
--- a/xsec/framework/XSECW32Config.hpp
+++ b/xsec/framework/XSECW32Config.hpp
@@ -77,6 +77,7 @@
# define XSEC_OPENSSL_D2IX509_CONST_BUFFER
# define XSEC_OPENSSL_HAVE_SHA2
# define XSEC_OPENSSL_HAVE_MGF1
+# define XSEC_OPENSSL_HAVE_EVP_PKEY_ID
# endif
# if (OPENSSL_VERSION_NUMBER >= 0x10001000)
# define XSEC_OPENSSL_HAVE_GCM
diff --git a/xsec/tools/cipher/cipher.cpp b/xsec/tools/cipher/cipher.cpp
index 1a8a5f2..26ce259 100644
--- a/xsec/tools/cipher/cipher.cpp
+++ b/xsec/tools/cipher/cipher.cpp
@@ -517,8 +517,12 @@
EVP_PKEY *pkey;
pkey = X509_get_pubkey(x);
-
- if (pkey == NULL || EVP_PKEY_id(pkey) != EVP_PKEY_RSA) {
+#ifdef XSEC_OPENSSL_HAVE_EVP_PKEY_ID
+ if (pkey == NULL || EVP_PKEY_id(pkey) != EVP_PKEY_RSA)
+#else
+ if (pkey == NULL || pkey->type != EVP_PKEY_RSA)
+#endif
+ {
cerr << "Error extracting RSA key from certificate" << endl;
}