[java-metadata-aggregator COMMIT] /trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/XMLSignatureVa...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Oct 11 10:59:15 EDT 2013
Author: iay
Date: Fri Oct 11 10:59:15 2013
New Revision: 264
URL: http://svn.shibboleth.net/view/java-metadata-aggregator?rev=264&view=rev
Log:
MDA-112: signature validation stage should protect against wrapping attacks
MDA-110: signature verification stage needs property to indicate reference ID attribute
The existing test was not noticing that validation of signatures was failing. This version of the test will notice, and the build will fail.
Modified:
trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/XMLSignatureValidationStageTest.java
Modified: trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/XMLSignatureValidationStageTest.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/XMLSignatureValidationStageTest.java?rev=264&r1=263&r2=264&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/XMLSignatureValidationStageTest.java (original)
+++ trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/XMLSignatureValidationStageTest.java Fri Oct 11 10:59:15 2013
@@ -24,6 +24,7 @@
import net.shibboleth.metadata.AssertSupport;
import net.shibboleth.metadata.ErrorStatus;
+import net.shibboleth.metadata.WarningStatus;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
@@ -48,8 +49,6 @@
/**
* Tests verifying a file with a valid signature.
- *
- * @throws Exception thrown if there is a problem verifying the data
*/
@Test
public void testValidSignature() throws Exception {
@@ -70,12 +69,18 @@
DomElementItem result = mdCol.iterator().next();
AssertSupport.assertValidComponentInfo(result, 1, XMLSignatureValidationStage.class, "test");
+
+ // There should not have been any errors.
+ final List<ErrorStatus> errors = result.getItemMetadata().get(ErrorStatus.class);
+ Assert.assertEquals(errors.size(), 0);
+
+ // There should not have been any warnings either.
+ final List<WarningStatus> warnings = result.getItemMetadata().get(WarningStatus.class);
+ Assert.assertEquals(warnings.size(), 0);
}
/**
- * Test that a metadata element with an invalid signature is removed from the collection.
- *
- * @throws Exception thrown if there is a problem checking the signature
+ * Test that a metadata element with an invalid signature is labelled with an error.
*/
@Test
public void testInvalidSignature() throws Exception {
@@ -97,10 +102,8 @@
}
/**
- * Test that metadata elements that do not contain signature are appropriately filtered out when valid signatures
+ * Test that metadata elements that do not contain signature are appropriately labelled when valid signatures
* are required.
- *
- * @throws Exception thrown if there is a problem checking signatures
*/
@Test
public void testRequiredSignature() throws Exception {
More information about the commits
mailing list