Bug 356201 - Send file operation fails due to Socks5 proxy protocol error
Summary: Send file operation fails due to Socks5 proxy protocol error
Status: RESOLVED WORKSFORME
Alias: None
Product: kopete
Classification: Unmaintained
Component: Jabber Plugin (show other bugs)
Version: 1.7.2
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-12-02 16:28 UTC by Lukasz Kucharski
Modified: 2018-10-27 02:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukasz Kucharski 2015-12-02 16:28:09 UTC
After a few debug runs, wireshark trace sessions and kopete recompilations problem is found.

Issue is visible when Kopete sends files to other clients (confirmed with Pidgin).

According to Socks5 description on wiki (https://en.wikipedia.org/wiki/SOCKS#SOCKS5) client should send greeting message (socks version, supported authentication methods) and server side sockets should respond to that with one selected method or error if non of is supported.

Problem with kopete (at least without libjingle support) is that no matter Kopete acts as a client or as a server greeting message always show up in communication from kopete side.

This in case Kopete is server side client like Pidgin after sending greeting messages expects to get two bytes (socks_version, selected_auth_method | 0xff) but it gets a kopete greeting message and this is interpreted as server selected gssapi authentication method (which even was not on cliend support list).

Reproducible: Always

Steps to Reproduce:
1. Send a file to other client (checked with Pidgin)
2. Other side accepts


Actual Results:  
Send operation fails immediately from Kopete side (in Pidgin console Socks5 session issue can be found).

Expected Results:  
File is actually transfered

Quick and dirty modification of protocols/jabber/libiris/src/irisnet/noncore/cutestuff/socks.cpp to prevent sending greeting message (in sock_connected) when SocksClient is on Server socket end helps and file transfer in both directions (Kopete <-> Pidgin) work.
Comment 1 Lukasz Kucharski 2015-12-02 16:36:46 UTC
My actual version of Kopete was 1.7.3 - from some reason it's not available in the list).

Latest version on git master also have the same issue
void SocksClient::sock_connected()
{
#ifdef PROX_DEBUG
	fprintf(stderr, "SocksClient: Connected\n");
#endif

	d->step = StepVersion;
        // This should send only in case socket connect to remote server(sockets connects du to SocksClient::connectToHost) otherwise no greeting message should be send.
	writeData(spc_set_version(!d->user.isEmpty())); // fixme requirement for auth should set outside
}
Comment 2 Pali Rohár 2015-12-15 19:49:20 UTC
Hi Lukasz! Kopete jabber code uses external libiris library for XMPP support. Due to compilation problems Kopete has unmodified copy of libiris in git/tarball.

If there are any problems with libiris library, please report bugs to libiris project at https://github.com/psi-im/iris

PSI jabber client uses same library, so please check PSI if has same problem as Kopete to determinate if problem is in library libiris or application.

Also libiris library has xmpptest application for testing.
Comment 3 Andrew Crouthamel 2018-09-25 21:41:01 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Andrew Crouthamel 2018-10-27 02:43:45 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!