X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=shibsp%2Fhandler%2Fimpl%2FSAML1Consumer.cpp;h=0470e02455852067a87c734203fadd20e2073591;hb=b757a2480a021c4183ee6dba77d4470adbf95ef8;hp=88ab9c05c8832b9a8cb495784e0f3d2ec86c8a60;hpb=163c5e045d4375e2c9cd1d2fdb13455db5d94362;p=shibboleth%2Fsp.git diff --git a/shibsp/handler/impl/SAML1Consumer.cpp b/shibsp/handler/impl/SAML1Consumer.cpp index 88ab9c0..0470e02 100644 --- a/shibsp/handler/impl/SAML1Consumer.cpp +++ b/shibsp/handler/impl/SAML1Consumer.cpp @@ -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. @@ -17,7 +17,7 @@ /** * SAML1Consumer.cpp * - * SAML 1.x assertion consumer service + * SAML 1.x assertion consumer service. */ #include "internal.h" @@ -66,7 +66,7 @@ namespace shibsp { SAML1Consumer(const DOMElement* e, const char* appId) : AssertionConsumerService(e, appId, Category::getInstance(SHIBSP_LOGCAT".SSO.SAML1")) { #ifndef SHIBSP_LITE - m_ssoRule = NULL; + m_ssoRule = nullptr; m_post = XMLString::equals(getString("Binding").second, samlconstants::SAML1_PROFILE_BROWSER_POST); if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) m_ssoRule = SAMLConfig::getConfig().SecurityPolicyRuleManager.newPlugin(SAML1BROWSERSSO_POLICY_RULE, e); @@ -91,12 +91,16 @@ namespace shibsp { const HTTPRequest& httpRequest, HTTPResponse& httpResponse, SecurityPolicy& policy, - const PropertySet* settings, + const PropertySet*, const XMLObject& xmlObject ) const; bool m_post; SecurityPolicyRule* m_ssoRule; +#else + const XMLCh* getProtocolFamily() const { + return samlconstants::SAML11_PROTOCOL_ENUM; + } #endif }; @@ -130,7 +134,7 @@ void SAML1Consumer::implementProtocol( const HTTPRequest& httpRequest, HTTPResponse& httpResponse, SecurityPolicy& policy, - const PropertySet* settings, + const PropertySet*, const XMLObject& xmlObject ) const { @@ -165,7 +169,7 @@ void SAML1Consumer::implementProtocol( pair minor = response->getMinorVersion(); // Maintain list of "legit" tokens to feed to SP subsystems. - const AuthenticationStatement* ssoStatement=NULL; + const AuthenticationStatement* ssoStatement=nullptr; vector tokens; // Also track "bad" tokens that we'll cache but not use. @@ -173,7 +177,7 @@ void SAML1Consumer::implementProtocol( vector badtokens; // With this flag on, we ignore any unsigned assertions. - const EntityDescriptor* entity = policy.getIssuerMetadata() ? dynamic_cast(policy.getIssuerMetadata()->getParent()) : NULL; + const EntityDescriptor* entity = policy.getIssuerMetadata() ? dynamic_cast(policy.getIssuerMetadata()->getParent()) : nullptr; pair flag = application.getRelyingParty(entity)->getBool("requireSignedAssertions"); // authnskew allows rejection of SSO if AuthnInstant is too old. @@ -184,13 +188,13 @@ void SAML1Consumer::implementProtocol( string contextualError; // Ensure the BrowserSSO rule is in the policy set. - if (find_if(policy.getRules(), _rulenamed(SAML1BROWSERSSO_POLICY_RULE)) == NULL) + if (find_if(policy.getRules(), _rulenamed(SAML1BROWSERSSO_POLICY_RULE)) == nullptr) policy.getRules().push_back(m_ssoRule); // Populate recipient as audience. policy.getAudiences().push_back(application.getRelyingParty(entity)->getXMLString("entityID").second); - time_t now = time(NULL); + time_t now = time(nullptr); for (vector::const_iterator a = assertions.begin(); a!=assertions.end(); ++a) { try { // Skip unsigned assertion? @@ -266,7 +270,7 @@ void SAML1Consumer::implementProtocol( // To complete processing, we need to extract and resolve attributes and then create the session. // Normalize the SAML 1.x NameIdentifier... - auto_ptr nameid(n ? NameIDBuilder::buildNameID() : NULL); + auto_ptr nameid(n ? NameIDBuilder::buildNameID() : nullptr); if (n) { nameid->setName(n->getName()); nameid->setFormat(n->getFormat()); @@ -283,7 +287,7 @@ void SAML1Consumer::implementProtocol( n, nameid.get(), ssoStatement->getAuthenticationMethod(), - NULL, + nullptr, &tokens ) ); @@ -305,12 +309,12 @@ void SAML1Consumer::implementProtocol( (!response->getMinorVersion().first || response->getMinorVersion().second==1) ? samlconstants::SAML11_PROTOCOL_ENUM : samlconstants::SAML10_PROTOCOL_ENUM, nameid.get(), - ssoStatement->getAuthenticationInstant() ? ssoStatement->getAuthenticationInstant()->getRawData() : NULL, - NULL, + ssoStatement->getAuthenticationInstant() ? ssoStatement->getAuthenticationInstant()->getRawData() : nullptr, + nullptr, ssoStatement->getAuthenticationMethod(), - NULL, + nullptr, &tokens, - ctx.get() ? &ctx->getResolvedAttributes() : NULL + ctx.get() ? &ctx->getResolvedAttributes() : nullptr ); }