You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by mu...@apache.org on 2006/01/30 21:55:31 UTC

svn commit: r373586 - /xml/security/branches/jsr105_0_16/src_unitTests/org/apache/xml/security/test/interop/BaltimoreTest.java

Author: mullan
Date: Mon Jan 30 12:55:28 2006
New Revision: 373586

URL: http://svn.apache.org/viewcvs?rev=373586&view=rev
Log:
Add test case that tests that an invalid signature is not valid.

Modified:
    xml/security/branches/jsr105_0_16/src_unitTests/org/apache/xml/security/test/interop/BaltimoreTest.java

Modified: xml/security/branches/jsr105_0_16/src_unitTests/org/apache/xml/security/test/interop/BaltimoreTest.java
URL: http://svn.apache.org/viewcvs/xml/security/branches/jsr105_0_16/src_unitTests/org/apache/xml/security/test/interop/BaltimoreTest.java?rev=373586&r1=373585&r2=373586&view=diff
==============================================================================
--- xml/security/branches/jsr105_0_16/src_unitTests/org/apache/xml/security/test/interop/BaltimoreTest.java (original)
+++ xml/security/branches/jsr105_0_16/src_unitTests/org/apache/xml/security/test/interop/BaltimoreTest.java Mon Jan 30 12:55:28 2006
@@ -307,6 +307,35 @@
       assertTrue(filename, verify);
    }
 
+   /**
+    * Method test_sixteen_bad_signature. This tests make sure that an
+    * invalid signature is not valid. This is validating merlin's 16
+    * signature but some of the referenced content has been modified so
+    * some of the references should be invalid.
+    *
+    * @throws Exception
+    */
+   public void test_sixteen_bad_signature() throws Exception {
+
+      String filename =
+         merlinsDir16 + "/bad-signature.xml";
+      ResourceResolverSpi resolver = new OfflineResolver();
+      boolean followManifests = false;
+      boolean verify = false;
+
+      try {
+         verify = this.verify(filename, resolver, followManifests);
+      } catch (RuntimeException ex) {
+         log.error("Verification crashed for " + filename);
+         throw ex;
+      }
+
+      if (verify) {
+         log.error("Verification passed (should have failed) for " + filename);
+      }
+
+      assertFalse(filename, verify);
+   }
 
    /**
     * Method test_twenty_three_enveloping_hmac_sha1