d9b230d70bfa93d9c42df54264e9b803196b8000
[ira/wip.git] / librpc / idl / schannel.idl
1 #include "idl_types.h"
2
3 /*
4   schannel structures
5 */
6
7 import "netlogon.idl", "nbt.idl";
8
9 [
10         pointer_default(unique),
11         helper("../librpc/ndr/ndr_schannel.h")
12 ]
13 interface schannel
14 {
15         /*
16           a schannel bind blob - used in dcerpc auth_info
17           on a schannel
18         */
19         typedef struct {
20                 astring domain;
21                 astring workstation;
22         } schannel_bind_3;
23
24         typedef struct {
25                 astring domain;
26                 astring workstation;
27                 nbt_string dnsdomain;
28                 nbt_string dnsworkstation;
29         } schannel_bind_23;
30
31         typedef [nodiscriminant] union {
32                 [case (3)]  schannel_bind_3  info3;
33                 [case (23)] schannel_bind_23 info23;
34         } schannel_bind_info;
35
36         typedef [public] struct {
37                 uint32 unknown1; /* seems to need to be 0 */
38                 uint32 bind_type;
39                 [switch_is(bind_type)] schannel_bind_info u;
40         } schannel_bind;
41
42         /* a bind_ack blob */
43         typedef [public] struct {
44                 uint32 unknown1; /* 1 */
45                 uint32 unknown2; /* 0 */
46                 uint32 unknown3; /* 0x006c0000 */
47         } schannel_bind_ack;
48
49         /* this structure is used internally in the NETLOGON server */
50
51         typedef [public,flag(NDR_PAHEX)] struct {
52                 netr_NegotiateFlags negotiate_flags;
53                 uint8 session_key[16];
54                 uint32 sequence;
55                 netr_Credential seed;
56                 netr_Credential client;
57                 netr_Credential server;
58                 netr_SchannelType secure_channel_type;
59                 [string,charset(UTF8)] uint8 computer_name[];
60                 [string,charset(UTF8)] uint8 account_name[];
61                 dom_sid *sid;
62         } netlogon_creds_CredentialState;
63
64         /* MS-NRPC 2.2.1.3.1 NL_AUTH_MESSAGE */
65
66         typedef [v1_enum] enum {
67                 NL_NEGOTIATE_REQUEST    = 0x00000000,
68                 NL_NEGOTIATE_RESPONSE   = 0x00000001
69         } NL_AUTH_MESSAGE_TYPE;
70
71         typedef [bitmap32bit] bitmap {
72                 NL_FLAG_OEM_NETBIOS_DOMAIN_NAME         = 0x00000001,
73                 NL_FLAG_OEM_NETBIOS_COMPUTER_NAME       = 0x00000002,
74                 NL_FLAG_UTF8_DNS_DOMAIN_NAME            = 0x00000004,
75                 NL_FLAG_UTF8_DNS_HOST_NAME              = 0x00000008,
76                 NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME      = 0x00000010
77         } NL_AUTH_MESSAGE_FLAGS;
78
79         typedef [public,nodiscriminant,noprint] union {
80                 [case (NL_FLAG_OEM_NETBIOS_DOMAIN_NAME)]        astring  a;
81                 [case (NL_FLAG_OEM_NETBIOS_COMPUTER_NAME)]      astring  a;
82                 [case (NL_FLAG_UTF8_DNS_DOMAIN_NAME)]           nbt_string u;
83                 [case (NL_FLAG_UTF8_DNS_HOST_NAME)]             nbt_string u;
84                 [case (NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME)]     nbt_string u;
85                 [default]                                       ;
86         } NL_AUTH_MESSAGE_BUFFER;
87
88         typedef [public,nodiscriminant,noprint] union {
89                 [case (NL_NEGOTIATE_RESPONSE)]                  uint32 dummy;
90                 [default]                                       ;
91         } NL_AUTH_MESSAGE_BUFFER_REPLY;
92
93         typedef [public,flag(NDR_PAHEX)] struct {
94                 NL_AUTH_MESSAGE_TYPE MessageType;
95                 NL_AUTH_MESSAGE_FLAGS Flags;
96                 [switch_is(Flags & NL_FLAG_OEM_NETBIOS_DOMAIN_NAME)]    NL_AUTH_MESSAGE_BUFFER oem_netbios_domain;
97                 [switch_is(Flags & NL_FLAG_OEM_NETBIOS_COMPUTER_NAME)]  NL_AUTH_MESSAGE_BUFFER oem_netbios_computer;
98                 [switch_is(Flags & NL_FLAG_UTF8_DNS_DOMAIN_NAME)]       NL_AUTH_MESSAGE_BUFFER utf8_dns_domain;
99                 [switch_is(Flags & NL_FLAG_UTF8_DNS_HOST_NAME)]         NL_AUTH_MESSAGE_BUFFER utf8_dns_host;
100                 [switch_is(Flags & NL_FLAG_UTF8_NETBIOS_COMPUTER_NAME)] NL_AUTH_MESSAGE_BUFFER utf8_netbios_computer;
101                 [switch_is(MessageType & NL_NEGOTIATE_RESPONSE)]        NL_AUTH_MESSAGE_BUFFER_REPLY Buffer;
102         } NL_AUTH_MESSAGE;
103
104         /* MS-NRPC 2.2.1.3.2 NL_AUTH_SIGNATURE */
105
106         typedef enum {
107                 NL_SIGN_HMAC_SHA256     = 0x0013,
108                 NL_SIGN_HMAC_MD5        = 0x0077
109         } NL_SIGNATURE_ALGORITHM;
110
111         typedef enum {
112                 NL_SEAL_AES128          = 0x001A,
113                 NL_SEAL_RC4             = 0x007A,
114                 NL_SEAL_NONE            = 0xFFFF
115         } NL_SEAL_ALGORITHM;
116
117         typedef [public,flag(NDR_PAHEX)] struct {
118                 [value(NL_SIGN_HMAC_MD5)] NL_SIGNATURE_ALGORITHM SignatureAlgorithm;
119                 NL_SEAL_ALGORITHM SealAlgorithm;
120                 uint16 Pad;
121                 uint16 Flags;
122                 uint8 SequenceNumber[8];
123                 uint8 Checksum[8];
124                 uint8 Confounder[8];
125         } NL_AUTH_SIGNATURE;
126
127         /* MS-NRPC 2.2.1.3.3 NL_AUTH_SHA2_SIGNATURE */
128
129         typedef [public,flag(NDR_PAHEX)] struct {
130                 [value(NL_SIGN_HMAC_SHA256)] NL_SIGNATURE_ALGORITHM SignatureAlgorithm;
131                 NL_SEAL_ALGORITHM SealAlgorithm;
132                 uint16 Pad;
133                 uint16 Flags;
134                 uint8 SequenceNumber[8];
135                 uint8 Checksum[32];
136                 uint8 Confounder[8];
137         } NL_AUTH_SHA2_SIGNATURE;
138 }