Doc #72897 [NEW]: The client to server MAC algorithm list is truncated
| From: | benjamin dot cohen-solal at dalenys dot com | Date: | Fri, 19 Aug 2016 13:18:47 +0000 |
| Subject: | Doc #72897 [NEW]: The client to server MAC algorithm list is truncated | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13836@lists.php.net to get a copy of this message | ||
From: benjamin dot cohen-solal at dalenys dot com
Operating system: Debian 8
PHP version: 5.6.25
Package: ssh2
Bug Type: Documentation Problem
Bug description:The client to server MAC algorithm list is truncated
Description:
------------
When I send the following algorithm list in client to server / mac
field:
hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com
I receive the error message:
ben@debian:~$ php script.php
PHP Warning: ssh2_connect(): Error starting up SSH connection(-5):
Unable to exchange encryption keys in /home/ben/scriptphp on line 3
PHP Stack trace:
PHP 1. {main}() /home/ben/script.php:0
PHP 2. ssh2_connect() /home/ben/script.php:3
I successfully configured a ProFTPd server on my server on port 443 and
when I check its logs, I get the following error:
2016-08-17 14:53:36,048 mod_sftp/0.9.9[9930]: no shared client-to-server
MAC algorithm found (client sent 'hmcom', server sent
'hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com')
I never sent the "hmcom" value, it seems to have truncated the 2 first
letters and the 3 last ones from my algorithm list:
hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com because for example if I
changed the ".com" into ".cot", I get the error:
2016-08-17 14:53:36,048 mod_sftp/0.9.9[9930]: no shared client-to-server
MAC algorithm found (client sent 'hmcot', server sent
'hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com')
When I use the binary file sftp with shell_exec as following:
sftp -P 443 myhost.com
All is OK
---
From manual page: http://www.php.net/function.ssh2-connect
---
Test script:
---------------
<?php
ssh2_connect("myhost.com", 443, array(
"client_to_server" => array(
"mac" => 'hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com'
),
)
);
Expected result:
----------------
I don't expect any error message
Actual result:
--------------
I get the following error:
PHP Warning: ssh2_connect(): Error starting up SSH connection(-5):
Unable to exchange encryption keys in /home/ben/script.php on line 3
PHP Stack trace:
PHP 1. {main}() /home/bcohen/toto.php:0
PHP 2. ssh2_connect() /home/bcohen/toto.php:3
PHP Warning: ssh2_connect(): Unable to connect to myhost.com in
/home/ben/script.php on line 3
PHP Stack trace:
PHP 1. {main}() /home/ben/script.php:0
PHP 2. ssh2_connect() /home/ben/script.php:3
--
Edit bug report at https://bugs.php.net/bug.php?id=72897&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72897&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72897&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72897&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72897&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72897&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72897&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72897&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72897&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72897&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72897&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72897&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72897&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72897&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72897&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72897&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72897&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72897&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72897&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72897&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72897&r=mysqlcfg