https://issues.shibboleth.net/jira/browse/CPPOST-52
authorScott Cantor <cantor.2@osu.edu>
Mon, 6 Sep 2010 18:15:55 +0000 (18:15 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 6 Sep 2010 18:15:55 +0000 (18:15 +0000)
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++) {
 
     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 (*i);
     }
+
     return nullptr;
 }
     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.");
 {
     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()) {
     Decrypter decrypter(&credResolver, criteria, &ekr);
     DOMDocumentFragment* frag = decrypter.decryptData(*getEncryptedData(), recipient);
     if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {