Fixed handling gateway authentication error

Handle NULL pdu
This commit is contained in:
Benoît LeBlanc 2013-12-18 12:59:53 -05:00
parent 5de7a4f082
commit 9245d364cc
3 changed files with 15 additions and 7 deletions

View File

@ -99,12 +99,7 @@ int rpc_ncacn_http_recv_in_channel_response(rdpRpc* rpc)
http_response = http_response_recv(rpc->TlsIn);
if (http_response->StatusCode == HTTP_STATUS_DENIED)
{
if (!connectErrorCode)
connectErrorCode = AUTHENTICATIONERROR;
}
else if (http_response->AuthParam)
if (http_response->AuthParam)
{
ntlm_token_data = NULL;
crypto_base64_decode((BYTE*) http_response->AuthParam, strlen(http_response->AuthParam),

View File

@ -22,6 +22,7 @@
#endif
#include <winpr/crt.h>
#include <winpr/winhttp.h>
#include "ncacn_http.h"
#include "rpc_client.h"
@ -147,11 +148,17 @@ BOOL rts_connect(rdpRpc* rpc)
http_response = http_response_recv(rpc->TlsOut);
if (http_response->StatusCode != 200)
if (http_response->StatusCode != HTTP_STATUS_OK)
{
fprintf(stderr, "rts_connect error! Status Code: %d\n", http_response->StatusCode);
http_response_print(http_response);
http_response_free(http_response);
if (!connectErrorCode && http_response->StatusCode == HTTP_STATUS_DENIED)
{
connectErrorCode = AUTHENTICATIONERROR;
}
return FALSE;
}

View File

@ -1367,6 +1367,9 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
pdu = rpc_recv_dequeue_pdu(rpc);
if (!pdu)
return FALSE;
call = rpc_client_call_find_by_id(rpc, pdu->CallId);
if (call->OpNum == TsProxyMakeTunnelCallOpnum)
@ -1409,6 +1412,9 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
#if 0
pdu = rpc_recv_dequeue_pdu(rpc);
if (!pdu)
return FALSE;
if (!TsProxySetupReceivePipeReadResponse(tsg, pdu))
{
fprintf(stderr, "TsProxySetupReceivePipe: error reading response\n");