[Web] Expand IPv6 addresses for better comparison
This commit is contained in:
@@ -355,6 +355,11 @@ function pem_to_der($pem_key) {
|
||||
unset($lines[0]);
|
||||
return base64_decode(implode('', $lines));
|
||||
}
|
||||
function expand_ipv6($ip) {
|
||||
$hex = unpack("H*hex", inet_pton($ip));
|
||||
$ip = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1);
|
||||
return $ip;
|
||||
}
|
||||
function generate_tlsa_digest($hostname, $port, $starttls = null) {
|
||||
if (!is_valid_domain_name($hostname)) {
|
||||
return "Not a valid hostname";
|
||||
|
Reference in New Issue
Block a user