Fixed incorrect unit test and corresponding bug in the DN extraction code.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 4 Jan 2005 18:00:46 +0000 (18:00 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 4 Jan 2005 18:00:46 +0000 (18:00 +0000)
Thanks to Will Norris for the fix.

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1202 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/common/ShibPOSTProfile.java
tests/edu/internet2/middleware/shibboleth/aa/DNHostNameExtractionTests.java

index 9420087..2c72a89 100755 (executable)
@@ -74,7 +74,7 @@ import edu.internet2.middleware.shibboleth.hs.HSRelyingParty;
  */
 public class ShibPOSTProfile {
 
-       private static Pattern  regex           = Pattern.compile(".*CN=([^,/]+).*");
+       private static Pattern  regex           = Pattern.compile(".*?CN=([^,/]+).*");
 
        /** XML Signature algorithm to apply */
        protected String                algorithm       = XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1;
index 0f364e7..640b362 100644 (file)
@@ -96,7 +96,7 @@ public class DNHostNameExtractionTests extends TestCase {
 
                try {
                        assertEquals("Round-trip handle validation failed on DN.", ShibPOSTProfile
-                                       .getHostNameFromDN(new X500Principal(dn1)), "wayf.internet2.edu");
+                                       .getHostNameFromDN(new X500Principal(dn4)), "wayf.internet2.edu");
 
                } catch (Exception e) {
                        fail("Error in test specification: " + e.getMessage());