mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-28 23:29:02 +00:00
RSA: putty keys weren't being formatted correctly
This commit is contained in:
parent
c6a52cb1b1
commit
755f0f17a5
@ -760,7 +760,7 @@ class Crypt_RSA {
|
||||
strlen($this->comment), $this->comment, strlen($public), $public
|
||||
);
|
||||
$public = base64_encode($public);
|
||||
$key.= "Public-Lines: " . ((strlen($public) + 32) >> 6) . "\r\n";
|
||||
$key.= "Public-Lines: " . ((strlen($public) + 63) >> 6) . "\r\n";
|
||||
$key.= chunk_split($public, 64);
|
||||
$private = pack('Na*Na*Na*Na*',
|
||||
strlen($raw['privateExponent']), $raw['privateExponent'], strlen($raw['prime1']), $raw['prime1'],
|
||||
@ -791,7 +791,7 @@ class Crypt_RSA {
|
||||
}
|
||||
|
||||
$private = base64_encode($private);
|
||||
$key.= 'Private-Lines: ' . ((strlen($private) + 32) >> 6) . "\r\n";
|
||||
$key.= 'Private-Lines: ' . ((strlen($private) + 63) >> 6) . "\r\n";
|
||||
$key.= chunk_split($private, 64);
|
||||
if (!class_exists('Crypt_Hash')) {
|
||||
require_once('Crypt/Hash.php');
|
||||
|
Loading…
Reference in New Issue
Block a user