Fixed handling of optional TSPasswordCreds field.
This commit is contained in:
parent
59e2801848
commit
8479c824fd
@ -916,15 +916,31 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TSPasswordCreds (SEQUENCE) */
|
/* TSPasswordCreds (SEQUENCE)
|
||||||
if (!ber_read_sequence_tag(s, &length) ||
|
* Initialise to default values. */
|
||||||
|
nla->identity->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
|
||||||
|
|
||||||
|
nla->identity->UserLength = (UINT32) 0;
|
||||||
|
nla->identity->User = NULL;
|
||||||
|
|
||||||
|
nla->identity->DomainLength = (UINT32) 0;
|
||||||
|
nla->identity->Domain = NULL;
|
||||||
|
|
||||||
|
nla->identity->Password = NULL;
|
||||||
|
nla->identity->PasswordLength = (UINT32) 0;
|
||||||
|
|
||||||
|
/* The sequence is empty, return early,
|
||||||
|
* TSPasswordCreds (SEQUENCE) is optional. */
|
||||||
|
if (!ber_read_sequence_tag(s, &length))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
/* [0] domainName (OCTET STRING) */
|
/* [0] domainName (OCTET STRING) */
|
||||||
!ber_read_contextual_tag(s, 0, &length, TRUE) ||
|
if (!ber_read_contextual_tag(s, 0, &length, TRUE) ||
|
||||||
!ber_read_octet_string_tag(s, &length))
|
!ber_read_octet_string_tag(s, &length))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nla->identity->DomainLength = (UINT32) length;
|
nla->identity->DomainLength = (UINT32) length;
|
||||||
if (nla->identity->DomainLength > 0)
|
if (nla->identity->DomainLength > 0)
|
||||||
{
|
{
|
||||||
@ -935,8 +951,6 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s)
|
|||||||
Stream_Seek(s, nla->identity->DomainLength);
|
Stream_Seek(s, nla->identity->DomainLength);
|
||||||
nla->identity->DomainLength /= 2;
|
nla->identity->DomainLength /= 2;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
nla->identity->Domain = NULL;
|
|
||||||
|
|
||||||
/* [1] userName (OCTET STRING) */
|
/* [1] userName (OCTET STRING) */
|
||||||
if (!ber_read_contextual_tag(s, 1, &length, TRUE) ||
|
if (!ber_read_contextual_tag(s, 1, &length, TRUE) ||
|
||||||
@ -944,6 +958,7 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s)
|
|||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nla->identity->UserLength = (UINT32) length;
|
nla->identity->UserLength = (UINT32) length;
|
||||||
if (nla->identity->UserLength > 0)
|
if (nla->identity->UserLength > 0)
|
||||||
{
|
{
|
||||||
@ -954,8 +969,6 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s)
|
|||||||
Stream_Seek(s, nla->identity->UserLength);
|
Stream_Seek(s, nla->identity->UserLength);
|
||||||
nla->identity->UserLength /= 2;
|
nla->identity->UserLength /= 2;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
nla->identity->User = NULL;
|
|
||||||
|
|
||||||
/* [2] password (OCTET STRING) */
|
/* [2] password (OCTET STRING) */
|
||||||
if (!ber_read_contextual_tag(s, 2, &length, TRUE) ||
|
if (!ber_read_contextual_tag(s, 2, &length, TRUE) ||
|
||||||
@ -963,6 +976,7 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s)
|
|||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nla->identity->PasswordLength = (UINT32) length;
|
nla->identity->PasswordLength = (UINT32) length;
|
||||||
if (nla->identity->PasswordLength > 0)
|
if (nla->identity->PasswordLength > 0)
|
||||||
{
|
{
|
||||||
@ -973,10 +987,6 @@ BOOL nla_read_ts_password_creds(rdpNla* nla, wStream* s)
|
|||||||
Stream_Seek(s, nla->identity->PasswordLength);
|
Stream_Seek(s, nla->identity->PasswordLength);
|
||||||
nla->identity->PasswordLength /= 2;
|
nla->identity->PasswordLength /= 2;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
nla->identity->Password = NULL;
|
|
||||||
|
|
||||||
nla->identity->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user