diff options
Diffstat (limited to 'librpc/gen_ndr')
-rw-r--r-- | librpc/gen_ndr/ndr_ntlmssp.c | 2096 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_ntlmssp.h | 60 | ||||
-rw-r--r-- | librpc/gen_ndr/ntlmssp.h | 285 |
3 files changed, 2441 insertions, 0 deletions
diff --git a/librpc/gen_ndr/ndr_ntlmssp.c b/librpc/gen_ndr/ndr_ntlmssp.c new file mode 100644 index 0000000000..549b4dec6f --- /dev/null +++ b/librpc/gen_ndr/ndr_ntlmssp.c @@ -0,0 +1,2096 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "../librpc/gen_ndr/ndr_ntlmssp.h" + +static enum ndr_err_code ndr_push_ntlmssp_MessageType(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_MessageType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_MessageType(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_MessageType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_MessageType(struct ndr_print *ndr, const char *name, enum ntlmssp_MessageType r) +{ + const char *val = NULL; + + switch (r) { + case NtLmNegotiate: val = "NtLmNegotiate"; break; + case NtLmChallenge: val = "NtLmChallenge"; break; + case NtLmAuthenticate: val = "NtLmAuthenticate"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_NEGOTIATE(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_NEGOTIATE(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NEGOTIATE(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_UNICODE", NTLMSSP_NEGOTIATE_UNICODE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM", NTLMSSP_NEGOTIATE_OEM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_REQUEST_TARGET", NTLMSSP_REQUEST_TARGET, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_SIGN", NTLMSSP_NEGOTIATE_SIGN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_SEAL", NTLMSSP_NEGOTIATE_SEAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_DATAGRAM", NTLMSSP_NEGOTIATE_DATAGRAM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_LM_KEY", NTLMSSP_NEGOTIATE_LM_KEY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NETWARE", NTLMSSP_NEGOTIATE_NETWARE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NTLM", NTLMSSP_NEGOTIATE_NTLM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NT_ONLY", NTLMSSP_NEGOTIATE_NT_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_ANONYMOUS", NTLMSSP_ANONYMOUS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED", NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED", NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL", NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_ALWAYS_SIGN", NTLMSSP_NEGOTIATE_ALWAYS_SIGN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_DOMAIN", NTLMSSP_TARGET_TYPE_DOMAIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_SERVER", NTLMSSP_TARGET_TYPE_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_SHARE", NTLMSSP_TARGET_TYPE_SHARE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY", NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_IDENTIFY", NTLMSSP_NEGOTIATE_IDENTIFY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_REQUEST_NON_NT_SESSION_KEY", NTLMSSP_REQUEST_NON_NT_SESSION_KEY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_TARGET_INFO", NTLMSSP_NEGOTIATE_TARGET_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_VERSION", NTLMSSP_NEGOTIATE_VERSION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_128", NTLMSSP_NEGOTIATE_128, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_KEY_EXCH", NTLMSSP_NEGOTIATE_KEY_EXCH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_56", NTLMSSP_NEGOTIATE_56, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ntlmssp_WindowsMajorVersion(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_WindowsMajorVersion r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_WindowsMajorVersion(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_WindowsMajorVersion *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_WindowsMajorVersion(struct ndr_print *ndr, const char *name, enum ntlmssp_WindowsMajorVersion r) +{ + const char *val = NULL; + + switch (r) { + case NTLMSSP_WINDOWS_MAJOR_VERSION_5: val = "NTLMSSP_WINDOWS_MAJOR_VERSION_5"; break; + case NTLMSSP_WINDOWS_MAJOR_VERSION_6: val = "NTLMSSP_WINDOWS_MAJOR_VERSION_6"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_ntlmssp_WindowsMinorVersion(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_WindowsMinorVersion r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_WindowsMinorVersion(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_WindowsMinorVersion *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_WindowsMinorVersion(struct ndr_print *ndr, const char *name, enum ntlmssp_WindowsMinorVersion r) +{ + const char *val = NULL; + + switch (r) { + case NTLMSSP_WINDOWS_MINOR_VERSION_0: val = "NTLMSSP_WINDOWS_MINOR_VERSION_0"; break; + case NTLMSSP_WINDOWS_MINOR_VERSION_1: val = "NTLMSSP_WINDOWS_MINOR_VERSION_1"; break; + case NTLMSSP_WINDOWS_MINOR_VERSION_2: val = "NTLMSSP_WINDOWS_MINOR_VERSION_2"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_ntlmssp_NTLMRevisionCurrent(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_NTLMRevisionCurrent r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_NTLMRevisionCurrent(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_NTLMRevisionCurrent *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_NTLMRevisionCurrent(struct ndr_print *ndr, const char *name, enum ntlmssp_NTLMRevisionCurrent r) +{ + const char *val = NULL; + + switch (r) { + case NTLMSSP_REVISION_W2K3_RC1: val = "NTLMSSP_REVISION_W2K3_RC1"; break; + case NTLMSSP_REVISION_W2K3: val = "NTLMSSP_REVISION_W2K3"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_VERSION(struct ndr_push *ndr, int ndr_flags, const struct VERSION *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_ntlmssp_WindowsMajorVersion(ndr, NDR_SCALARS, r->ProductMajorVersion)); + NDR_CHECK(ndr_push_ntlmssp_WindowsMinorVersion(ndr, NDR_SCALARS, r->ProductMinorVersion)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ProductBuild)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Reserved, 3)); + NDR_CHECK(ndr_push_ntlmssp_NTLMRevisionCurrent(ndr, NDR_SCALARS, r->NTLMRevisionCurrent)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_VERSION(struct ndr_pull *ndr, int ndr_flags, struct VERSION *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_ntlmssp_WindowsMajorVersion(ndr, NDR_SCALARS, &r->ProductMajorVersion)); + NDR_CHECK(ndr_pull_ntlmssp_WindowsMinorVersion(ndr, NDR_SCALARS, &r->ProductMinorVersion)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ProductBuild)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Reserved, 3)); + NDR_CHECK(ndr_pull_ntlmssp_NTLMRevisionCurrent(ndr, NDR_SCALARS, &r->NTLMRevisionCurrent)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_VERSION(struct ndr_print *ndr, const char *name, const struct VERSION *r) +{ + ndr_print_struct(ndr, name, "VERSION"); + ndr->depth++; + ndr_print_ntlmssp_WindowsMajorVersion(ndr, "ProductMajorVersion", r->ProductMajorVersion); + ndr_print_ntlmssp_WindowsMinorVersion(ndr, "ProductMinorVersion", r->ProductMinorVersion); + ndr_print_uint16(ndr, "ProductBuild", r->ProductBuild); + ndr_print_array_uint8(ndr, "Reserved", r->Reserved, 3); + ndr_print_ntlmssp_NTLMRevisionCurrent(ndr, "NTLMRevisionCurrent", r->NTLMRevisionCurrent); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ntlmssp_Version(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_Version *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NTLMSSP_NEGOTIATE_VERSION: { + NDR_CHECK(ndr_push_VERSION(ndr, NDR_SCALARS, &r->version)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NTLMSSP_NEGOTIATE_VERSION: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_Version(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_Version *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case NTLMSSP_NEGOTIATE_VERSION: { + NDR_CHECK(ndr_pull_VERSION(ndr, NDR_SCALARS, &r->version)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case NTLMSSP_NEGOTIATE_VERSION: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_Version(struct ndr_print *ndr, const char *name, const union ntlmssp_Version *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "ntlmssp_Version"); + switch (level) { + case NTLMSSP_NEGOTIATE_VERSION: + ndr_print_VERSION(ndr, "version", &r->version); + break; + + default: + break; + + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_NEGOTIATE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct NEGOTIATE_MESSAGE *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr, NDR_SCALARS, NtLmNegotiate)); + NDR_CHECK(ndr_push_NEGOTIATE(ndr, NDR_SCALARS, r->NegotiateFlags)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->DomainName))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->DomainName))); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->DomainName)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->Workstation))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->Workstation))); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->Workstation)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)); + NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)); + if (r->DomainName) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->DomainName)); + { + struct ndr_push *_ndr_DomainName; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_DomainName, 0, strlen(r->DomainName))); + NDR_CHECK(ndr_push_string(_ndr_DomainName, NDR_SCALARS, r->DomainName)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_DomainName, 0, strlen(r->DomainName))); + } + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)); + if (r->Workstation) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->Workstation)); + { + struct ndr_push *_ndr_Workstation; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Workstation, 0, strlen(r->Workstation))); + NDR_CHECK(ndr_push_string(_ndr_Workstation, NDR_SCALARS, r->Workstation)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Workstation, 0, strlen(r->Workstation))); + } + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_NEGOTIATE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct NEGOTIATE_MESSAGE *r) +{ + uint32_t _ptr_DomainName; + TALLOC_CTX *_mem_save_DomainName_0; + uint32_t _ptr_Workstation; + TALLOC_CTX *_mem_save_Workstation_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->Signature, 8, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr, NDR_SCALARS, &r->MessageType)); + NDR_CHECK(ndr_pull_NEGOTIATE(ndr, NDR_SCALARS, &r->NegotiateFlags)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DomainNameLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DomainNameMaxLen)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DomainName)); + if (_ptr_DomainName) { + NDR_PULL_ALLOC(ndr, r->DomainName); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DomainName, _ptr_DomainName)); + } else { + r->DomainName = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WorkstationLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WorkstationMaxLen)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Workstation)); + if (_ptr_Workstation) { + NDR_PULL_ALLOC(ndr, r->Workstation); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->Workstation, _ptr_Workstation)); + } else { + r->Workstation = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)); + NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)); + if (r->DomainName) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DomainName)); + _mem_save_DomainName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->DomainName, 0); + { + struct ndr_pull *_ndr_DomainName; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_DomainName, 0, r->DomainNameLen)); + NDR_CHECK(ndr_pull_string(_ndr_DomainName, NDR_SCALARS, &r->DomainName)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_DomainName, 0, r->DomainNameLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DomainName_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM)); + if (r->Workstation) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->Workstation)); + _mem_save_Workstation_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->Workstation, 0); + { + struct ndr_pull *_ndr_Workstation; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Workstation, 0, r->WorkstationLen)); + NDR_CHECK(ndr_pull_string(_ndr_Workstation, NDR_SCALARS, &r->Workstation)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Workstation, 0, r->WorkstationLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Workstation_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NEGOTIATE_MESSAGE(struct ndr_print *ndr, const char *name, const struct NEGOTIATE_MESSAGE *r) +{ + ndr_print_struct(ndr, name, "NEGOTIATE_MESSAGE"); + ndr->depth++; + ndr_print_string(ndr, "Signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"NTLMSSP":r->Signature); + ndr_print_ntlmssp_MessageType(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NtLmNegotiate:r->MessageType); + ndr_print_NEGOTIATE(ndr, "NegotiateFlags", r->NegotiateFlags); + ndr_print_uint16(ndr, "DomainNameLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->DomainName):r->DomainNameLen); + ndr_print_uint16(ndr, "DomainNameMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->DomainNameLen:r->DomainNameMaxLen); + ndr_print_ptr(ndr, "DomainName", r->DomainName); + ndr->depth++; + if (r->DomainName) { + ndr_print_string(ndr, "DomainName", r->DomainName); + } + ndr->depth--; + ndr_print_uint16(ndr, "WorkstationLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->Workstation):r->WorkstationLen); + ndr_print_uint16(ndr, "WorkstationMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->WorkstationLen:r->WorkstationMaxLen); + ndr_print_ptr(ndr, "Workstation", r->Workstation); + ndr->depth++; + if (r->Workstation) { + ndr_print_string(ndr, "Workstation", r->Workstation); + } + ndr->depth--; + ndr_print_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION); + ndr_print_ntlmssp_Version(ndr, "Version", &r->Version); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ntlmssp_AvId(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_AvId r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_AvId(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_AvId *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_AvId(struct ndr_print *ndr, const char *name, enum ntlmssp_AvId r) +{ + const char *val = NULL; + + switch (r) { + case MsvAvEOL: val = "MsvAvEOL"; break; + case MsvAvNbComputerName: val = "MsvAvNbComputerName"; break; + case MsvAvNbDomainName: val = "MsvAvNbDomainName"; break; + case MsvAvDnsComputerName: val = "MsvAvDnsComputerName"; break; + case MsvAvDnsDomainName: val = "MsvAvDnsDomainName"; break; + case MsvAvDnsTreeName: val = "MsvAvDnsTreeName"; break; + case MsvAvFlags: val = "MsvAvFlags"; break; + case MsvAvTimestamp: val = "MsvAvTimestamp"; break; + case MsAvRestrictions: val = "MsAvRestrictions"; break; + case MsvAvTargetName: val = "MsvAvTargetName"; break; + case MsvChannelBindings: val = "MsvChannelBindings"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_Restriction_Encoding(struct ndr_push *ndr, int ndr_flags, const struct Restriction_Encoding *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->IntegrityLevel)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SubjectIntegrityLevel)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->MachineId, 32)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_Restriction_Encoding(struct ndr_pull *ndr, int ndr_flags, struct Restriction_Encoding *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Z4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->IntegrityLevel)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SubjectIntegrityLevel)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->MachineId, 32)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_Restriction_Encoding(struct ndr_print *ndr, const char *name, const struct Restriction_Encoding *r) +{ + ndr_print_struct(ndr, name, "Restriction_Encoding"); + ndr->depth++; + ndr_print_uint32(ndr, "Size", r->Size); + ndr_print_uint32(ndr, "Z4", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->Z4); + ndr_print_uint32(ndr, "IntegrityLevel", r->IntegrityLevel); + ndr_print_uint32(ndr, "SubjectIntegrityLevel", r->SubjectIntegrityLevel); + ndr_print_array_uint8(ndr, "MachineId", r->MachineId, 32); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ntlmssp_AvFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_AvFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_AvFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT", NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE", NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ntlmssp_AvValue(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_AvValue *r) +{ + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case MsvAvEOL: { + break; } + + case MsvAvNbComputerName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvNbComputerName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvNbDomainName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvNbDomainName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvDnsComputerName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvDnsComputerName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvDnsDomainName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvDnsDomainName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvDnsTreeName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvDnsTreeName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvFlags: { + NDR_CHECK(ndr_push_ntlmssp_AvFlags(ndr, NDR_SCALARS, r->AvFlags)); + break; } + + case MsvAvTimestamp: { + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->AvTimestamp)); + break; } + + case MsAvRestrictions: { + NDR_CHECK(ndr_push_Restriction_Encoding(ndr, NDR_SCALARS, &r->AvRestrictions)); + break; } + + case MsvAvTargetName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvTargetName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvChannelBindings: { + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ChannelBindings, 16)); + break; } + + default: { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->blob)); + ndr->flags = _flags_save_DATA_BLOB; + } + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case MsvAvEOL: + break; + + case MsvAvNbComputerName: + break; + + case MsvAvNbDomainName: + break; + + case MsvAvDnsComputerName: + break; + + case MsvAvDnsDomainName: + break; + + case MsvAvDnsTreeName: + break; + + case MsvAvFlags: + break; + + case MsvAvTimestamp: + break; + + case MsAvRestrictions: + break; + + case MsvAvTargetName: + break; + + case MsvChannelBindings: + break; + + default: + break; + + } + } + ndr->flags = _flags_save_UNION; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_AvValue(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_AvValue *r) +{ + int level; + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case MsvAvEOL: { + break; } + + case MsvAvNbComputerName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvNbComputerName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvNbDomainName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvNbDomainName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvDnsComputerName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvDnsComputerName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvDnsDomainName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvDnsDomainName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvDnsTreeName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvDnsTreeName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvAvFlags: { + NDR_CHECK(ndr_pull_ntlmssp_AvFlags(ndr, NDR_SCALARS, &r->AvFlags)); + break; } + + case MsvAvTimestamp: { + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->AvTimestamp)); + break; } + + case MsAvRestrictions: { + NDR_CHECK(ndr_pull_Restriction_Encoding(ndr, NDR_SCALARS, &r->AvRestrictions)); + break; } + + case MsvAvTargetName: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvTargetName)); + ndr->flags = _flags_save_string; + } + break; } + + case MsvChannelBindings: { + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ChannelBindings, 16)); + break; } + + default: { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->blob)); + ndr->flags = _flags_save_DATA_BLOB; + } + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case MsvAvEOL: + break; + + case MsvAvNbComputerName: + break; + + case MsvAvNbDomainName: + break; + + case MsvAvDnsComputerName: + break; + + case MsvAvDnsDomainName: + break; + + case MsvAvDnsTreeName: + break; + + case MsvAvFlags: + break; + + case MsvAvTimestamp: + break; + + case MsAvRestrictions: + break; + + case MsvAvTargetName: + break; + + case MsvChannelBindings: + break; + + default: + break; + + } + } + ndr->flags = _flags_save_UNION; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_AvValue(struct ndr_print *ndr, const char *name, const union ntlmssp_AvValue *r) +{ + int level; + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "ntlmssp_AvValue"); + switch (level) { + case MsvAvEOL: + break; + + case MsvAvNbComputerName: + ndr_print_string(ndr, "AvNbComputerName", r->AvNbComputerName); + break; + + case MsvAvNbDomainName: + ndr_print_string(ndr, "AvNbDomainName", r->AvNbDomainName); + break; + + case MsvAvDnsComputerName: + ndr_print_string(ndr, "AvDnsComputerName", r->AvDnsComputerName); + break; + + case MsvAvDnsDomainName: + ndr_print_string(ndr, "AvDnsDomainName", r->AvDnsDomainName); + break; + + case MsvAvDnsTreeName: + ndr_print_string(ndr, "AvDnsTreeName", r->AvDnsTreeName); + break; + + case MsvAvFlags: + ndr_print_ntlmssp_AvFlags(ndr, "AvFlags", r->AvFlags); + break; + + case MsvAvTimestamp: + ndr_print_NTTIME(ndr, "AvTimestamp", r->AvTimestamp); + break; + + case MsAvRestrictions: + ndr_print_Restriction_Encoding(ndr, "AvRestrictions", &r->AvRestrictions); + break; + + case MsvAvTargetName: + ndr_print_string(ndr, "AvTargetName", r->AvTargetName); + break; + + case MsvChannelBindings: + ndr_print_array_uint8(ndr, "ChannelBindings", r->ChannelBindings, 16); + break; + + default: + ndr_print_DATA_BLOB(ndr, "blob", r->blob); + break; + + } + ndr->flags = _flags_save_UNION; + } +} + +static size_t ndr_size_ntlmssp_AvValue(const union ntlmssp_AvValue *r, uint32_t level, struct smb_iconv_convenience *ic, int flags) +{ + flags |= LIBNDR_FLAG_NOALIGN; + return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_ntlmssp_AvValue, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_AV_PAIR(struct ndr_push *ndr, int ndr_flags, const struct AV_PAIR *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_ntlmssp_AvId(ndr, NDR_SCALARS, r->AvId)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, ndr->iconv_convenience, 0))); + { + struct ndr_push *_ndr_Value; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Value, 0, ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, ndr->iconv_convenience, 0))); + NDR_CHECK(ndr_push_set_switch_value(_ndr_Value, &r->Value, r->AvId)); + NDR_CHECK(ndr_push_ntlmssp_AvValue(_ndr_Value, NDR_SCALARS|NDR_BUFFERS, &r->Value)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Value, 0, ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, ndr->iconv_convenience, 0))); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_AV_PAIR(struct ndr_pull *ndr, int ndr_flags, struct AV_PAIR *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_ntlmssp_AvId(ndr, NDR_SCALARS, &r->AvId)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->AvLen)); + { + struct ndr_pull *_ndr_Value; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Value, 0, r->AvLen)); + NDR_CHECK(ndr_pull_set_switch_value(_ndr_Value, &r->Value, r->AvId)); + NDR_CHECK(ndr_pull_ntlmssp_AvValue(_ndr_Value, NDR_SCALARS|NDR_BUFFERS, &r->Value)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Value, 0, r->AvLen)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_AV_PAIR(struct ndr_print *ndr, const char *name, const struct AV_PAIR *r) +{ + ndr_print_struct(ndr, name, "AV_PAIR"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_ntlmssp_AvId(ndr, "AvId", r->AvId); + ndr_print_uint16(ndr, "AvLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, ndr->iconv_convenience, 0):r->AvLen); + ndr_print_set_switch_value(ndr, &r->Value, r->AvId); + ndr_print_ntlmssp_AvValue(ndr, "Value", &r->Value); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ void ndr_print_AV_PAIR_LIST(struct ndr_print *ndr, const char *name, const struct AV_PAIR_LIST *r) +{ + uint32_t cntr_pair_0; + ndr_print_struct(ndr, name, "AV_PAIR_LIST"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr->print(ndr, "%s: ARRAY(%d)", "pair", (int)r->count); + ndr->depth++; + for (cntr_pair_0=0;cntr_pair_0<r->count;cntr_pair_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_pair_0) != -1) { + ndr_print_AV_PAIR(ndr, "pair", &r->pair[cntr_pair_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static size_t ndr_size_AV_PAIR_LIST(const struct AV_PAIR_LIST *r, struct smb_iconv_convenience *ic, int flags) +{ + flags |= LIBNDR_FLAG_NOALIGN; + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_AV_PAIR_LIST, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_CHALLENGE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct CHALLENGE_MESSAGE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr, NDR_SCALARS, NtLmChallenge)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName))); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->TargetName)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_NEGOTIATE(ndr, NDR_SCALARS, r->NegotiateFlags)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ServerChallenge, 8)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Reserved, 8)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->iconv_convenience, ndr->flags))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->iconv_convenience, ndr->flags))); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->TargetInfo)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)); + NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + if (r->TargetName) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->TargetName)); + { + struct ndr_push *_ndr_TargetName; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_TargetName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName))); + NDR_CHECK(ndr_push_string(_ndr_TargetName, NDR_SCALARS, r->TargetName)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_TargetName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName))); + } + } + ndr->flags = _flags_save_string; + } + if (r->TargetInfo) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->TargetInfo)); + { + struct ndr_push *_ndr_TargetInfo; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_TargetInfo, 0, ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->iconv_convenience, ndr->flags))); + NDR_CHECK(ndr_push_AV_PAIR_LIST(_ndr_TargetInfo, NDR_SCALARS|NDR_BUFFERS, r->TargetInfo)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_TargetInfo, 0, ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->iconv_convenience, ndr->flags))); + } + } + NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_CHALLENGE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct CHALLENGE_MESSAGE *r) +{ + uint32_t _ptr_TargetName; + TALLOC_CTX *_mem_save_TargetName_0; + uint32_t _ptr_TargetInfo; + TALLOC_CTX *_mem_save_TargetInfo_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->Signature, 8, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr, NDR_SCALARS, &r->MessageType)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->TargetNameLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->TargetNameMaxLen)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TargetName)); + if (_ptr_TargetName) { + NDR_PULL_ALLOC(ndr, r->TargetName); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->TargetName, _ptr_TargetName)); + } else { + r->TargetName = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_NEGOTIATE(ndr, NDR_SCALARS, &r->NegotiateFlags)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ServerChallenge, 8)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Reserved, 8)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->TargetInfoLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->TargetNameInfoMaxLen)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TargetInfo)); + if (_ptr_TargetInfo) { + NDR_PULL_ALLOC(ndr, r->TargetInfo); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->TargetInfo, _ptr_TargetInfo)); + } else { + r->TargetInfo = NULL; + } + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)); + NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + if (r->TargetName) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->TargetName)); + _mem_save_TargetName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->TargetName, 0); + { + struct ndr_pull *_ndr_TargetName; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_TargetName, 0, r->TargetNameLen)); + NDR_CHECK(ndr_pull_string(_ndr_TargetName, NDR_SCALARS, &r->TargetName)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_TargetName, 0, r->TargetNameLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TargetName_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->TargetInfo) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->TargetInfo)); + _mem_save_TargetInfo_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->TargetInfo, 0); + { + struct ndr_pull *_ndr_TargetInfo; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_TargetInfo, 0, r->TargetInfoLen)); + NDR_CHECK(ndr_pull_AV_PAIR_LIST(_ndr_TargetInfo, NDR_SCALARS|NDR_BUFFERS, r->TargetInfo)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_TargetInfo, 0, r->TargetInfoLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TargetInfo_0, 0); + ndr->offset = _relative_save_offset; + } + NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_CHALLENGE_MESSAGE(struct ndr_print *ndr, const char *name, const struct CHALLENGE_MESSAGE *r) +{ + ndr_print_struct(ndr, name, "CHALLENGE_MESSAGE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_string(ndr, "Signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"NTLMSSP":r->Signature); + ndr_print_ntlmssp_MessageType(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NtLmChallenge:r->MessageType); + ndr_print_uint16(ndr, "TargetNameLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName):r->TargetNameLen); + ndr_print_uint16(ndr, "TargetNameMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->TargetNameLen:r->TargetNameMaxLen); + ndr_print_ptr(ndr, "TargetName", r->TargetName); + ndr->depth++; + if (r->TargetName) { + ndr_print_string(ndr, "TargetName", r->TargetName); + } + ndr->depth--; + ndr_print_NEGOTIATE(ndr, "NegotiateFlags", r->NegotiateFlags); + ndr_print_array_uint8(ndr, "ServerChallenge", r->ServerChallenge, 8); + ndr_print_array_uint8(ndr, "Reserved", r->Reserved, 8); + ndr_print_uint16(ndr, "TargetInfoLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->iconv_convenience, ndr->flags):r->TargetInfoLen); + ndr_print_uint16(ndr, "TargetNameInfoMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->TargetInfoLen:r->TargetNameInfoMaxLen); + ndr_print_ptr(ndr, "TargetInfo", r->TargetInfo); + ndr->depth++; + if (r->TargetInfo) { + ndr_print_AV_PAIR_LIST(ndr, "TargetInfo", r->TargetInfo); + } + ndr->depth--; + ndr_print_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION); + ndr_print_ntlmssp_Version(ndr, "Version", &r->Version); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_LM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct LM_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Response, 24)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_LM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct LM_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Response, 24)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_LM_RESPONSE(struct ndr_print *ndr, const char *name, const struct LM_RESPONSE *r) +{ + ndr_print_struct(ndr, name, "LM_RESPONSE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "Response", r->Response, 24); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_LMv2_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct LMv2_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Response, 16)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ChallengeFromClient, 8)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_LMv2_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct LMv2_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Response, 16)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ChallengeFromClient, 8)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_LMv2_RESPONSE(struct ndr_print *ndr, const char *name, const struct LMv2_RESPONSE *r) +{ + ndr_print_struct(ndr, name, "LMv2_RESPONSE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "Response", r->Response, 16); + ndr_print_array_uint8(ndr, "ChallengeFromClient", r->ChallengeFromClient, 8); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_ntlmssp_LM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_LM_RESPONSE *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 24: { + NDR_CHECK(ndr_push_LM_RESPONSE(ndr, NDR_SCALARS, &r->v1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 24: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ntlmssp_LM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_LM_RESPONSE *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 24: { + NDR_CHECK(ndr_pull_LM_RESPONSE(ndr, NDR_SCALARS, &r->v1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 24: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_LM_RESPONSE(struct ndr_print *ndr, const char *name, const union ntlmssp_LM_RESPONSE *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "ntlmssp_LM_RESPONSE"); + switch (level) { + case 24: + ndr_print_LM_RESPONSE(ndr, "v1", &r->v1); + break; + + default: + break; + + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_NTLM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NTLM_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Response, 24)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_NTLM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NTLM_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Response, 24)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NTLM_RESPONSE(struct ndr_print *ndr, const char *name, const struct NTLM_RESPONSE *r) +{ + ndr_print_struct(ndr, name, "NTLM_RESPONSE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "Response", r->Response, 24); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_NTLMv2_CLIENT_CHALLENGE(struct ndr_push *ndr, int ndr_flags, const struct NTLMv2_CLIENT_CHALLENGE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 1)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 1)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Reserved1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Reserved2)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->TimeStamp)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ChallengeFromClient, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Reserved3)); + { + uint32_t _flags_save_AV_PAIR_LIST = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + { + struct ndr_push *_ndr_AvPairs; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_AvPairs, 0, -1)); + NDR_CHECK(ndr_push_AV_PAIR_LIST(_ndr_AvPairs, NDR_SCALARS|NDR_BUFFERS, &r->AvPairs)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_AvPairs, 0, -1)); + } + ndr->flags = _flags_save_AV_PAIR_LIST; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_AV_PAIR_LIST = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + ndr->flags = _flags_save_AV_PAIR_LIST; + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_NTLMv2_CLIENT_CHALLENGE(struct ndr_pull *ndr, int ndr_flags, struct NTLMv2_CLIENT_CHALLENGE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->RespType)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->HiRespType)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Reserved1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Reserved2)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->TimeStamp)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ChallengeFromClient, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Reserved3)); + { + uint32_t _flags_save_AV_PAIR_LIST = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + { + struct ndr_pull *_ndr_AvPairs; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_AvPairs, 0, -1)); + NDR_CHECK(ndr_pull_AV_PAIR_LIST(_ndr_AvPairs, NDR_SCALARS|NDR_BUFFERS, &r->AvPairs)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_AvPairs, 0, -1)); + } + ndr->flags = _flags_save_AV_PAIR_LIST; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_AV_PAIR_LIST = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + ndr->flags = _flags_save_AV_PAIR_LIST; + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NTLMv2_CLIENT_CHALLENGE(struct ndr_print *ndr, const char *name, const struct NTLMv2_CLIENT_CHALLENGE *r) +{ + ndr_print_struct(ndr, name, "NTLMv2_CLIENT_CHALLENGE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint8(ndr, "RespType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->RespType); + ndr_print_uint8(ndr, "HiRespType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->HiRespType); + ndr_print_uint16(ndr, "Reserved1", r->Reserved1); + ndr_print_uint32(ndr, "Reserved2", r->Reserved2); + ndr_print_NTTIME(ndr, "TimeStamp", r->TimeStamp); + ndr_print_array_uint8(ndr, "ChallengeFromClient", r->ChallengeFromClient, 8); + ndr_print_uint32(ndr, "Reserved3", r->Reserved3); + ndr_print_AV_PAIR_LIST(ndr, "AvPairs", &r->AvPairs); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_NTLMv2_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NTLMv2_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Response, 16)); + NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_SCALARS, &r->Challenge)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_BUFFERS, &r->Challenge)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_NTLMv2_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NTLMv2_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Response, 16)); + NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_SCALARS, &r->Challenge)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_BUFFERS, &r->Challenge)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NTLMv2_RESPONSE(struct ndr_print *ndr, const char *name, const struct NTLMv2_RESPONSE *r) +{ + ndr_print_struct(ndr, name, "NTLMv2_RESPONSE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "Response", r->Response, 16); + ndr_print_NTLMv2_CLIENT_CHALLENGE(ndr, "Challenge", &r->Challenge); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_ntlmssp_NTLM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_NTLM_RESPONSE *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: { + break; } + + case 0x18: { + NDR_CHECK(ndr_push_NTLM_RESPONSE(ndr, NDR_SCALARS, &r->v1)); + break; } + + default: { + NDR_CHECK(ndr_push_NTLMv2_RESPONSE(ndr, NDR_SCALARS, &r->v2)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + break; + + case 0x18: + break; + + default: + NDR_CHECK(ndr_push_NTLMv2_RESPONSE(ndr, NDR_BUFFERS, &r->v2)); + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_ntlmssp_NTLM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_NTLM_RESPONSE *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 0: { + break; } + + case 0x18: { + NDR_CHECK(ndr_pull_NTLM_RESPONSE(ndr, NDR_SCALARS, &r->v1)); + break; } + + default: { + NDR_CHECK(ndr_pull_NTLMv2_RESPONSE(ndr, NDR_SCALARS, &r->v2)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + break; + + case 0x18: + break; + + default: + NDR_CHECK(ndr_pull_NTLMv2_RESPONSE(ndr, NDR_BUFFERS, &r->v2)); + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ntlmssp_NTLM_RESPONSE(struct ndr_print *ndr, const char *name, const union ntlmssp_NTLM_RESPONSE *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "ntlmssp_NTLM_RESPONSE"); + switch (level) { + case 0: + break; + + case 0x18: + ndr_print_NTLM_RESPONSE(ndr, "v1", &r->v1); + break; + + default: + ndr_print_NTLMv2_RESPONSE(ndr, "v2", &r->v2); + break; + + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_AUTHENTICATE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct AUTHENTICATE_MESSAGE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr, NDR_SCALARS, NtLmAuthenticate)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->LmChallengeResponseLen)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->LmChallengeResponseLen)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->LmChallengeResponse)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->NtChallengeResponseLen)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->NtChallengeResponseLen)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->NtChallengeResponse)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName))); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->DomainName)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName))); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->UserName)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation))); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->Workstation)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->EncryptedRandomSessionKey->length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->EncryptedRandomSessionKey->length)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->EncryptedRandomSessionKey)); + NDR_CHECK(ndr_push_NEGOTIATE(ndr, NDR_SCALARS, r->NegotiateFlags)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)); + NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->LmChallengeResponse) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->LmChallengeResponse)); + { + struct ndr_push *_ndr_LmChallengeResponse; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_LmChallengeResponse, 0, r->LmChallengeResponseLen)); + NDR_CHECK(ndr_push_set_switch_value(_ndr_LmChallengeResponse, r->LmChallengeResponse, r->LmChallengeResponseLen)); + NDR_CHECK(ndr_push_ntlmssp_LM_RESPONSE(_ndr_LmChallengeResponse, NDR_SCALARS|NDR_BUFFERS, r->LmChallengeResponse)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_LmChallengeResponse, 0, r->LmChallengeResponseLen)); + } + } + if (r->NtChallengeResponse) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->NtChallengeResponse)); + { + struct ndr_push *_ndr_NtChallengeResponse; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_NtChallengeResponse, 0, r->NtChallengeResponseLen)); + NDR_CHECK(ndr_push_set_switch_value(_ndr_NtChallengeResponse, r->NtChallengeResponse, r->NtChallengeResponseLen)); + NDR_CHECK(ndr_push_ntlmssp_NTLM_RESPONSE(_ndr_NtChallengeResponse, NDR_SCALARS|NDR_BUFFERS, r->NtChallengeResponse)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_NtChallengeResponse, 0, r->NtChallengeResponseLen)); + } + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + if (r->DomainName) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->DomainName)); + { + struct ndr_push *_ndr_DomainName; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_DomainName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName))); + NDR_CHECK(ndr_push_string(_ndr_DomainName, NDR_SCALARS, r->DomainName)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_DomainName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName))); + } + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + if (r->UserName) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->UserName)); + { + struct ndr_push *_ndr_UserName; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_UserName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName))); + NDR_CHECK(ndr_push_string(_ndr_UserName, NDR_SCALARS, r->UserName)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_UserName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName))); + } + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + if (r->Workstation) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->Workstation)); + { + struct ndr_push *_ndr_Workstation; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Workstation, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation))); + NDR_CHECK(ndr_push_string(_ndr_Workstation, NDR_SCALARS, r->Workstation)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Workstation, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation))); + } + } + ndr->flags = _flags_save_string; + } + if (r->EncryptedRandomSessionKey) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->EncryptedRandomSessionKey)); + { + struct ndr_push *_ndr_EncryptedRandomSessionKey; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_EncryptedRandomSessionKey, 0, r->EncryptedRandomSessionKey->length)); + NDR_CHECK(ndr_push_DATA_BLOB(_ndr_EncryptedRandomSessionKey, NDR_SCALARS, *r->EncryptedRandomSessionKey)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_EncryptedRandomSessionKey, 0, r->EncryptedRandomSessionKey->length)); + } + } + NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_AUTHENTICATE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct AUTHENTICATE_MESSAGE *r) +{ + uint32_t _ptr_LmChallengeResponse; + TALLOC_CTX *_mem_save_LmChallengeResponse_0; + uint32_t _ptr_NtChallengeResponse; + TALLOC_CTX *_mem_save_NtChallengeResponse_0; + uint32_t _ptr_DomainName; + TALLOC_CTX *_mem_save_DomainName_0; + uint32_t _ptr_UserName; + TALLOC_CTX *_mem_save_UserName_0; + uint32_t _ptr_Workstation; + TALLOC_CTX *_mem_save_Workstation_0; + uint32_t _ptr_EncryptedRandomSessionKey; + TALLOC_CTX *_mem_save_EncryptedRandomSessionKey_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->Signature, 8, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr, NDR_SCALARS, &r->MessageType)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->LmChallengeResponseLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->LmChallengeResponseMaxLen)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LmChallengeResponse)); + if (_ptr_LmChallengeResponse) { + NDR_PULL_ALLOC(ndr, r->LmChallengeResponse); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->LmChallengeResponse, _ptr_LmChallengeResponse)); + } else { + r->LmChallengeResponse = NULL; + } + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->NtChallengeResponseLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->NtChallengeResponseMaxLen)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_NtChallengeResponse)); + if (_ptr_NtChallengeResponse) { + NDR_PULL_ALLOC(ndr, r->NtChallengeResponse); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->NtChallengeResponse, _ptr_NtChallengeResponse)); + } else { + r->NtChallengeResponse = NULL; + } + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DomainNameLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DomainNameMaxLen)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DomainName)); + if (_ptr_DomainName) { + NDR_PULL_ALLOC(ndr, r->DomainName); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DomainName, _ptr_DomainName)); + } else { + r->DomainName = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->UserNameLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->UserNameMaxLen)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_UserName)); + if (_ptr_UserName) { + NDR_PULL_ALLOC(ndr, r->UserName); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->UserName, _ptr_UserName)); + } else { + r->UserName = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WorkstationLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WorkstationMaxLen)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Workstation)); + if (_ptr_Workstation) { + NDR_PULL_ALLOC(ndr, r->Workstation); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->Workstation, _ptr_Workstation)); + } else { + r->Workstation = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->EncryptedRandomSessionKeyLen)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->EncryptedRandomSessionKeyMaxLen)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedRandomSessionKey)); + if (_ptr_EncryptedRandomSessionKey) { + NDR_PULL_ALLOC(ndr, r->EncryptedRandomSessionKey); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->EncryptedRandomSessionKey, _ptr_EncryptedRandomSessionKey)); + } else { + r->EncryptedRandomSessionKey = NULL; + } + NDR_CHECK(ndr_pull_NEGOTIATE(ndr, NDR_SCALARS, &r->NegotiateFlags)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)); + NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->LmChallengeResponse) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->LmChallengeResponse)); + _mem_save_LmChallengeResponse_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->LmChallengeResponse, 0); + { + struct ndr_pull *_ndr_LmChallengeResponse; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_LmChallengeResponse, 0, r->LmChallengeResponseLen)); + NDR_CHECK(ndr_pull_set_switch_value(_ndr_LmChallengeResponse, r->LmChallengeResponse, r->LmChallengeResponseLen)); + NDR_CHECK(ndr_pull_ntlmssp_LM_RESPONSE(_ndr_LmChallengeResponse, NDR_SCALARS|NDR_BUFFERS, r->LmChallengeResponse)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_LmChallengeResponse, 0, r->LmChallengeResponseLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LmChallengeResponse_0, 0); + ndr->offset = _relative_save_offset; + } + if (r->NtChallengeResponse) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->NtChallengeResponse)); + _mem_save_NtChallengeResponse_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->NtChallengeResponse, 0); + { + struct ndr_pull *_ndr_NtChallengeResponse; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_NtChallengeResponse, 0, r->NtChallengeResponseMaxLen)); + NDR_CHECK(ndr_pull_set_switch_value(_ndr_NtChallengeResponse, r->NtChallengeResponse, r->NtChallengeResponseLen)); + NDR_CHECK(ndr_pull_ntlmssp_NTLM_RESPONSE(_ndr_NtChallengeResponse, NDR_SCALARS|NDR_BUFFERS, r->NtChallengeResponse)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_NtChallengeResponse, 0, r->NtChallengeResponseMaxLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_NtChallengeResponse_0, 0); + ndr->offset = _relative_save_offset; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + if (r->DomainName) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DomainName)); + _mem_save_DomainName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->DomainName, 0); + { + struct ndr_pull *_ndr_DomainName; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_DomainName, 0, r->DomainNameLen)); + NDR_CHECK(ndr_pull_string(_ndr_DomainName, NDR_SCALARS, &r->DomainName)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_DomainName, 0, r->DomainNameLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DomainName_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + if (r->UserName) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->UserName)); + _mem_save_UserName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->UserName, 0); + { + struct ndr_pull *_ndr_UserName; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_UserName, 0, r->UserNameLen)); + NDR_CHECK(ndr_pull_string(_ndr_UserName, NDR_SCALARS, &r->UserName)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_UserName, 0, r->UserNameLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_UserName_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags)); + if (r->Workstation) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->Workstation)); + _mem_save_Workstation_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->Workstation, 0); + { + struct ndr_pull *_ndr_Workstation; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Workstation, 0, r->WorkstationLen)); + NDR_CHECK(ndr_pull_string(_ndr_Workstation, NDR_SCALARS, &r->Workstation)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Workstation, 0, r->WorkstationLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Workstation_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->EncryptedRandomSessionKey) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->EncryptedRandomSessionKey)); + _mem_save_EncryptedRandomSessionKey_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->EncryptedRandomSessionKey, 0); + { + struct ndr_pull *_ndr_EncryptedRandomSessionKey; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_EncryptedRandomSessionKey, 0, r->EncryptedRandomSessionKeyLen)); + NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_EncryptedRandomSessionKey, NDR_SCALARS, r->EncryptedRandomSessionKey)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_EncryptedRandomSessionKey, 0, r->EncryptedRandomSessionKeyLen)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedRandomSessionKey_0, 0); + ndr->offset = _relative_save_offset; + } + NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_AUTHENTICATE_MESSAGE(struct ndr_print *ndr, const char *name, const struct AUTHENTICATE_MESSAGE *r) +{ + ndr_print_struct(ndr, name, "AUTHENTICATE_MESSAGE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + ndr->depth++; + ndr_print_string(ndr, "Signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"NTLMSSP":r->Signature); + ndr_print_ntlmssp_MessageType(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NtLmAuthenticate:r->MessageType); + ndr_print_uint16(ndr, "LmChallengeResponseLen", r->LmChallengeResponseLen); + ndr_print_uint16(ndr, "LmChallengeResponseMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->LmChallengeResponseLen:r->LmChallengeResponseMaxLen); + ndr_print_ptr(ndr, "LmChallengeResponse", r->LmChallengeResponse); + ndr->depth++; + if (r->LmChallengeResponse) { + ndr_print_set_switch_value(ndr, r->LmChallengeResponse, r->LmChallengeResponseLen); + ndr_print_ntlmssp_LM_RESPONSE(ndr, "LmChallengeResponse", r->LmChallengeResponse); + } + ndr->depth--; + ndr_print_uint16(ndr, "NtChallengeResponseLen", r->NtChallengeResponseLen); + ndr_print_uint16(ndr, "NtChallengeResponseMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->NtChallengeResponseLen:r->NtChallengeResponseMaxLen); + ndr_print_ptr(ndr, "NtChallengeResponse", r->NtChallengeResponse); + ndr->depth++; + if (r->NtChallengeResponse) { + ndr_print_set_switch_value(ndr, r->NtChallengeResponse, r->NtChallengeResponseLen); + ndr_print_ntlmssp_NTLM_RESPONSE(ndr, "NtChallengeResponse", r->NtChallengeResponse); + } + ndr->depth--; + ndr_print_uint16(ndr, "DomainNameLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName):r->DomainNameLen); + ndr_print_uint16(ndr, "DomainNameMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->DomainNameLen:r->DomainNameMaxLen); + ndr_print_ptr(ndr, "DomainName", r->DomainName); + ndr->depth++; + if (r->DomainName) { + ndr_print_string(ndr, "DomainName", r->DomainName); + } + ndr->depth--; + ndr_print_uint16(ndr, "UserNameLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName):r->UserNameLen); + ndr_print_uint16(ndr, "UserNameMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->UserNameLen:r->UserNameMaxLen); + ndr_print_ptr(ndr, "UserName", r->UserName); + ndr->depth++; + if (r->UserName) { + ndr_print_string(ndr, "UserName", r->UserName); + } + ndr->depth--; + ndr_print_uint16(ndr, "WorkstationLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation):r->WorkstationLen); + ndr_print_uint16(ndr, "WorkstationMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->WorkstationLen:r->WorkstationMaxLen); + ndr_print_ptr(ndr, "Workstation", r->Workstation); + ndr->depth++; + if (r->Workstation) { + ndr_print_string(ndr, "Workstation", r->Workstation); + } + ndr->depth--; + ndr_print_uint16(ndr, "EncryptedRandomSessionKeyLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->EncryptedRandomSessionKey->length:r->EncryptedRandomSessionKeyLen); + ndr_print_uint16(ndr, "EncryptedRandomSessionKeyMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->EncryptedRandomSessionKeyLen:r->EncryptedRandomSessionKeyMaxLen); + ndr_print_ptr(ndr, "EncryptedRandomSessionKey", r->EncryptedRandomSessionKey); + ndr->depth++; + if (r->EncryptedRandomSessionKey) { + ndr_print_DATA_BLOB(ndr, "EncryptedRandomSessionKey", *r->EncryptedRandomSessionKey); + } + ndr->depth--; + ndr_print_NEGOTIATE(ndr, "NegotiateFlags", r->NegotiateFlags); + ndr_print_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION); + ndr_print_ntlmssp_Version(ndr, "Version", &r->Version); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_push *ndr, int ndr_flags, const struct NTLMSSP_MESSAGE_SIGNATURE *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NTLMSSP_SIGN_VERSION)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->RandomPad)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Checksum)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SeqNum)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_pull *ndr, int ndr_flags, struct NTLMSSP_MESSAGE_SIGNATURE *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->RandomPad)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Checksum)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SeqNum)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_print *ndr, const char *name, const struct NTLMSSP_MESSAGE_SIGNATURE *r) +{ + ndr_print_struct(ndr, name, "NTLMSSP_MESSAGE_SIGNATURE"); + ndr->depth++; + ndr_print_uint32(ndr, "Version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NTLMSSP_SIGN_VERSION:r->Version); + ndr_print_uint32(ndr, "RandomPad", r->RandomPad); + ndr_print_uint32(ndr, "Checksum", r->Checksum); + ndr_print_uint32(ndr, "SeqNum", r->SeqNum); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_push *ndr, int ndr_flags, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NTLMSSP_SIGN_VERSION)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Checksum, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SeqNum)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_pull *ndr, int ndr_flags, struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Version)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Checksum, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SeqNum)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_print *ndr, const char *name, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r) +{ + ndr_print_struct(ndr, name, "NTLMSSP_MESSAGE_SIGNATURE_NTLMv2"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint32(ndr, "Version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NTLMSSP_SIGN_VERSION:r->Version); + ndr_print_array_uint8(ndr, "Checksum", r->Checksum, 8); + ndr_print_uint32(ndr, "SeqNum", r->SeqNum); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + diff --git a/librpc/gen_ndr/ndr_ntlmssp.h b/librpc/gen_ndr/ndr_ntlmssp.h new file mode 100644 index 0000000000..514d871cc7 --- /dev/null +++ b/librpc/gen_ndr/ndr_ntlmssp.h @@ -0,0 +1,60 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "../librpc/gen_ndr/ntlmssp.h" + +#ifndef _HEADER_NDR_ntlmssp +#define _HEADER_NDR_ntlmssp + +#include "../librpc/ndr/ndr_ntlmssp.h" +#define NDR_NTLMSSP_CALL_COUNT (0) +void ndr_print_ntlmssp_MessageType(struct ndr_print *ndr, const char *name, enum ntlmssp_MessageType r); +void ndr_print_NEGOTIATE(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_ntlmssp_WindowsMajorVersion(struct ndr_print *ndr, const char *name, enum ntlmssp_WindowsMajorVersion r); +void ndr_print_ntlmssp_WindowsMinorVersion(struct ndr_print *ndr, const char *name, enum ntlmssp_WindowsMinorVersion r); +void ndr_print_ntlmssp_NTLMRevisionCurrent(struct ndr_print *ndr, const char *name, enum ntlmssp_NTLMRevisionCurrent r); +void ndr_print_VERSION(struct ndr_print *ndr, const char *name, const struct VERSION *r); +void ndr_print_ntlmssp_Version(struct ndr_print *ndr, const char *name, const union ntlmssp_Version *r); +enum ndr_err_code ndr_push_NEGOTIATE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct NEGOTIATE_MESSAGE *r); +enum ndr_err_code ndr_pull_NEGOTIATE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct NEGOTIATE_MESSAGE *r); +void ndr_print_NEGOTIATE_MESSAGE(struct ndr_print *ndr, const char *name, const struct NEGOTIATE_MESSAGE *r); +void ndr_print_ntlmssp_AvId(struct ndr_print *ndr, const char *name, enum ntlmssp_AvId r); +void ndr_print_Restriction_Encoding(struct ndr_print *ndr, const char *name, const struct Restriction_Encoding *r); +void ndr_print_ntlmssp_AvFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_ntlmssp_AvValue(struct ndr_print *ndr, const char *name, const union ntlmssp_AvValue *r); +enum ndr_err_code ndr_push_AV_PAIR(struct ndr_push *ndr, int ndr_flags, const struct AV_PAIR *r); +enum ndr_err_code ndr_pull_AV_PAIR(struct ndr_pull *ndr, int ndr_flags, struct AV_PAIR *r); +void ndr_print_AV_PAIR(struct ndr_print *ndr, const char *name, const struct AV_PAIR *r); +enum ndr_err_code ndr_push_AV_PAIR_LIST(struct ndr_push *ndr, int ndr_flags, const struct AV_PAIR_LIST *r); +enum ndr_err_code ndr_pull_AV_PAIR_LIST(struct ndr_pull *ndr, int ndr_flags, struct AV_PAIR_LIST *r); +void ndr_print_AV_PAIR_LIST(struct ndr_print *ndr, const char *name, const struct AV_PAIR_LIST *r); +enum ndr_err_code ndr_push_CHALLENGE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct CHALLENGE_MESSAGE *r); +enum ndr_err_code ndr_pull_CHALLENGE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct CHALLENGE_MESSAGE *r); +void ndr_print_CHALLENGE_MESSAGE(struct ndr_print *ndr, const char *name, const struct CHALLENGE_MESSAGE *r); +enum ndr_err_code ndr_push_LM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct LM_RESPONSE *r); +enum ndr_err_code ndr_pull_LM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct LM_RESPONSE *r); +void ndr_print_LM_RESPONSE(struct ndr_print *ndr, const char *name, const struct LM_RESPONSE *r); +enum ndr_err_code ndr_push_LMv2_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct LMv2_RESPONSE *r); +enum ndr_err_code ndr_pull_LMv2_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct LMv2_RESPONSE *r); +void ndr_print_LMv2_RESPONSE(struct ndr_print *ndr, const char *name, const struct LMv2_RESPONSE *r); +void ndr_print_ntlmssp_LM_RESPONSE(struct ndr_print *ndr, const char *name, const union ntlmssp_LM_RESPONSE *r); +enum ndr_err_code ndr_push_NTLM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NTLM_RESPONSE *r); +enum ndr_err_code ndr_pull_NTLM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NTLM_RESPONSE *r); +void ndr_print_NTLM_RESPONSE(struct ndr_print *ndr, const char *name, const struct NTLM_RESPONSE *r); +void ndr_print_NTLMv2_CLIENT_CHALLENGE(struct ndr_print *ndr, const char *name, const struct NTLMv2_CLIENT_CHALLENGE *r); +enum ndr_err_code ndr_push_NTLMv2_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NTLMv2_RESPONSE *r); +enum ndr_err_code ndr_pull_NTLMv2_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NTLMv2_RESPONSE *r); +void ndr_print_NTLMv2_RESPONSE(struct ndr_print *ndr, const char *name, const struct NTLMv2_RESPONSE *r); +enum ndr_err_code ndr_push_ntlmssp_NTLM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_NTLM_RESPONSE *r); +enum ndr_err_code ndr_pull_ntlmssp_NTLM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_NTLM_RESPONSE *r); +void ndr_print_ntlmssp_NTLM_RESPONSE(struct ndr_print *ndr, const char *name, const union ntlmssp_NTLM_RESPONSE *r); +enum ndr_err_code ndr_push_AUTHENTICATE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct AUTHENTICATE_MESSAGE *r); +enum ndr_err_code ndr_pull_AUTHENTICATE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct AUTHENTICATE_MESSAGE *r); +void ndr_print_AUTHENTICATE_MESSAGE(struct ndr_print *ndr, const char *name, const struct AUTHENTICATE_MESSAGE *r); +enum ndr_err_code ndr_push_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_push *ndr, int ndr_flags, const struct NTLMSSP_MESSAGE_SIGNATURE *r); +enum ndr_err_code ndr_pull_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_pull *ndr, int ndr_flags, struct NTLMSSP_MESSAGE_SIGNATURE *r); +void ndr_print_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_print *ndr, const char *name, const struct NTLMSSP_MESSAGE_SIGNATURE *r); +enum ndr_err_code ndr_push_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_push *ndr, int ndr_flags, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r); +enum ndr_err_code ndr_pull_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_pull *ndr, int ndr_flags, struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r); +void ndr_print_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_print *ndr, const char *name, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r); +#endif /* _HEADER_NDR_ntlmssp */ diff --git a/librpc/gen_ndr/ntlmssp.h b/librpc/gen_ndr/ntlmssp.h new file mode 100644 index 0000000000..6e5020f282 --- /dev/null +++ b/librpc/gen_ndr/ntlmssp.h @@ -0,0 +1,285 @@ +/* header auto-generated by pidl */ + +#include <stdint.h> + +#include "libcli/util/ntstatus.h" + +#ifndef _HEADER_ntlmssp +#define _HEADER_ntlmssp + +#define NTLMSSP_NEGOTIATE_NTLM2 ( NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY ) +#define NTLMSSP_SIGN_VERSION ( 0x01 ) +#define NTLMSSP_SIG_SIZE ( 16 ) +enum ntlmssp_MessageType +#ifndef USE_UINT_ENUMS + { + NtLmNegotiate=0x00000001, + NtLmChallenge=0x00000002, + NtLmAuthenticate=0x00000003 +} +#else + { __donnot_use_enum_ntlmssp_MessageType=0x7FFFFFFF} +#define NtLmNegotiate ( 0x00000001 ) +#define NtLmChallenge ( 0x00000002 ) +#define NtLmAuthenticate ( 0x00000003 ) +#endif +; + +/* bitmap NEGOTIATE */ +#define NTLMSSP_NEGOTIATE_UNICODE ( 0x00000001 ) +#define NTLMSSP_NEGOTIATE_OEM ( 0x00000002 ) +#define NTLMSSP_REQUEST_TARGET ( 0x00000004 ) +#define NTLMSSP_NEGOTIATE_SIGN ( 0x00000010 ) +#define NTLMSSP_NEGOTIATE_SEAL ( 0x00000020 ) +#define NTLMSSP_NEGOTIATE_DATAGRAM ( 0x00000040 ) +#define NTLMSSP_NEGOTIATE_LM_KEY ( 0x00000080 ) +#define NTLMSSP_NEGOTIATE_NETWARE ( 0x00000100 ) +#define NTLMSSP_NEGOTIATE_NTLM ( 0x00000200 ) +#define NTLMSSP_NEGOTIATE_NT_ONLY ( 0x00000400 ) +#define NTLMSSP_ANONYMOUS ( 0x00000800 ) +#define NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED ( 0x00001000 ) +#define NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED ( 0x00002000 ) +#define NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL ( 0x00004000 ) +#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN ( 0x00008000 ) +#define NTLMSSP_TARGET_TYPE_DOMAIN ( 0x00010000 ) +#define NTLMSSP_TARGET_TYPE_SERVER ( 0x00020000 ) +#define NTLMSSP_TARGET_TYPE_SHARE ( 0x00040000 ) +#define NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY ( 0x00080000 ) +#define NTLMSSP_NEGOTIATE_IDENTIFY ( 0x00100000 ) +#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY ( 0x00400000 ) +#define NTLMSSP_NEGOTIATE_TARGET_INFO ( 0x00800000 ) +#define NTLMSSP_NEGOTIATE_VERSION ( 0x02000000 ) +#define NTLMSSP_NEGOTIATE_128 ( 0x20000000 ) +#define NTLMSSP_NEGOTIATE_KEY_EXCH ( 0x40000000 ) +#define NTLMSSP_NEGOTIATE_56 ( 0x80000000 ) + +enum ntlmssp_WindowsMajorVersion +#ifndef USE_UINT_ENUMS + { + NTLMSSP_WINDOWS_MAJOR_VERSION_5=0x05, + NTLMSSP_WINDOWS_MAJOR_VERSION_6=0x06 +} +#else + { __donnot_use_enum_ntlmssp_WindowsMajorVersion=0x7FFFFFFF} +#define NTLMSSP_WINDOWS_MAJOR_VERSION_5 ( 0x05 ) +#define NTLMSSP_WINDOWS_MAJOR_VERSION_6 ( 0x06 ) +#endif +; + +enum ntlmssp_WindowsMinorVersion +#ifndef USE_UINT_ENUMS + { + NTLMSSP_WINDOWS_MINOR_VERSION_0=0x00, + NTLMSSP_WINDOWS_MINOR_VERSION_1=0x01, + NTLMSSP_WINDOWS_MINOR_VERSION_2=0x02 +} +#else + { __donnot_use_enum_ntlmssp_WindowsMinorVersion=0x7FFFFFFF} +#define NTLMSSP_WINDOWS_MINOR_VERSION_0 ( 0x00 ) +#define NTLMSSP_WINDOWS_MINOR_VERSION_1 ( 0x01 ) +#define NTLMSSP_WINDOWS_MINOR_VERSION_2 ( 0x02 ) +#endif +; + +enum ntlmssp_NTLMRevisionCurrent +#ifndef USE_UINT_ENUMS + { + NTLMSSP_REVISION_W2K3_RC1=0x0A, + NTLMSSP_REVISION_W2K3=0x0F +} +#else + { __donnot_use_enum_ntlmssp_NTLMRevisionCurrent=0x7FFFFFFF} +#define NTLMSSP_REVISION_W2K3_RC1 ( 0x0A ) +#define NTLMSSP_REVISION_W2K3 ( 0x0F ) +#endif +; + +struct VERSION { + enum ntlmssp_WindowsMajorVersion ProductMajorVersion; + enum ntlmssp_WindowsMinorVersion ProductMinorVersion; + uint16_t ProductBuild; + uint8_t Reserved[3]; + enum ntlmssp_NTLMRevisionCurrent NTLMRevisionCurrent; +}; + +union ntlmssp_Version { + struct VERSION version;/* [case(NTLMSSP_NEGOTIATE_VERSION)] */ +}/* [nodiscriminant] */; + +struct NEGOTIATE_MESSAGE { + const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */ + enum ntlmssp_MessageType MessageType;/* [value(NtLmNegotiate)] */ + uint32_t NegotiateFlags; + uint16_t DomainNameLen;/* [value(strlen(DomainName))] */ + uint16_t DomainNameMaxLen;/* [value(DomainNameLen)] */ + const char * DomainName;/* [relative,subcontext_size(DomainNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] */ + uint16_t WorkstationLen;/* [value(strlen(Workstation))] */ + uint16_t WorkstationMaxLen;/* [value(WorkstationLen)] */ + const char * Workstation;/* [relative,subcontext_size(WorkstationLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] */ + union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */ +}/* [public] */; + +enum ntlmssp_AvId +#ifndef USE_UINT_ENUMS + { + MsvAvEOL=0, + MsvAvNbComputerName=1, + MsvAvNbDomainName=2, + MsvAvDnsComputerName=3, + MsvAvDnsDomainName=4, + MsvAvDnsTreeName=5, + MsvAvFlags=6, + MsvAvTimestamp=7, + MsAvRestrictions=8, + MsvAvTargetName=9, + MsvChannelBindings=10 +} +#else + { __donnot_use_enum_ntlmssp_AvId=0x7FFFFFFF} +#define MsvAvEOL ( 0 ) +#define MsvAvNbComputerName ( 1 ) +#define MsvAvNbDomainName ( 2 ) +#define MsvAvDnsComputerName ( 3 ) +#define MsvAvDnsDomainName ( 4 ) +#define MsvAvDnsTreeName ( 5 ) +#define MsvAvFlags ( 6 ) +#define MsvAvTimestamp ( 7 ) +#define MsAvRestrictions ( 8 ) +#define MsvAvTargetName ( 9 ) +#define MsvChannelBindings ( 10 ) +#endif +; + +struct Restriction_Encoding { + uint32_t Size; + uint32_t Z4;/* [value(0)] */ + uint32_t IntegrityLevel; + uint32_t SubjectIntegrityLevel; + uint8_t MachineId[32]; +}; + +/* bitmap ntlmssp_AvFlags */ +#define NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT ( 0x00000001 ) +#define NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE ( 0x00000002 ) + +union ntlmssp_AvValue { + const char * AvNbComputerName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvNbComputerName)] */ + const char * AvNbDomainName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvNbDomainName)] */ + const char * AvDnsComputerName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsComputerName)] */ + const char * AvDnsDomainName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsDomainName)] */ + const char * AvDnsTreeName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsTreeName)] */ + uint32_t AvFlags;/* [case(MsvAvFlags)] */ + NTTIME AvTimestamp;/* [case(MsvAvTimestamp)] */ + struct Restriction_Encoding AvRestrictions;/* [case(MsAvRestrictions)] */ + const char * AvTargetName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvTargetName)] */ + uint8_t ChannelBindings[16];/* [case(MsvChannelBindings)] */ + DATA_BLOB blob;/* [default,flag(LIBNDR_FLAG_REMAINING)] */ +}/* [gensize,nodiscriminant,flag(LIBNDR_FLAG_NOALIGN)] */; + +struct AV_PAIR { + enum ntlmssp_AvId AvId; + uint16_t AvLen;/* [value(ndr_size_ntlmssp_AvValue(&r->Value,r->AvId,ndr->iconv_convenience,0))] */ + union ntlmssp_AvValue Value;/* [subcontext_size(AvLen),subcontext(0),switch_is(AvId)] */ +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + +struct AV_PAIR_LIST { + uint32_t count; + struct AV_PAIR *pair; +}/* [gensize,nopull,nopush,flag(LIBNDR_FLAG_NOALIGN)] */; + +struct CHALLENGE_MESSAGE { + const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */ + enum ntlmssp_MessageType MessageType;/* [value(NtLmChallenge)] */ + uint16_t TargetNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,TargetName))] */ + uint16_t TargetNameMaxLen;/* [value(TargetNameLen)] */ + const char * TargetName;/* [relative,subcontext_size(TargetNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */ + uint32_t NegotiateFlags; + uint8_t ServerChallenge[8]; + uint8_t Reserved[8]; + uint16_t TargetInfoLen;/* [value(ndr_size_AV_PAIR_LIST(TargetInfo,ndr->iconv_convenience,ndr->flags))] */ + uint16_t TargetNameInfoMaxLen;/* [value(TargetInfoLen)] */ + struct AV_PAIR_LIST *TargetInfo;/* [relative,subcontext_size(TargetInfoLen),subcontext(0)] */ + union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */ +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct LM_RESPONSE { + uint8_t Response[24]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct LMv2_RESPONSE { + uint8_t Response[16]; + uint8_t ChallengeFromClient[8]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +union ntlmssp_LM_RESPONSE { + struct LM_RESPONSE v1;/* [case(24)] */ +}/* [nodiscriminant] */; + +struct NTLM_RESPONSE { + uint8_t Response[24]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct NTLMv2_CLIENT_CHALLENGE { + uint8_t RespType;/* [value] */ + uint8_t HiRespType;/* [value] */ + uint16_t Reserved1; + uint32_t Reserved2; + NTTIME TimeStamp; + uint8_t ChallengeFromClient[8]; + uint32_t Reserved3; + struct AV_PAIR_LIST AvPairs;/* [subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */ +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct NTLMv2_RESPONSE { + uint8_t Response[16]; + struct NTLMv2_CLIENT_CHALLENGE Challenge; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +union ntlmssp_NTLM_RESPONSE { + struct NTLM_RESPONSE v1;/* [case(0x18)] */ + struct NTLMv2_RESPONSE v2;/* [default] */ +}/* [public,nodiscriminant] */; + +struct MIC { + uint8_t MIC[16]; +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct AUTHENTICATE_MESSAGE { + const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */ + enum ntlmssp_MessageType MessageType;/* [value(NtLmAuthenticate)] */ + uint16_t LmChallengeResponseLen; + uint16_t LmChallengeResponseMaxLen;/* [value(LmChallengeResponseLen)] */ + union ntlmssp_LM_RESPONSE *LmChallengeResponse;/* [relative,subcontext_size(LmChallengeResponseLen),subcontext(0),switch_is(LmChallengeResponseLen)] */ + uint16_t NtChallengeResponseLen; + uint16_t NtChallengeResponseMaxLen;/* [value(NtChallengeResponseLen)] */ + union ntlmssp_NTLM_RESPONSE *NtChallengeResponse;/* [relative,subcontext_size(NtChallengeResponseMaxLen),subcontext(0),switch_is(NtChallengeResponseLen)] */ + uint16_t DomainNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,DomainName))] */ + uint16_t DomainNameMaxLen;/* [value(DomainNameLen)] */ + const char * DomainName;/* [relative,subcontext_size(DomainNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */ + uint16_t UserNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,UserName))] */ + uint16_t UserNameMaxLen;/* [value(UserNameLen)] */ + const char * UserName;/* [relative,subcontext_size(UserNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */ + uint16_t WorkstationLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,Workstation))] */ + uint16_t WorkstationMaxLen;/* [value(WorkstationLen)] */ + const char * Workstation;/* [relative,subcontext_size(WorkstationLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */ + uint16_t EncryptedRandomSessionKeyLen;/* [value(EncryptedRandomSessionKey->length)] */ + uint16_t EncryptedRandomSessionKeyMaxLen;/* [value(EncryptedRandomSessionKeyLen)] */ + DATA_BLOB *EncryptedRandomSessionKey;/* [relative,subcontext_size(EncryptedRandomSessionKeyLen),subcontext(0)] */ + uint32_t NegotiateFlags; + union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */ +}/* [public,flag(LIBNDR_FLAG_REMAINING)] */; + +struct NTLMSSP_MESSAGE_SIGNATURE { + uint32_t Version;/* [value(NTLMSSP_SIGN_VERSION)] */ + uint32_t RandomPad; + uint32_t Checksum; + uint32_t SeqNum; +}/* [public] */; + +struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 { + uint32_t Version;/* [value(NTLMSSP_SIGN_VERSION)] */ + uint8_t Checksum[8]; + uint32_t SeqNum; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +#endif /* _HEADER_ntlmssp */ |