https://bugs.internet2.edu/jira/browse/CPPOST-52
authorcantor <cantor@fb386ef7-a10c-0410-8ebf-fd3f8e989ab0>
Mon, 6 Sep 2010 18:15:55 +0000 (18:15 +0000)
committercantor <cantor@fb386ef7-a10c-0410-8ebf-fd3f8e989ab0>
Mon, 6 Sep 2010 18:15:55 +0000 (18:15 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-opensaml2/branches/REL_2@574 fb386ef7-a10c-0410-8ebf-fd3f8e989ab0

saml/encryption/EncryptedKeyResolver.cpp
saml/saml2/core/impl/Assertions.cpp

index c25e528..5276dcb 100644 (file)
@@ -44,8 +44,11 @@ const EncryptedKey* opensaml::EncryptedKeyResolver::resolveKey(const EncryptedDa
 
     const vector<EncryptedKey*>& keys=m_ref.getEncryptedKeys();
     for (vector<EncryptedKey*>::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;
 }
index 89ea4c9..545748d 100644 (file)
@@ -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()) {