libfreerdp-core: fix NLA

This commit is contained in:
Marc-André Moreau 2012-12-13 16:29:16 -05:00
parent 3e7824f393
commit 72110807b1
3 changed files with 53 additions and 3 deletions

View File

@ -382,6 +382,10 @@ void gcc_write_client_data_blocks(STREAM* s, rdpSettings* settings)
printf("Sending multi monitor information anyway (may break connectivity!)\n"); printf("Sending multi monitor information anyway (may break connectivity!)\n");
gcc_write_client_monitor_data(s, settings); gcc_write_client_monitor_data(s, settings);
} }
else
{
printf("Use /multimon:force to force sending multi monitor information\n");
}
} }
} }
} }

View File

@ -286,7 +286,7 @@ BOOL transport_accept_nla(rdpTransport* transport)
return TRUE; return TRUE;
} }
static int transport_read_layer(rdpTransport* transport, UINT8* data, int bytes) int transport_read_layer(rdpTransport* transport, UINT8* data, int bytes)
{ {
int status = -1; int status = -1;
@ -339,6 +339,12 @@ static int transport_read_layer(rdpTransport* transport, UINT8* data, int bytes)
#endif #endif
} }
#if 0
/**
* FIXME: this breaks NLA in certain cases only, why?
*/
int transport_read(rdpTransport* transport, STREAM* s) int transport_read(rdpTransport* transport, STREAM* s)
{ {
int status; int status;
@ -398,6 +404,43 @@ int transport_read(rdpTransport* transport, STREAM* s)
return transport_status; return transport_status;
} }
#else
int transport_read(rdpTransport* transport, STREAM* s)
{
int status = -1;
while (TRUE)
{
if (transport->layer == TRANSPORT_LAYER_TLS)
status = tls_read(transport->TlsIn, stream_get_tail(s), stream_get_left(s));
else if (transport->layer == TRANSPORT_LAYER_TCP)
status = tcp_read(transport->TcpIn, stream_get_tail(s), stream_get_left(s));
else if (transport->layer == TRANSPORT_LAYER_TSG)
status = tsg_read(transport->tsg, stream_get_tail(s), stream_get_left(s));
if ((status == 0) && (transport->blocking))
{
freerdp_usleep(transport->usleep_interval);
continue;
}
break;
}
#ifdef WITH_DEBUG_TRANSPORT
if (status > 0)
{
printf("Local < Remote\n");
freerdp_hexdump(s->data, status);
}
#endif
return status;
}
#endif
static int transport_read_nonblocking(rdpTransport* transport) static int transport_read_nonblocking(rdpTransport* transport)
{ {
int status; int status;

View File

@ -350,6 +350,9 @@ SECURITY_STATUS ntlm_read_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer buf
ZeroMemory(&message, sizeof(message)); ZeroMemory(&message, sizeof(message));
s = Stream_New(buffer->pvBuffer, buffer->cbBuffer); s = Stream_New(buffer->pvBuffer, buffer->cbBuffer);
printf("ChallengeMessage: length:%d\n", buffer->cbBuffer);
winpr_HexDump(buffer->pvBuffer, buffer->cbBuffer);
StartOffset = Stream_Pointer(s); StartOffset = Stream_Pointer(s);
ntlm_read_message_header(s, (NTLM_MESSAGE_HEADER*) &message); ntlm_read_message_header(s, (NTLM_MESSAGE_HEADER*) &message);
@ -937,8 +940,8 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer
message.LmChallengeResponse.Len = (UINT16) context->LmChallengeResponse.cbBuffer; message.LmChallengeResponse.Len = (UINT16) context->LmChallengeResponse.cbBuffer;
message.LmChallengeResponse.Buffer = (BYTE*) context->LmChallengeResponse.pvBuffer; message.LmChallengeResponse.Buffer = (BYTE*) context->LmChallengeResponse.pvBuffer;
if (context->NTLMv2) //if (context->NTLMv2)
ZeroMemory(message.LmChallengeResponse.Buffer, message.LmChallengeResponse.Len); // ZeroMemory(message.LmChallengeResponse.Buffer, message.LmChallengeResponse.Len);
message.NtChallengeResponse.Len = (UINT16) context->NtChallengeResponse.cbBuffer; message.NtChallengeResponse.Len = (UINT16) context->NtChallengeResponse.cbBuffer;
message.NtChallengeResponse.Buffer = (BYTE*) context->NtChallengeResponse.pvBuffer; message.NtChallengeResponse.Buffer = (BYTE*) context->NtChallengeResponse.pvBuffer;