Missing guards for xmlsec EC support.
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Tue, 14 Sep 2010 01:40:09 +0000 (01:40 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Tue, 14 Sep 2010 01:40:09 +0000 (01:40 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/branches/REL_1@795 de75baf8-a10c-0410-a50a-987c0e22f00f

xmltooling/security/impl/BasicX509Credential.cpp
xmltooling/security/impl/SecurityHelper.cpp

index 5d761ea..324d0f6 100644 (file)
@@ -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;
index d847a60..9bbe7cc 100644 (file)
@@ -37,7 +37,9 @@
 #include <xsec/enc/OpenSSL/OpenSSLCryptoX509.hpp>
 #include <xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp>
 #include <xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.hpp>
-#include <xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.hpp>
+#ifdef XMLTOOLING_XMLSEC_ECC
+# include <xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.hpp>
+#endif
 #include <xercesc/util/Base64.hpp>
 
 using namespace xmltooling::logging;