int credssp_skip_ts_credentials(rdpCredssp* credssp) { int length; int ts_password_creds_length; int ts_credentials_length = 0; length = ber_skip_integer(0); length += ber_skip_contextual_tag(length); ts_credentials_length += length; ts_password_creds_length = credssp_skip_ts_password_creds(credssp); length = ber_skip_octet_string(ts_password_creds_length); length += ber_skip_contextual_tag(length); ts_credentials_length += length; length = ber_skip_sequence(ts_credentials_length); return length; }
void credssp_write_ts_password_creds(rdpCredssp* credssp, STREAM* s) { int length; length = credssp_skip_ts_password_creds(credssp); /* TSPasswordCreds (SEQUENCE) */ length = ber_get_content_length(length); ber_write_sequence_tag(s, length); /* [0] domainName (OCTET STRING) */ ber_write_contextual_tag(s, 0, credssp->identity.DomainLength + 2, true); ber_write_octet_string(s, (uint8*) credssp->identity.Domain, credssp->identity.DomainLength); /* [1] userName (OCTET STRING) */ ber_write_contextual_tag(s, 1, credssp->identity.UserLength + 2, true); ber_write_octet_string(s, (uint8*) credssp->identity.User, credssp->identity.UserLength); /* [2] password (OCTET STRING) */ ber_write_contextual_tag(s, 2, credssp->identity.PasswordLength + 2, true); ber_write_octet_string(s, (uint8*) credssp->identity.Password, credssp->identity.PasswordLength); }
void credssp_write_ts_password_creds(rdpCredssp* credssp, STREAM* s) { int length; length = credssp_skip_ts_password_creds(credssp); /* TSPasswordCreds (SEQUENCE) */ length = ber_get_content_length(length); ber_write_sequence_tag(s, length); /* [0] domainName (OCTET STRING) */ ber_write_contextual_tag(s, 0, credssp->ntlmssp->domain.length + 2, True); ber_write_octet_string(s, credssp->ntlmssp->domain.data, credssp->ntlmssp->domain.length); /* [1] userName (OCTET STRING) */ ber_write_contextual_tag(s, 1, credssp->ntlmssp->username.length + 2, True); ber_write_octet_string(s, credssp->ntlmssp->username.data, credssp->ntlmssp->username.length); /* [2] password (OCTET STRING) */ ber_write_contextual_tag(s, 2, credssp->ntlmssp->password.length + 2, True); ber_write_octet_string(s, credssp->ntlmssp->password.data, credssp->ntlmssp->password.length); }
void credssp_write_ts_credentials(rdpCredssp* credssp, STREAM* s) { int length; int ts_password_creds_length; length = credssp_skip_ts_credentials(credssp); ts_password_creds_length = credssp_skip_ts_password_creds(credssp); /* TSCredentials (SEQUENCE) */ length = ber_get_content_length(length); length -= ber_write_sequence_tag(s, length); /* [0] credType (INTEGER) */ length -= ber_write_contextual_tag(s, 0, 3, true); length -= ber_write_integer(s, 1); /* [1] credentials (OCTET STRING) */ length -= 1; length -= ber_write_contextual_tag(s, 1, length, true); length -= ber_write_octet_string_tag(s, ts_password_creds_length); credssp_write_ts_password_creds(credssp, s); }