From: cantor Date: Tue, 14 Sep 2010 01:40:09 +0000 (+0000) Subject: Missing guards for xmlsec EC support. X-Git-Tag: 1.4.1~43 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=commitdiff_plain;h=764a83a833a4d5bc77983d86d0f9110ca2d9ea5a Missing guards for xmlsec EC support. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/branches/REL_1@795 de75baf8-a10c-0410-a50a-987c0e22f00f --- diff --git a/xmltooling/security/impl/BasicX509Credential.cpp b/xmltooling/security/impl/BasicX509Credential.cpp index 5d761ea..324d0f6 100644 --- a/xmltooling/security/impl/BasicX509Credential.cpp +++ b/xmltooling/security/impl/BasicX509Credential.cpp @@ -206,10 +206,12 @@ const char* BasicX509Credential::getAlgorithm() const case XSECCryptoKey::KEY_DSA_PAIR: return "DSA"; +#ifdef XMLTOOLING_XMLSEC_ECC case XSECCryptoKey::KEY_EC_PRIVATE: case XSECCryptoKey::KEY_EC_PUBLIC: case XSECCryptoKey::KEY_EC_PAIR: return "EC"; +#endif case XSECCryptoKey::KEY_HMAC: return "HMAC"; @@ -263,7 +265,11 @@ XSECCryptoKey* BasicX509Credential::getPrivateKey() const { if (m_key) { XSECCryptoKey::KeyType type = m_key->getKeyType(); - if (type!=XSECCryptoKey::KEY_RSA_PUBLIC && type!=XSECCryptoKey::KEY_DSA_PUBLIC && type!=XSECCryptoKey::KEY_EC_PUBLIC) + if (type != XSECCryptoKey::KEY_RSA_PUBLIC && type != XSECCryptoKey::KEY_DSA_PUBLIC +#ifdef XMLTOOLING_XMLSEC_ECC + && type != XSECCryptoKey::KEY_EC_PUBLIC +#endif + ) return m_key; } return nullptr; @@ -273,7 +279,11 @@ XSECCryptoKey* BasicX509Credential::getPublicKey() const { if (m_key) { XSECCryptoKey::KeyType type = m_key->getKeyType(); - if (type!=XSECCryptoKey::KEY_RSA_PRIVATE && type!=XSECCryptoKey::KEY_DSA_PRIVATE && type!=XSECCryptoKey::KEY_EC_PRIVATE) + if (type != XSECCryptoKey::KEY_RSA_PRIVATE && type != XSECCryptoKey::KEY_DSA_PRIVATE +#ifdef XMLTOOLING_XMLSEC_ECC + && type != XSECCryptoKey::KEY_EC_PRIVATE +#endif + ) return m_key; } return nullptr; diff --git a/xmltooling/security/impl/SecurityHelper.cpp b/xmltooling/security/impl/SecurityHelper.cpp index d847a60..9bbe7cc 100644 --- a/xmltooling/security/impl/SecurityHelper.cpp +++ b/xmltooling/security/impl/SecurityHelper.cpp @@ -37,7 +37,9 @@ #include #include #include -#include +#ifdef XMLTOOLING_XMLSEC_ECC +# include +#endif #include using namespace xmltooling::logging;