mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-14 01:14:08 +00:00
RSA fingerprint feature fix
Proper Hash usage, PHP 4 compatibility
This commit is contained in:
parent
a67f4df164
commit
c46890b00c
@ -1730,11 +1730,11 @@ class RSA
|
|||||||
switch($algorithm)
|
switch($algorithm)
|
||||||
{
|
{
|
||||||
case 'sha256':
|
case 'sha256':
|
||||||
$hash = new Hash;
|
$hash = new Hash('sha256');
|
||||||
$base = base64_encode($hash->_sha256($RSAPublicKey));
|
$base = base64_encode($hash->hash($RSAPublicKey));
|
||||||
return substr($base, 0, strlen($base)-1);
|
return substr($base, 0, strlen($base)-1);
|
||||||
case 'md5':
|
case 'md5':
|
||||||
return join(':', str_split(md5($RSAPublicKey), 2));
|
return substr(chunk_split($RSAPublicKey, 2, ':'), 0, -1);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user