From: Scott Cantor Date: Mon, 6 Sep 2010 18:15:55 +0000 (+0000) Subject: https://issues.shibboleth.net/jira/browse/CPPOST-52 X-Git-Tag: 2.4RC1~36 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=commitdiff_plain;h=e72b6644c8730e68142d78b712116538d88715f3 https://issues.shibboleth.net/jira/browse/CPPOST-52 --- diff --git a/saml/encryption/EncryptedKeyResolver.cpp b/saml/encryption/EncryptedKeyResolver.cpp index c25e528..5276dcb 100644 --- a/saml/encryption/EncryptedKeyResolver.cpp +++ b/saml/encryption/EncryptedKeyResolver.cpp @@ -44,8 +44,11 @@ const EncryptedKey* opensaml::EncryptedKeyResolver::resolveKey(const EncryptedDa const vector& keys=m_ref.getEncryptedKeys(); for (vector::const_iterator i=keys.begin(); i!=keys.end(); i++) { - if (XMLString::equals(recipient,(*i)->getRecipient())) + if ((*i)->getRecipient() == nullptr) + return (*i); + else if (XMLString::equals(recipient,(*i)->getRecipient())) return (*i); } + return nullptr; } diff --git a/saml/saml2/core/impl/Assertions.cpp b/saml/saml2/core/impl/Assertions.cpp index 89ea4c9..545748d 100644 --- a/saml/saml2/core/impl/Assertions.cpp +++ b/saml/saml2/core/impl/Assertions.cpp @@ -241,7 +241,7 @@ XMLObject* EncryptedElementType::decrypt(const CredentialResolver& credResolver, { if (!getEncryptedData()) throw DecryptionException("No encrypted data present."); - EncryptedKeyResolver ekr(*this); + opensaml::EncryptedKeyResolver ekr(*this); Decrypter decrypter(&credResolver, criteria, &ekr); DOMDocumentFragment* frag = decrypter.decryptData(*getEncryptedData(), recipient); if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {