changeset 8858:30d80841e4e3

8218873: Improve JSSE endpoint checking Reviewed-by: mullan, ahgross, rhalade, mbalao, andrew
author bae
date Mon, 15 Jul 2019 04:39:20 +0100
parents 058e1de11d37
children d05dda1e6939
files src/share/classes/sun/security/util/HostnameChecker.java
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/util/HostnameChecker.java	Mon Jul 15 04:34:21 2019 +0100
+++ b/src/share/classes/sun/security/util/HostnameChecker.java	Mon Jul 15 04:39:20 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -268,18 +268,17 @@
      * The matching is performed as per RFC 2818 rules for TLS and
      * RFC 2830 rules for LDAP.<p>
      *
-     * The <code>name</code> parameter should represent a DNS name.
-     * The <code>template</code> parameter
-     * may contain the wildcard character *
+     * The <code>name</code> parameter should represent a DNS name.  The
+     * <code>template</code> parameter may contain the wildcard character '*'.
      */
     private boolean isMatched(String name, String template) {
         // check the validity of the domain name template.
         try {
-            // Replacing wildcard character '*' with 'x' so as to check
+            // Replacing wildcard character '*' with 'z' so as to check
             // the domain name template validity.
             //
             // Using the checking taken from OpenJDK 8's SNIHostName
-            checkHostName(template.replace('*', 'x'));
+            checkHostName(template.replace('*', 'z'));
         } catch (IllegalArgumentException iae) {
             // It would be nice to add debug log if not matching.
             return false;