summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2014-11-19 00:50:46 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-11-19 00:50:46 +0000
commitd910cf339d61153d66f9a3d835eff027791ad78c (patch)
treefddcd09681c8b2e174d96a1e1825e543454127e2
parentbe5e80e21d4b06d72b30b78ed195fe557a0b687c (diff)
parentfc3d4de60de1465b8826cbdf2fc4b894bb3054d7 (diff)
downloadlibcore-d910cf339d61153d66f9a3d835eff027791ad78c.zip
libcore-d910cf339d61153d66f9a3d835eff027791ad78c.tar.gz
libcore-d910cf339d61153d66f9a3d835eff027791ad78c.tar.bz2
Merge "Fix DefaultHostnameVerifierTest failure."
-rw-r--r--luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java b/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java
index 71ccea4..e890355 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java
@@ -154,9 +154,11 @@ public final class DefaultHostnameVerifierTest extends TestCase {
assertFalse(verifier.verifyHostName("imap.google.com", "ix*.google.com"));
assertTrue(verifier.verifyHostName("imap.google.com", "iMap.Google.Com"));
assertTrue(verifier.verifyHostName("weird", "weird"));
+ assertFalse(verifier.verifyHostName("weird", "weird."));
+
+ // Wildcards rejected for domain names consisting of fewer than two labels (excluding root).
assertFalse(verifier.verifyHostName("weird", "weird*"));
assertFalse(verifier.verifyHostName("weird", "*weird"));
- assertFalse(verifier.verifyHostName("weird", "weird."));
assertFalse(verifier.verifyHostName("weird", "weird*."));
assertFalse(verifier.verifyHostName("weird", "weird.*"));
}
@@ -175,10 +177,12 @@ public final class DefaultHostnameVerifierTest extends TestCase {
assertFalse(verifier.verifyHostName("imap.google.com.", "ix*.google.com"));
assertTrue(verifier.verifyHostName("imap.google.com.", "iMap.Google.Com"));
assertTrue(verifier.verifyHostName("weird.", "weird"));
- assertTrue(verifier.verifyHostName("weird.", "weird*"));
- assertTrue(verifier.verifyHostName("weird.", "*weird"));
assertTrue(verifier.verifyHostName("weird.", "weird."));
- assertTrue(verifier.verifyHostName("weird.", "weird*."));
+
+ // Wildcards rejected for domain names consisting of fewer than two labels (excluding root).
+ assertFalse(verifier.verifyHostName("weird.", "*weird"));
+ assertFalse(verifier.verifyHostName("weird.", "weird*"));
+ assertFalse(verifier.verifyHostName("weird.", "weird*."));
assertFalse(verifier.verifyHostName("weird.", "weird.*"));
}