19#ifndef FREERDP_CHANNEL_RDPEAR_COMMON_H
20#define FREERDP_CHANNEL_RDPEAR_COMMON_H
22#include <winpr/stream.h>
23#include <winpr/asn1.h>
24#include <winpr/wlog.h>
25#include <winpr/sspi.h>
28#include <freerdp/api.h>
33 RDPEAR_PACKAGE_KERBEROS,
35 RDPEAR_PACKAGE_UNKNOWN
42 RemoteCallKerbMinimum = 0x100,
43 RemoteCallKerbNegotiateVersion = RemoteCallKerbMinimum,
44 RemoteCallKerbBuildAsReqAuthenticator,
45 RemoteCallKerbVerifyServiceTicket,
46 RemoteCallKerbCreateApReqAuthenticator,
47 RemoteCallKerbDecryptApReply,
48 RemoteCallKerbUnpackKdcReplyBody,
49 RemoteCallKerbComputeTgsChecksum,
50 RemoteCallKerbBuildEncryptedAuthData,
51 RemoteCallKerbPackApReply,
52 RemoteCallKerbHashS4UPreauth,
53 RemoteCallKerbSignS4UPreauthData,
54 RemoteCallKerbVerifyChecksum,
55 RemoteCallKerbReserved1,
56 RemoteCallKerbReserved2,
57 RemoteCallKerbReserved3,
58 RemoteCallKerbReserved4,
59 RemoteCallKerbReserved5,
60 RemoteCallKerbReserved6,
61 RemoteCallKerbReserved7,
62 RemoteCallKerbDecryptPacCredentials,
63 RemoteCallKerbCreateECDHKeyAgreement,
64 RemoteCallKerbCreateDHKeyAgreement,
65 RemoteCallKerbDestroyKeyAgreement,
66 RemoteCallKerbKeyAgreementGenerateNonce,
67 RemoteCallKerbFinalizeKeyAgreement,
68 RemoteCallKerbMaximum = 0x1ff,
72 RemoteCallNtlmMinimum = 0x200,
73 RemoteCallNtlmNegotiateVersion = 0x200,
74 RemoteCallNtlmLm20GetNtlm3ChallengeResponse,
75 RemoteCallNtlmCalculateNtResponse,
76 RemoteCallNtlmCalculateUserSessionKeyNt,
77 RemoteCallNtlmCompareCredentials,
78 RemoteCallNtlmMaximum = 0x2ff,
82FREERDP_LOCAL RdpEarPackageType rdpear_packageType_from_name(
const WinPrAsn1_OctetString* package);
83FREERDP_LOCAL
wStream* rdpear_encodePayload(RdpEarPackageType packageType,
wStream* payload);
85#define RDPEAR_COMMON_MESSAGE_DECL(V) \
86 FREERDP_LOCAL BOOL ndr_decoder_read_##V(WinPrNdrDecoder* context, wStream* s, \
87 const void* hints, V* obj); \
88 FREERDP_LOCAL BOOL ndr_encoder_write_##V(WinPrNdrEncoder* context, wStream* s, \
89 const void* hints, const V* obj); \
90 FREERDP_LOCAL void ndr_destroy_##V(const void* hints, V* obj); \
91 FREERDP_LOCAL void ndr_dump_##V(wLog* logger, UINT32 lvl, size_t indentLevel, const V* obj); \
92 FREERDP_LOCAL WinPrNdrMessageType ndr_##V##_descr(void)
167 ULONG SequenceNumber;
170 PLARGE_INTEGER SkewTime;
184 LONG KerbProtocolError;
204 LONG KerbProtocolError;
235#undef RDPEAR_COMMON_MESSAGE_DECL
243 UINT32 NegotiateVersion;
264 UINT32 NegotiateVersion;
280#define RDPEAR_MSV1_0_CREDENTIAL_KEY_LENGTH 20
281#define RDPEAR_MSV1_0_CHALLENGE_LENGTH 8
282#define RDPEAR_MSV1_0_RESPONSE_LENGTH 24
283#define RDPEAR_MSV1_0_NTLM3_RESPONSE_LENGTH 16
284#define RDPEAR_MSV1_0_USER_SESSION_KEY_LENGTH 16
301 BYTE Data[RDPEAR_MSV1_0_CHALLENGE_LENGTH];
307 BYTE Data[RDPEAR_MSV1_0_RESPONSE_LENGTH];
313 BYTE Response[RDPEAR_MSV1_0_NTLM3_RESPONSE_LENGTH];
314 BYTE ChallengeFromClient[RDPEAR_MSV1_0_CHALLENGE_LENGTH];
320 BYTE Data[RDPEAR_MSV1_0_USER_SESSION_KEY_LENGTH];
330 BYTE ChallengeToClient[RDPEAR_MSV1_0_CHALLENGE_LENGTH];
367 BOOL AreShaOwfsEqual;
373 UINT32 NegotiateVersion;
389 UINT32 NegotiateVersion;
409FREERDP_LOCAL BOOL rdpear_kerb_input_read(WinPrNdrDecoder* decoder,
wStream* s,
412FREERDP_LOCAL BOOL rdpear_kerb_output_write(WinPrNdrEncoder* encoder,
wStream* s,
416FREERDP_LOCAL BOOL rdpear_ntlm_input_read(WinPrNdrDecoder* decoder,
wStream* s,
419FREERDP_LOCAL BOOL rdpear_ntlm_output_write(WinPrNdrEncoder* encoder,
wStream* s,
NDR encoder and decoder ([C706] chapter 14, [MS-RPCE] 2.2.5 and 2.2.6).
hints for a conformant array
hints for a conformant varying array
2.2.2.1.8 BuildEncryptedAuthData
2.2.2.2.3 CalculateNtResponse
2.2.2.2.4 CalculateUserSessionKeyNt
2.2.2.2.5 CompareCredentials
2.2.2.1.7 ComputeTgsChecksum
2.2.2.1.4 CreateApReqAuthenticator
2.2.2.1.4 CreateApReqAuthenticator
2.2.1.2.8 KERB_RPC_ENCRYPTION_KEY
2.2.1.2.3 KERB_RPC_INTERNAL_NAME
2.2.1.2.2 KERB_RPC_OCTET_STRING
KerbCredIsoRemoteOutputUnion Output
2.2.2.2.2 Lm20GetNtlm3ChallengeResponse
2.2.1.3.3 MSV1_0_LM3_RESPONSE
2.2.1.3.6 MSV1_0_REMOTE_ENCRYPTED_SECRETS, opaque for the CredSSP server
BYTE reserved5[RDPEAR_MSV1_0_CREDENTIAL_KEY_LENGTH]
2.2.1.3.1 NT_CHALLENGE, also LM_SESSION_KEY
NtlmCredIsoRemoteOutputUnion Output
2.3.10 RPC_UNICODE_STRING (MS-DTYP)
2.2.1.3.4 USER_SESSION_KEY
2.2.2.1.6 UnpackKdcReplyBody
2.2.2.1.6 UnpackKdcReplyBody
2.2.1.2.10 KerbCredIsoRemoteOutput
CreateApReqAuthenticatorResp CreateApReqAuthenticator
UnpackKdcReplyBodyResp UnpackKdcReplyBody
KERB_ASN1_DATA BuildEncryptedAuthData
PackApReplyResp PackApReply
2.2.1.3.8 NtlmCredIsoRemoteOutput
USER_SESSION_KEY CalculateUserSessionKeyNt
CompareCredentialsResp CompareCredentials
Lm20GetNtlm3ChallengeResponseResp Lm20GetNtlm3ChallengeResponse