From e72b6644c8730e68142d78b712116538d88715f3 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Mon, 6 Sep 2010 18:15:55 +0000 Subject: [PATCH] https://issues.shibboleth.net/jira/browse/CPPOST-52 --- saml/encryption/EncryptedKeyResolver.cpp | 5 ++++- saml/saml2/core/impl/Assertions.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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()) { -- 2.1.4