X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml1%2Fcore%2Fimpl%2FAssertionsImpl.cpp;h=fa14c350accb32f0c26b80bac94bfe5ddaabd89d;hb=f3a43f14f9dd53428f9e879bb489d6a4cf2674a8;hp=a8127abde063c988e5387f1ff105d4b82fa1ca81;hpb=1bc8e721db3a50294df852662e1eddcdbdae8f9f;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml1/core/impl/AssertionsImpl.cpp b/saml/saml1/core/impl/AssertionsImpl.cpp index a8127ab..fa14c35 100644 --- a/saml/saml1/core/impl/AssertionsImpl.cpp +++ b/saml/saml1/core/impl/AssertionsImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Internet2 + * Copyright 2001-2007 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ #include "saml1/core/Assertions.h" #include -#include #include #include #include @@ -37,7 +36,6 @@ #include using namespace opensaml::saml1; -using namespace opensaml; using namespace xmlsignature; using namespace xmltooling; using namespace std; @@ -879,7 +877,7 @@ namespace opensaml { continue; } - getOthers().push_back((*i)->clone()); + getUnknownXMLObjects().push_back((*i)->clone()); } } } @@ -887,7 +885,7 @@ namespace opensaml { IMPL_XMLOBJECT_CLONE(Advice); IMPL_TYPED_CHILDREN(AssertionIDReference,m_children.end()); IMPL_TYPED_CHILDREN(Assertion,m_children.end()); - IMPL_XMLOBJECT_CHILDREN(Other,m_children.end()); + IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end()); protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -897,7 +895,7 @@ namespace opensaml { // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); if (!XMLString::equals(nsURI,SAML1_NS) && nsURI && *nsURI) { - getOthers().push_back(childXMLObject); + getUnknownXMLObjects().push_back(childXMLObject); return; } @@ -1036,7 +1034,9 @@ namespace opensaml { MARSHALL_INTEGER_ATTRIB(MinorVersion,MINORVERSION,NULL); if (!m_AssertionID) const_cast(this)->m_AssertionID=SAMLConfig::getConfig().generateIdentifier(); - MARSHALL_ID_ATTRIB(AssertionID,ASSERTIONID,NULL); + domElement->setAttributeNS(NULL, ASSERTIONID_ATTRIB_NAME, m_AssertionID); + if (*m_MinorVersion!=chDigit_0) + domElement->setIdAttributeNS(NULL, ASSERTIONID_ATTRIB_NAME); MARSHALL_STRING_ATTRIB(Issuer,ISSUER,NULL); if (!m_IssueInstant) { const_cast(this)->m_IssueInstantEpoch=time(NULL); @@ -1057,6 +1057,13 @@ namespace opensaml { AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } + void unmarshallAttributes(const DOMElement* domElement) { + // Standard processing, but then we check IDness. + AbstractXMLObjectUnmarshaller::unmarshallAttributes(domElement); + if (m_AssertionID && (!m_MinorVersion || *m_MinorVersion!=chDigit_0)) + const_cast(domElement)->setIdAttributeNS(NULL, ASSERTIONID_ATTRIB_NAME); + } + void processAttribute(const DOMAttr* attribute) { static const XMLCh MAJORVERSION[] = UNICODE_LITERAL_12(M,a,j,o,r,V,e,r,s,i,o,n); if (XMLHelper::isNodeNamed(attribute,NULL,MAJORVERSION)) { @@ -1064,7 +1071,7 @@ namespace opensaml { throw UnmarshallingException("Assertion has invalid major version."); } PROC_INTEGER_ATTRIB(MinorVersion,MINORVERSION,NULL); - PROC_ID_ATTRIB(AssertionID,ASSERTIONID,NULL); + PROC_STRING_ATTRIB(AssertionID,ASSERTIONID,NULL); PROC_STRING_ATTRIB(Issuer,ISSUER,NULL); PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL); }