[java-opensaml] 02/02: OSJ-310: Decrypted assertion's signature not verifiable due to IDness bug

Brent Putman putmanb at georgetown.edu
Thu May 28 03:50:35 UTC 2020


This is an automated email from the git hooks/post-receive script.

putmanb pushed a commit to branch master
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=286630bb85fe9487b38f44b4319adffa069fc1f4

commit 286630bb85fe9487b38f44b4319adffa069fc1f4
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Fri May 15 04:27:53 2020 -0400

    OSJ-310: Decrypted assertion's signature not verifiable due to IDness bug
---
 .../opensaml/saml/saml2/profile/impl/DecryptAssertions.java | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/DecryptAssertions.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/DecryptAssertions.java
index 7008a78ad..70ddcc90e 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/DecryptAssertions.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/DecryptAssertions.java
@@ -26,6 +26,8 @@ import javax.annotation.Nullable;
 
 import net.shibboleth.utilities.java.support.collection.Pair;
 
+import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.util.XMLObjectSupport;
 import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.saml.common.SAMLObject;
@@ -134,6 +136,17 @@ public class DecryptAssertions extends AbstractDecryptAction {
         
         response.getEncryptedAssertions().removeAll(encrypteds);
         response.getAssertions().addAll(decrypteds); 
+
+        // Re-marshall the response so that any ID attributes within the decrypted Assertions
+        // will have their ID-ness re-established at the DOM level.
+        if (!decrypteds.isEmpty()) {
+            try {
+                XMLObjectSupport.marshall(response);
+            } catch (final MarshallingException e) {
+                log.warn("Error re-marshalling Response after Assertion decryption", e);
+                throw new DecryptionException(e);
+            }
+        }
     }
     
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list