mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-27 22:59:02 +00:00
SSH2: fix rare key exchange issue
This commit is contained in:
parent
3ba5902046
commit
61ffe1a147
@ -1616,7 +1616,9 @@ class SSH2
|
|||||||
$temp = unpack('Nlength', substr($this->signature, 0, 4));
|
$temp = unpack('Nlength', substr($this->signature, 0, 4));
|
||||||
$this->signature_format = substr($this->signature, 4, $temp['length']);
|
$this->signature_format = substr($this->signature, 4, $temp['length']);
|
||||||
$keyBytes = DH::computeSecret($ourPrivate, $theirPublicBytes);
|
$keyBytes = DH::computeSecret($ourPrivate, $theirPublicBytes);
|
||||||
if (($keyBytes[0] & "\x80") === "\x80") {
|
if (($keyBytes & "\xFF\x80") === "\x00\x00") {
|
||||||
|
$keyBytes = substr($keyBytes, 1);
|
||||||
|
} elseif (($keyBytes[0] & "\x80") === "\x80") {
|
||||||
$keyBytes = "\0$keyBytes";
|
$keyBytes = "\0$keyBytes";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user