equal
deleted
inserted
replaced
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 |