Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pecl_http 2.x for compression #30

Open
fpoirotte opened this issue May 15, 2015 · 3 comments
Open

Support pecl_http 2.x for compression #30

fpoirotte opened this issue May 15, 2015 · 3 comments
Assignees
Milestone

Comments

@fpoirotte
Copy link
Owner

pssht relies on the PECL HTTP extension to provide compression on a stream of data (rather than on a fixed-length buffer).
Currently, the old 1.x branch is the only version supported.

The goal of this ticket is to add support for version 2.x as well to have broader support for compression.
As an alternative, maybe take a look at stream filters to see if it is possible to use them in a streaming mode.

fpoirotte added a commit that referenced this issue May 15, 2015
Also makes mcrypt & hash optional dependencies and fixes detection of algorithm
availability for some algorithms.

Note :

You should install at least one of mcrypt or hash to at least get a somewhat
usable server. Otherwise, the server will lack support for most algorithms
and will violate the RFC on required algorithms.
Also, only a handful of clients will be able to connect to pssht when it lacks
both extensions.

Fixes #30.
@fpoirotte fpoirotte added this to the 0.2.0 milestone May 15, 2015
@fpoirotte fpoirotte self-assigned this Sep 27, 2015
@kklem0
Copy link

kklem0 commented Feb 6, 2016

Just a quick looking around, why not use stream_filter_append for example to inflate/deflate so you can get rid of pecl_http which is not installed usually? (also seeing some failed tests about it)

@fpoirotte
Copy link
Owner Author

Hi,

For compression to work in ssh, a way to flush the compression buffers is required. The flush operation adds synchronization points to the data, which can be used for example by the receiving end to determine when to stop looking for more data to uncompress.

The pecl_http extension provides the FLUSH_SYNC flag for that purpose so that a synchronization point is automatically added after each call to the update() method. Unfortunately, the zlib extension does not currently support flushing its internal buffers (see https://bugs.php.net/bug.php?id=48725) and therefore is not a suitable replacement for pecl_http for the time being.

Regarding the current tests failures, they are due to some functional tests where the OpenBSD SSH client is used to establish a connection to a pssht server with varying ciphers. For some reason, this works when I test it locally, but errors out on travis-ci.

@fpoirotte
Copy link
Owner Author

PHP 7.0 added support for incremental compression/decompression (see http://php.net/manual/en/zlib.examples.php), so it may be possible to use this new API to achieve the same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants