From: Scott Cantor Date: Fri, 29 Sep 2006 17:42:09 +0000 (+0000) Subject: Allow for SAML 1.0 whole doc signing. X-Git-Tag: 2.0-alpha1~181 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=commitdiff_plain;h=f458fb00695e7cbcd29efd3f8c940cf5bba2c818 Allow for SAML 1.0 whole doc signing. --- diff --git a/saml/signature/ContentReference.cpp b/saml/signature/ContentReference.cpp index 8253be4..b63e3de 100644 --- a/saml/signature/ContentReference.cpp +++ b/saml/signature/ContentReference.cpp @@ -44,22 +44,23 @@ public: void ContentReference::createReferences(DSIGSignature* sig) { + DSIGReference* ref=NULL; const XMLCh* id=m_signableObject.getXMLID(); if (!id || !*id) - throw xmlsignature::SignatureException("Cannot create Signature reference to SAML object without an identifier."); - - DSIGReference* ref=NULL; - XMLCh* buf=new XMLCh[XMLString::stringLen(id) + 2]; - buf[0]=chPound; - buf[1]=chNull; - XMLString::catString(buf,id); - try { - ref=sig->createReference(buf); - delete[] buf; - } - catch(...) { - delete[] buf; - throw; + ref=sig->createReference(&chNull); // whole doc reference + else { + XMLCh* buf=new XMLCh[XMLString::stringLen(id) + 2]; + buf[0]=chPound; + buf[1]=chNull; + XMLString::catString(buf,id); + try { + ref=sig->createReference(buf); + delete[] buf; + } + catch(...) { + delete[] buf; + throw; + } } ref->appendEnvelopedSignatureTransform(); DSIGTransformC14n* c14n=ref->appendCanonicalizationTransform(CANON_C14NE_NOC);