diff --git a/libfreerdp-crypto/nla.c b/libfreerdp-crypto/nla.c index c6cc4fd6d..52a3fef88 100644 --- a/libfreerdp-crypto/nla.c +++ b/libfreerdp-crypto/nla.c @@ -1020,6 +1020,9 @@ void credssp_send(rdpCredssp* credssp) ber_write_octet_string(s, credssp->pubKeyAuth.pvBuffer, length); } + printf("Sending Token (%d)\n", stream_get_length(s)); + freerdp_hexdump(s->data, stream_get_length(s)); + tls_write(credssp->tls, s->data, stream_get_length(s)); stream_free(s); } @@ -1039,13 +1042,17 @@ int credssp_recv(rdpCredssp* credssp) s = stream_new(2048); status = tls_read(credssp->tls, s->data, stream_get_left(s)); + s->size = status; if (status < 0) { - stream_free(s) ; + stream_free(s); return -1; } + printf("Receiving Token (%d)\n", s->size); + freerdp_hexdump(s->data, s->size); + /* TSRequest */ ber_read_sequence_tag(s, &length); ber_read_contextual_tag(s, 0, &length, true); diff --git a/winpr/sspi/NTLM/ntlm.c b/winpr/sspi/NTLM/ntlm.c index 73a1f78ab..81eb0cc4c 100644 --- a/winpr/sspi/NTLM/ntlm.c +++ b/winpr/sspi/NTLM/ntlm.c @@ -62,8 +62,10 @@ NTLM_CONTEXT* ntlm_ContextNew() { context->ntlm_v2 = 0; context->NegotiateFlags = 0; + context->SendVersionInfo = 1; context->LmCompatibilityLevel = 3; context->state = NTLM_STATE_INITIAL; + context->SuppressExtendedProtection = 1; context->av_pairs = (AV_PAIRS*) malloc(sizeof(AV_PAIRS)); ZeroMemory(context->av_pairs, sizeof(AV_PAIRS)); } diff --git a/winpr/sspi/NTLM/ntlm.h b/winpr/sspi/NTLM/ntlm.h index 3515fd5b2..3288319f2 100644 --- a/winpr/sspi/NTLM/ntlm.h +++ b/winpr/sspi/NTLM/ntlm.h @@ -89,6 +89,7 @@ struct _NTLM_CONTEXT NTLM_STATE state; int SendSeqNum; int RecvSeqNum; + int SendVersionInfo; BOOL confidentiality; RC4_KEY SendRc4Seal; RC4_KEY RecvRc4Seal; @@ -101,6 +102,7 @@ struct _NTLM_CONTEXT UINT16* Workstation; UINT32 WorkstationLength; int LmCompatibilityLevel; + int SuppressExtendedProtection; SEC_WINNT_AUTH_IDENTITY identity; SecBuffer NegotiateMessage; SecBuffer ChallengeMessage; diff --git a/winpr/sspi/NTLM/ntlm_message.c b/winpr/sspi/NTLM/ntlm_message.c index 426f89dd0..dc9312007 100644 --- a/winpr/sspi/NTLM/ntlm_message.c +++ b/winpr/sspi/NTLM/ntlm_message.c @@ -118,11 +118,11 @@ static const char* const NTLM_NEGOTIATE_STRINGS[] = void ntlm_output_version(PStream s) { - /* The following version information was observed with Windows 7 */ + /* Version Info for Windows 7 SP1 */ StreamWrite_UINT8(s, WINDOWS_MAJOR_VERSION_6); /* ProductMajorVersion (1 byte) */ StreamWrite_UINT8(s, WINDOWS_MINOR_VERSION_1); /* ProductMinorVersion (1 byte) */ - StreamWrite_UINT16(s, 7600); /* ProductBuild (2 bytes) */ + StreamWrite_UINT16(s, 7601); /* ProductBuild (2 bytes) */ StreamZero(s, 3); /* Reserved (3 bytes) */ StreamWrite_UINT8(s, NTLMSSP_REVISION_W2K3); /* NTLMRevisionCurrent (1 byte) */ } @@ -263,6 +263,9 @@ SECURITY_STATUS ntlm_write_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer bu if (context->confidentiality) NegotiateFlags |= NTLMSSP_NEGOTIATE_SEAL; + if (context->SendVersionInfo) + NegotiateFlags |= NTLMSSP_NEGOTIATE_VERSION; + context->NegotiateFlags = NegotiateFlags; StreamWrite_UINT32(s, NegotiateFlags); /* NegotiateFlags (4 bytes) */