mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-25 03:16:02 +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)
|
||||
{
|
||||
case 'sha256':
|
||||
$hash = new Hash;
|
||||
$base = base64_encode($hash->_sha256($RSAPublicKey));
|
||||
$hash = new Hash('sha256');
|
||||
$base = base64_encode($hash->hash($RSAPublicKey));
|
||||
return substr($base, 0, strlen($base)-1);
|
||||
case 'md5':
|
||||
return join(':', str_split(md5($RSAPublicKey), 2));
|
||||
return substr(chunk_split($RSAPublicKey, 2, ':'), 0, -1);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user