Update ctors to use new attribute shortcuts.
[shibboleth/cpp-opensaml.git] / saml / binding / impl / SimpleSigningRule.cpp
index c16dd7e..4ba76e2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2009 Internet2
+ *  Copyright 2001-2010 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 /**
  * SimpleSigningRule.cpp
  * 
- * Blob-oriented signature checking SecurityPolicyRule
+ * Blob-oriented signature checking SecurityPolicyRule.
  */
 
 #include "internal.h"
 #include "exceptions.h"
+#include "binding/SecurityPolicy.h"
 #include "binding/SecurityPolicyRule.h"
 #include "saml2/core/Assertions.h"
 #include "saml2/metadata/Metadata.h"
 
 #include <xercesc/util/Base64.hpp>
 #include <xmltooling/logging.h>
+#include <xmltooling/XMLToolingConfig.h>
 #include <xmltooling/io/HTTPRequest.h>
 #include <xmltooling/security/SignatureTrustEngine.h>
+#include <xmltooling/signature/KeyInfo.h>
+#include <xmltooling/signature/Signature.h>
+#include <xmltooling/util/ParserPool.h>
 
 using namespace opensaml::saml2md;
 using namespace opensaml;
@@ -84,12 +89,8 @@ bool SimpleSigningRule::appendParameter(string& s, const char* data, const char*
     return true;
 }
 
-SimpleSigningRule::SimpleSigningRule(const DOMElement* e) : m_errorFatal(false)
+SimpleSigningRule::SimpleSigningRule(const DOMElement* e) : m_errorFatal(XMLHelper::getAttrBool(e, false, errorFatal))
 {
-    if (e) {
-        const XMLCh* flag = e->getAttributeNS(NULL, errorFatal);
-        m_errorFatal = (flag && (*flag==chLatin_t || *flag==chDigit_1)); 
-    }
 }
 
 bool SimpleSigningRule::evaluate(const XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const
@@ -183,7 +184,7 @@ bool SimpleSigningRule::evaluate(const XMLObject& message, const GenericRequest*
     }
 
     // Check for KeyInfo, but defensively (we might be able to run without it).
-    KeyInfo* keyInfo=NULL;
+    KeyInfo* keyInfo=nullptr;
     pch = request->getParameter("KeyInfo");
     if (pch) {
         xsecsize_t x;