src/java.base/share/classes/sun/security/util/HostnameChecker.java
branchJDK-8145252-TLS13-branch
changeset 56692 7b0bde908f58
parent 56542 56aaa6cb3693
equal deleted inserted replaced
56686:07dc566630ee 56692:7b0bde908f58
   102             throws CertificateException {
   102             throws CertificateException {
   103         match(expectedName, cert, false);
   103         match(expectedName, cert, false);
   104     }
   104     }
   105 
   105 
   106     /**
   106     /**
   107      * Perform the check for Kerberos.
       
   108      */
       
   109     public static boolean match(String expectedName, Principal principal) {
       
   110         String hostName = getServerName(principal);
       
   111         return (expectedName.equalsIgnoreCase(hostName));
       
   112     }
       
   113 
       
   114     /**
       
   115      * Return the Server name from Kerberos principal.
       
   116      */
       
   117     public static String getServerName(Principal principal) {
       
   118 /*
       
   119         ClientKeyExchangeService p =
       
   120                 ClientKeyExchangeService.find("KRB5");
       
   121         if (p == null) {
       
   122             throw new AssertionError("Kerberos should have been available");
       
   123         }
       
   124         return p.getServiceHostName(principal);
       
   125 */
       
   126         return null;
       
   127     }
       
   128 
       
   129     /**
       
   130      * Test whether the given hostname looks like a literal IPv4 or IPv6
   107      * Test whether the given hostname looks like a literal IPv4 or IPv6
   131      * address. The hostname does not need to be a fully qualified name.
   108      * address. The hostname does not need to be a fully qualified name.
   132      *
   109      *
   133      * This is not a strict check that performs full input validation.
   110      * This is not a strict check that performs full input validation.
   134      * That means if the method returns true, name need not be a correct
   111      * That means if the method returns true, name need not be a correct