b4509089154c8f2bab53503e23c430c4ebb13cbb
[tprouty/samba.git] / source4 / librpc / idl / krb5pac.idl
1 /*
2   krb5 PAC
3 */
4
5 #include "idl_types.h"
6
7 import "security.idl", "netlogon.idl", "samr.idl";
8
9 [
10   uuid("12345778-1234-abcd-0000-00000000"),
11   version(0.0),
12   pointer_default(unique),
13   helpstring("Active Directory KRB5 PAC")
14 ]
15 interface krb5pac
16 {
17         typedef struct {
18                 NTTIME logon_time;
19                 [value(2*strlen_m(account_name))] uint16 size;
20                 [charset(UTF16)] uint8 account_name[size];
21         } PAC_LOGON_NAME;
22
23         typedef [public,flag(NDR_PAHEX)] struct {
24                 uint32 type;
25                 [flag(NDR_REMAINING)] DATA_BLOB signature;
26         } PAC_SIGNATURE_DATA;
27
28         typedef [gensize] struct {
29                 netr_SamInfo3 info3;
30                 dom_sid2 *res_group_dom_sid;
31                 samr_RidWithAttributeArray res_groups;
32         } PAC_LOGON_INFO;
33
34         typedef struct {
35                 [value(2*strlen_m(upn_name))] uint16 upn_size;
36                 uint16 upn_offset;
37                 [value(2*strlen_m(domain_name))] uint16 domain_size;
38                 uint16 domain_offset;
39                 uint16 unknown3; /* 0x01 */
40                 uint16 unknown4;
41                 uint32 unknown5;
42                 [charset(UTF16)] uint8 upn_name[upn_size+2];
43                 [charset(UTF16)] uint8 domain_name[domain_size+2];
44                 uint32 unknown6; /* padding */
45         } PAC_UNKNOWN_12;
46
47         typedef [public] struct {
48                 [value(0x00081001)] uint32 unknown1;
49                 [value(0xCCCCCCCC)] uint32 unknown2;
50                 [value(NDR_ROUND(ndr_size_PAC_LOGON_INFO(info, ndr->flags)+4,8))] uint32 _ndr_size;
51                 [value(0x00000000)] uint32 unknown3;
52                 PAC_LOGON_INFO *info;
53         } PAC_LOGON_INFO_CTR;
54
55         typedef [public,v1_enum] enum {
56                 PAC_TYPE_LOGON_INFO = 1,
57                 PAC_TYPE_SRV_CHECKSUM = 6,
58                 PAC_TYPE_KDC_CHECKSUM = 7,
59                 PAC_TYPE_LOGON_NAME = 10,
60                 PAC_TYPE_CONSTRAINED_DELEGATION = 11,
61                 PAC_TYPE_UNKNOWN_12 = 12
62         } PAC_TYPE;
63
64         typedef struct {
65                 [flag(NDR_REMAINING)] DATA_BLOB remaining;
66         } DATA_BLOB_REM;
67
68         typedef [public,nodiscriminant,gensize] union {
69                 [case(PAC_TYPE_LOGON_INFO)]     PAC_LOGON_INFO_CTR logon_info;
70                 [case(PAC_TYPE_SRV_CHECKSUM)]   PAC_SIGNATURE_DATA srv_cksum;
71                 [case(PAC_TYPE_KDC_CHECKSUM)]   PAC_SIGNATURE_DATA kdc_cksum;
72                 [case(PAC_TYPE_LOGON_NAME)]     PAC_LOGON_NAME logon_name;
73                 /* when new PAC info types are added they are supposed to be done
74                    in such a way that they are backwards compatible with existing
75                    servers. This makes it safe to just use a [default] for
76                    unknown types, which lets us ignore the data */
77                 [default]       [subcontext(0)] DATA_BLOB_REM unknown;
78                 /* [case(PAC_TYPE_UNKNOWN_12)]  PAC_UNKNOWN_12 unknown; */
79         } PAC_INFO;
80
81         typedef [public,nopush,nopull,noprint] struct {
82                 PAC_TYPE type;
83                 [value(_ndr_size_PAC_INFO(info, type, 0))] uint32 _ndr_size;
84                 [relative,switch_is(type),subcontext(0),subcontext_size(_subcontext_size_PAC_INFO(r, ndr->flags)),flag(NDR_ALIGN8)] PAC_INFO *info;
85                 [value(0)] uint32 _pad; /* Top half of a 64 bit pointer? */
86         } PAC_BUFFER;
87
88         typedef [public] struct {
89                 uint32 num_buffers;
90                 uint32 version;
91                 PAC_BUFFER buffers[num_buffers];
92         } PAC_DATA;
93
94         typedef [public] struct {
95                 PAC_TYPE type;
96                 uint32 ndr_size;
97                 [relative,subcontext(0),subcontext_size(NDR_ROUND(ndr_size,8)),flag(NDR_ALIGN8)] DATA_BLOB_REM *info;
98                 [value(0)] uint32 _pad; /* Top half of a 64 bit pointer? */
99         } PAC_BUFFER_RAW;
100
101         typedef [public] struct {
102                 uint32 num_buffers;
103                 uint32 version;
104                 PAC_BUFFER_RAW buffers[num_buffers];
105         } PAC_DATA_RAW;
106
107         void decode_pac(
108                 [in] PAC_DATA pac
109                 );
110
111         void decode_pac_raw(
112                 [in] PAC_DATA_RAW pac
113                 );
114
115         void decode_login_info(
116                 [in] PAC_LOGON_INFO logon_info
117                 );
118 }