mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 13:28:27 +00:00
Merge branch '2.0'
This commit is contained in:
commit
324a973ec1
@ -171,16 +171,17 @@ class Agent
|
||||
for ($i = 0; $i < $keyCount; $i++) {
|
||||
$length = current(unpack('N', fread($this->fsock, 4)));
|
||||
$key_blob = fread($this->fsock, $length);
|
||||
$key_str = 'ssh-rsa ' . base64_encode($key_blob);
|
||||
$length = current(unpack('N', fread($this->fsock, 4)));
|
||||
if ($length) {
|
||||
$key_comment = fread($this->fsock, $length);
|
||||
$key_str.= ' ' . fread($this->fsock, $length);
|
||||
}
|
||||
$length = current(unpack('N', substr($key_blob, 0, 4)));
|
||||
$key_type = substr($key_blob, 4, $length);
|
||||
switch ($key_type) {
|
||||
case 'ssh-rsa':
|
||||
$key = new RSA();
|
||||
$key->load('ssh-rsa ' . base64_encode($key_blob) . ' ' . $key_comment);
|
||||
$key->load($key_str);
|
||||
break;
|
||||
case 'ssh-dss':
|
||||
// not currently supported
|
||||
|
Loading…
x
Reference in New Issue
Block a user