Skip to content

Commit

Permalink
Fix Invalid HMAC for D-link DES-3028
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lockland authored and terrafrost committed Jun 13, 2017
1 parent bbf467b commit 4d36e67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions phpseclib/Net/SSH2.php
Original file line number Diff line number Diff line change
Expand Up @@ -1290,8 +1290,9 @@ function _key_exchange($kexinit_payload_server)
);

// some SSH servers have buggy implementations of some of the above algorithms
switch ($this->server_identifier) {
case 'SSH-2.0-SSHD':
switch (true) {
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('hmac-sha1-96', 'hmac-md5-96')
Expand Down

0 comments on commit 4d36e67

Please sign in to comment.