From c46890b00cd3c2258896af84ab6b1156e65d1fa1 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Tue, 5 May 2015 08:51:17 +0200 Subject: [PATCH] RSA fingerprint feature fix Proper Hash usage, PHP 4 compatibility --- phpseclib/Crypt/RSA.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 09778caf..1aa9f914 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -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; }