http://bugs.winehq.org/show_bug.cgi?id=24593
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Status|UNCONFIRMED |NEW URL| |http://www.livestream.com/p | |latform/procaster CC| |focht@gmx.net Summary|Livestream Procaster: |Livestream Procaster: login |Procaster can't get past |fails |the login screen without | |wininet override | Ever confirmed|0 |1
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello folks,
confirming still present.
Prerequisite taken from appdb entry recipe:
--- snip --- $ wget http://download.microsoft.com/download/E/E/1/EE17FF74-6C45-4575-9CF4-7FC2597... $ cabextract directx_feb2010_redist.exe dxnt.cab $ cabextract dxnt.cab -F ksuser.dll $ cabextract dxnt.cab -F ksproxy.ax $ mv ksuser.dll ksproxy.ax $WINEPREFIX/drive_c/windows/system32/ --- snip ---
App log file 'qt.log' doesn't show much:
--- snip --- ... INFO - 05.25.2014 20:53:48.956 Show WAITING_WINDOW INFO - 05.25.2014 20:53:48.963 execCommand(ShowWindowsCmd) to "UICommander" leave (thread: 35 1) INFO - 05.25.2014 20:53:48.971 execCommand(ShowInitializingProgressCmd) to "MainDialogCommander" enter (thread: 35 1) INFO - 05.25.2014 20:53:48.988 execCommand(ShowInitializingProgressCmd) to "MainDialogCommander" leave (thread: 35 1) INFO - 05.25.2014 20:53:48.992 LoginCommander: try to connect to server INFO - 05.25.2014 20:53:49.366 LoginCommander: user <blah> is not authorized --- snip ---
The app communicates to server via _unencrypted_ XML/SOAP *sigh* I captured the communication with Wireshark.
The first request is the same for both (builtin vs. native wininet) -> '401 Unauthorized' error is expected.
--- snip --- GET / HTTP/1.1 Accept: */* Host: channelguide.api.livestream.com User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Connection: Keep-Alive
HTTP/1.1 401 Unauthorized Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Wed, 31 Dec 1969 19:00:00 EST WWW-Authenticate: Basic realm="Axis Monitor Application" Content-Type: text/html;charset=utf-8 Content-Length: 954 Date: Sun, 25 May 2014 19:03:44 GMT
<html><head><title>Apache Tomcat/6.0.10 - Error report</title><style>... <h1>HTTP Status 401 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This request requires HTTP authentication ().</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.10</h3></body></html> --- snip ---
The follow-up request is the culprit here.
Builtin:
--- snip --- POST /axis2/services/authservice.authserviceHttpSoap11Endpoint HTTP/1.1 Referer: channelguide.api.livestream.com/axis2/services/authservice.authserviceHttpSoap11Endpoint Accept: */* Host: channelguide.api.livestream.com Content-Type: text/xml; charset="utf-8" SOAPAction: "urn:authenticateUser" Content-Length: 0 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Cache-Control: no-cache
<soap envelope with username and password contained>
HTTP/1.1 500 Internal Server Error Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Sun, 25 May 2014 19:03:44 GMT Connection: close
... HTTP/1.1 500 Internal Server Error Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Sun, 25 May 2014 19:03:44 GMT Connection: close
1f8
<?xml version='1.0' encoding='utf-8'?>soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"wsa:Actionhttp://www.w3.org/2005/08/addressing/soap/fault</wsa:Action></soapenv:Header>soapenv:Bodysoapenv:Fault<faultcode></faultcode><faultstring>com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0]</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope> --- snip ---
Native:
--- snip --- POST /axis2/services/authservice.authserviceHttpSoap11Endpoint HTTP/1.0 Referer: channelguide.api.livestream.com/axis2/services/authservice.authserviceHttpSoap11Endpoint Accept: */* Content-Type: text/xml; charset="utf-8" Content-Length: 501 SOAPAction: "urn:authenticateUser" User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Host: channelguide.api.livestream.com Pragma: no-cache
<soap envelope with username and password contained>
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Date: Sun, 25 May 2014 19:39:44 GMT Connection: close ... --- snip ---
The obvious one -> 'Content-Length: 0'. This doesn't make sense if a SOAP envelope follows.
Trace log reveals:
--- snip --- ... 0023:trace:wininet:HttpOpenRequestW (0x2, L"POST", L"/axis2/services/authservice.authserviceHttpSoap11Endpoint", (null), L"channelguide.api.livestream.com/axis2/services/authservice.authserviceHttpSoap11Endpoint", 0xf5be170, 04000000, 00000000) 0023:trace:wininet:HttpOpenRequestW accept type: L"*/*" ... 0023:Call wininet.HttpAddRequestHeadersW(00000004,059acd40 L"Content-Type: text/xml; charset="utf-8"\r\n",00000029,10000000) ret=005e9523 ... 0023:Call wininet.HttpAddRequestHeadersW(00000004,059acc88 L"Content-Length: 501\r\n",00000015,10000000) ret=005e95fa ... 0023:Call wininet.HttpAddRequestHeadersW(00000004,0150a690 L"SOAPAction: "urn:authenticateUser"\r\n",00000024,10000000) ret=005e96cb ... 0023:Call wininet.HttpSendRequestExW(00000004,0033afc8,00000000,00000008,00000000) ret=005e97b7 0023:trace:wininet:HttpSendRequestExW (0x4, 0x33afc8, (nil), 00000008, 00000000) 0023:trace:wininet:WININET_AddRef 0xf5ce930 -> refcount = 2 0023:trace:wininet:get_handle_object handle 4 -> 0xf5ce930 0023:trace:wininet:HTTP_HttpSendRequestW --> 0xf5ce930 0023:trace:wininet:HTTP_HttpAddRequestHeadersW copying header: L"Content-Length: 0\r\n" ... 0023:trace:wininet:HTTP_HttpAddRequestHeadersW interpreting header L"Content-Length: 0" ... 0023:trace:wininet:HTTP_InterpretHttpHeader field(L"Content-Length") Value(L"0") 0023:trace:wininet:HTTP_ProcessHeader --> L"Content-Length": L"0" - 0x82000000 0023:trace:wininet:HTTP_GetCustomHeaderIndex L"Content-Length", 0, 33554432 0023:trace:wininet:HTTP_GetCustomHeaderIndex Return: 4 ... 0023:trace:wininet:HTTP_InsertCustomHeader --> L"Content-Length": L"0" --- snip ---
The app passes an empty 'INTERNET_BUFFERS' structure (only size field set) with 'HttpSendRequestExHttpSendRequestExW'.
--- snip --- Wine-dbg>bt Backtrace: =>0 0x7df9edcd HttpSendRequestExW+0x28b(hRequest=0x7, lpBuffersIn=0x33afc8, lpBuffersOut=(nil), dwFlags=0x8, dwContext=0) [/home/focht/projects/wine/wine.repo/src/dlls/wininet/http.c:5493] in wininet (0x0033af98) 1 0x005e97b7 in procaster (+0x1e97b6) (0x0033b040) 2 0x0036006e in ssleay32 (+0x6d) (0x07230000) 3 0xf1000000 (0xf1000000)
Wine-dbg>p *lpBuffersIn {dwStructSize=0x28, Next=(nil), lpcszHeader=0x0(nil), dwHeadersLength=0, dwHeadersTotal=0, lpvBuffer=0x0(nil), dwBufferLength=0, dwBufferTotal=0, dwOffsetLow=0, dwOffsetHigh=0} ...
Wine-dbg>p *request {hdr={htype=WH_HHTTPREQ, vtbl=0x7dfd1740, hInternet=0x7, valid_handle=0x1, dwFlags=0x4000000, dwContext=0, dwError=0, ErrorMask=0, dwInternalFlags=0, refs=0x2, lpfnStatusCB=(nil), entry={next=0x188934, prev=0x188934}, children={next=0x871bb04, prev=0x871bb04}}, session=0x188900, server=0x1f4da0, proxy=(nil), path="/axis2/services/authservice.authserviceHttpSoap11Endpoint", verb="POST" --- snip ---
I came to this place ...
Source: http://source.winehq.org/git/wine.git/blob/5b56624a1bc6d4ff7768f15700ef3ef00...
--- snip --- 4831 static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, 4832 DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength, 4833 DWORD dwContentLength, BOOL bEndRequest) 4834 { ... 4847 /* if the verb is NULL default to GET */ 4848 if (!request->verb) 4849 request->verb = heap_strdupW(szGET); 4850 4851 if (dwContentLength || strcmpW(request->verb, szGET)) 4852 { 4853 sprintfW(contentLengthStr, szContentLength, dwContentLength); 4854 HTTP_HttpAddRequestHeadersW(request, contentLengthStr, -1L, HTTP_ADDREQ_FLAG_REPLACE); 4855 request->bytesToWrite = dwContentLength; 4856 } ... --- snip ---
Line 4851, second condition is incorrect.
This throws away the previous valid content-length header, added by application.
I tested a small fix and it lets the client successfully authenticate - no more native wininet needed :)
$ sha1sum LivestreamProcaster.exe 66c3c10fa36955919c93b6b4f3edb5bf9bcfbb06 LivestreamProcaster.exe
$ du -sh LivestreamProcaster.exe 21M LivestreamProcaster.exe
$ wine --version wine-1.7.19-56-gee13e10
Regards