Fix Invalid HMAC for D-link DES-3028

When I tried connect to a dlink switch the Net_SSH2 does not choose
the correct algorithms for hmac causing an Invalid HMAC error. However,
after I commented the line 1280 everything work magnificently
This commit is contained in:
Sidney Souza 2017-06-02 09:46:51 -03:00 committed by terrafrost
parent bbf467babd
commit 4d36e67bee

View File

@ -1290,8 +1290,9 @@ class Net_SSH2
); );
// some SSH servers have buggy implementations of some of the above algorithms // some SSH servers have buggy implementations of some of the above algorithms
switch ($this->server_identifier) { switch (true) {
case 'SSH-2.0-SSHD': case $this->server_identifier == 'SSH-2.0-SSHD':
case substr($this->server_identifier, 0, 13) == 'SSH-2.0-DLINK':
$mac_algorithms = array_values(array_diff( $mac_algorithms = array_values(array_diff(
$mac_algorithms, $mac_algorithms,
array('hmac-sha1-96', 'hmac-md5-96') array('hmac-sha1-96', 'hmac-md5-96')