[java-opensaml] branch master updated: IDP-1397: Removal of deprecated features
Brent Putman
putmanb at georgetown.edu
Wed Feb 19 19:29:54 EST 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=1ea7ab352b5163a54f47df40b6be7e839f487d31
The following commit(s) were added to refs/heads/master by this push:
new 1ea7ab3 IDP-1397: Removal of deprecated features
1ea7ab3 is described below
commit 1ea7ab352b5163a54f47df40b6be7e839f487d31
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Wed Feb 19 19:04:24 2020 -0500
IDP-1397: Removal of deprecated features
Santuario hasn't used their now-deprecated IdResovler since 2012.
It's time we followed suite, in favor of just Document.getElementById.
---
.../saml/security/impl/SAMLSignatureProfileValidator.java | 8 +++-----
.../xmlsec/encryption/support/DecryptionSignedContentTest.java | 10 ++++------
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/security/impl/SAMLSignatureProfileValidator.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/security/impl/SAMLSignatureProfileValidator.java
index 8316e55..d38caf0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/security/impl/SAMLSignatureProfileValidator.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/security/impl/SAMLSignatureProfileValidator.java
@@ -27,7 +27,6 @@ import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.transforms.Transform;
import org.apache.xml.security.transforms.TransformationException;
import org.apache.xml.security.transforms.Transforms;
-import org.apache.xml.security.utils.IdResolver;
import org.opensaml.saml.common.SignableSAMLObject;
import org.opensaml.xmlsec.signature.Signature;
import org.opensaml.xmlsec.signature.impl.SignatureImpl;
@@ -44,7 +43,6 @@ import com.google.common.base.Strings;
* A validator for instances of {@link Signature}, which validates that the signature meets security-related
* requirements indicated by the SAML profile of XML Signature.
*/
- at SuppressWarnings("deprecation")
public class SAMLSignatureProfileValidator implements SignaturePrevalidator {
/** Class logger. */
@@ -154,10 +152,10 @@ public class SAMLSignatureProfileValidator implements SignaturePrevalidator {
}
final Document doc = expected.getOwnerDocument();
- final Element resolved = IdResolver.getElementById(doc, uriID);
+ final Element resolved = doc.getElementById(uriID);
if (resolved == null) {
- log.error("Apache xmlsec IdResolver could not resolve the Element for id reference: {}", uriID);
- throw new SignatureException("Apache xmlsec IdResolver could not resolve the Element for id reference: "
+ log.error("DOM Document getElementById could not resolve the Element for id reference: {}", uriID);
+ throw new SignatureException("DOM Document getElementById could not resolve the Element for id reference: "
+ uriID);
}
diff --git a/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/encryption/support/DecryptionSignedContentTest.java b/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/encryption/support/DecryptionSignedContentTest.java
index 3a6d732..69bb335 100644
--- a/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/encryption/support/DecryptionSignedContentTest.java
+++ b/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/encryption/support/DecryptionSignedContentTest.java
@@ -28,7 +28,6 @@ import java.security.KeyPair;
import net.shibboleth.utilities.java.support.xml.XMLParserException;
-import org.apache.xml.security.utils.IdResolver;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.XMLObjectBaseTestCase;
import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
@@ -132,13 +131,12 @@ public class DecryptionSignedContentTest extends XMLObjectBaseTestCase {
Signature decryptedSignature = decryptedSXO.getSignature();
- // Sanity check that DOM-based ID resolution using Apache XML Security IdResolver
+ // Sanity check that DOM-based ID resolution using Document getElementById
// is working correctly
- Element apacheResolvedElement = IdResolver.getElementById(decryptedSignature.getDOM().getOwnerDocument(),
- idValue);
- Assert.assertNotNull(apacheResolvedElement, "Apache ID resolver found no element");
+ Element resolvedElement = decryptedSignature.getDOM().getOwnerDocument().getElementById(idValue);
+ Assert.assertNotNull(resolvedElement, "Document getElementById found no element");
Assert.assertTrue(decryptedSXO.getDOM()
- .isSameNode(apacheResolvedElement), "Apache ID resolver found different element");
+ .isSameNode(resolvedElement), "Document getElementById found different element");
// Verify signature of the decrypted content - this is where bug was reported.
SignatureValidator.validate(decryptedSignature, signingCredential);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list