mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-10 07:40:58 +00:00
Switched out pack/unpack and ip2long/long2ip with inet_pton/ntop for ipv6 encoding support in x509v3 subject alternative names
This commit is contained in:
parent
bdc28b9453
commit
4735751bf5
@ -2198,9 +2198,7 @@ class X509
|
||||
*/
|
||||
function _decodeIP($ip)
|
||||
{
|
||||
$ip = base64_decode($ip);
|
||||
list(, $ip) = unpack('N', $ip);
|
||||
return long2ip($ip);
|
||||
return inet_ntop(base64_decode($ip));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2214,7 +2212,7 @@ class X509
|
||||
*/
|
||||
function _encodeIP($ip)
|
||||
{
|
||||
return base64_encode(pack('N', ip2long($ip)));
|
||||
return base64_encode(inet_pton($ip));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user