8488ba4ddcce7372466b4c6257eaf094b8869c07
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / packet-dcerpc-backupkey.c
1 /* DO NOT EDIT
2         This filter was automatically generated
3         from /home/metze/devel/samba/4.0/master4-franky/librpc/idl/backupkey.idl and /home/metze/devel/samba/4.0/master4-franky/librpc/idl/backupkey.cnf.
4         
5         Pidl is a perl based IDL compiler for DCE/RPC idl files.
6         It is maintained by the Samba team, not the Wireshark team.
7         Instructions on how to download and install Pidl can be
8         found at http://wiki.wireshark.org/Pidl
9
10         $Id$
11 */
12
13
14 #include "config.h"
15 #ifdef _MSC_VER
16 #pragma warning(disable:4005)
17 #pragma warning(disable:4013)
18 #pragma warning(disable:4018)
19 #pragma warning(disable:4101)
20 #endif
21
22 #include <glib.h>
23 #include <string.h>
24 #include <epan/packet.h>
25
26 #include "packet-dcerpc.h"
27 #include "packet-dcerpc-nt.h"
28 #include "packet-windows-common.h"
29 #include "packet-dcerpc-backupkey.h"
30
31 /* Ett declarations */
32 static gint ett_dcerpc_backupkey = -1;
33 static gint ett_backupkey_bkrp_exported_RSA_key_pair = -1;
34 static gint ett_backupkey_bkrp_dc_serverwrap_key = -1;
35 static gint ett_backupkey_bkrp_client_side_wrapped = -1;
36 static gint ett_backupkey_bkrp_client_side_unwrapped = -1;
37 static gint ett_backupkey_bkrp_encrypted_secret_v2 = -1;
38 static gint ett_backupkey_bkrp_encrypted_secret_v3 = -1;
39 static gint ett_backupkey_bkrp_access_check_v2 = -1;
40 static gint ett_backupkey_bkrp_access_check_v3 = -1;
41 static gint ett_backupkey_bkrp_data_in_blob = -1;
42
43
44 /* Header field declarations */
45 static gint hf_backupkey_bkrp_data_in_blob_valBACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER_cert_req = -1;
46 static gint hf_backupkey_bkrp_access_check_v2_nonce = -1;
47 static gint hf_backupkey_bkrp_client_side_wrapped_access_check_len = -1;
48 static gint hf_backupkey_bkrp_data_in_blob_valBACKUPKEY_RESTORE_GUID_INTEGER_restore_req = -1;
49 static gint hf_backupkey_bkrp_exported_RSA_key_pair_prime2 = -1;
50 static gint hf_backupkey_bkrp_encrypted_secret_v3_payload_key = -1;
51 static gint hf_backupkey_bkrp_client_side_wrapped_guid = -1;
52 static gint hf_backupkey_bkrp_exported_RSA_key_pair_modulus_ = -1;
53 static gint hf_backupkey_bkrp_exported_RSA_key_pair_public_exponent_ = -1;
54 static gint hf_backupkey_bkrp_exported_RSA_key_pair_header1 = -1;
55 static gint hf_backupkey_bkrp_exported_RSA_key_pair_certificate_len = -1;
56 static gint hf_backupkey_bkrp_exported_RSA_key_pair_coefficient_ = -1;
57 static gint hf_backupkey_bkrp_dc_serverwrap_key_magic = -1;
58 static gint hf_backupkey_bkrp_exported_RSA_key_pair_magic2 = -1;
59 static gint hf_backupkey_bkrp_client_side_unwrapped_secret_ = -1;
60 static gint hf_backupkey_bkrp_exported_RSA_key_pair_private_exponent_ = -1;
61 static gint hf_backupkey_bkrp_client_side_wrapped_encrypted_secret_len = -1;
62 static gint hf_backupkey_bkrp_client_side_unwrapped_magic = -1;
63 static gint hf_backupkey_bkrp_exported_RSA_key_pair_exponent1_ = -1;
64 static gint hf_backupkey_bkrp_encrypted_secret_v3_magic3 = -1;
65 static gint hf_backupkey_bkrp_client_side_wrapped_access_check = -1;
66 static gint hf_backupkey_bkrp_exported_RSA_key_pair_magic1 = -1;
67 static gint hf_backupkey_bkrp_encrypted_secret_v3_secret_len = -1;
68 static gint hf_backupkey_bkrp_client_side_wrapped_encrypted_secret = -1;
69 static gint hf_backupkey_bkrp_BackupKey_guidActionAgent = -1;
70 static gint hf_backupkey_bkrp_exported_RSA_key_pair_prime1 = -1;
71 static gint hf_backupkey_bkrp_access_check_v2_magic = -1;
72 static gint hf_backupkey_bkrp_encrypted_secret_v3_magic1 = -1;
73 static gint hf_backupkey_bkrp_exported_RSA_key_pair_exponent2 = -1;
74 static gint hf_backupkey_bkrp_client_side_unwrapped_secret = -1;
75 static gint hf_backupkey_bkrp_access_check_v3_sid = -1;
76 static gint hf_backupkey_bkrp_access_check_v2_sid = -1;
77 static gint hf_backupkey_bkrp_exported_RSA_key_pair_header2 = -1;
78 static gint hf_backupkey_bkrp_BackupKey_data_out_len = -1;
79 static gint hf_backupkey_bkrp_client_side_wrapped_version = -1;
80 static gint hf_backupkey_bkrp_exported_RSA_key_pair_public_exponent = -1;
81 static gint hf_backupkey_bkrp_BackupKey_param = -1;
82 static gint hf_backupkey_werror = -1;
83 static gint hf_backupkey_bkrp_dc_serverwrap_key_key = -1;
84 static gint hf_backupkey_bkrp_encrypted_secret_v2_secret = -1;
85 static gint hf_backupkey_bkrp_encrypted_secret_v2_secret_len = -1;
86 static gint hf_backupkey_bkrp_access_check_v3_nonce_len = -1;
87 static gint hf_backupkey_bkrp_access_check_v3_hash = -1;
88 static gint hf_backupkey_opnum = -1;
89 static gint hf_backupkey_bkrp_exported_RSA_key_pair_magic3 = -1;
90 static gint hf_backupkey_bkrp_exported_RSA_key_pair_private_exponent = -1;
91 static gint hf_backupkey_bkrp_BackupKey_data_out = -1;
92 static gint hf_backupkey_bkrp_exported_RSA_key_pair_magic4 = -1;
93 static gint hf_backupkey_bkrp_encrypted_secret_v3_magic2 = -1;
94 static gint hf_backupkey_bkrp_exported_RSA_key_pair_cert_ = -1;
95 static gint hf_backupkey_bkrp_exported_RSA_key_pair_prime2_ = -1;
96 static gint hf_backupkey_bkrp_BackupKey_data_in_len = -1;
97 static gint hf_backupkey_bkrp_BackupKey_data_in = -1;
98 static gint hf_backupkey_bkrp_access_check_v3_nonce = -1;
99 static gint hf_backupkey_bkrp_exported_RSA_key_pair_exponent1 = -1;
100 static gint hf_backupkey_bkrp_access_check_v2_nonce_len = -1;
101 static gint hf_backupkey_bkrp_access_check_v2_hash = -1;
102 static gint hf_backupkey_bkrp_exported_RSA_key_pair_cert = -1;
103 static gint hf_backupkey_bkrp_exported_RSA_key_pair_exponent2_ = -1;
104 static gint hf_backupkey_bkrp_exported_RSA_key_pair_modulus = -1;
105 static gint hf_backupkey_bkrp_encrypted_secret_v2_magic = -1;
106 static gint hf_backupkey_bkrp_encrypted_secret_v2_payload_key = -1;
107 static gint hf_backupkey_bkrp_encrypted_secret_v3_secret = -1;
108 static gint hf_backupkey_bkrp_exported_RSA_key_pair_prime1_ = -1;
109 static gint hf_backupkey_bkrp_access_check_v3_magic = -1;
110 static gint hf_backupkey_bkrp_exported_RSA_key_pair_coefficient = -1;
111
112 static gint proto_dcerpc_backupkey = -1;
113 /* Version information */
114
115
116 static e_uuid_t uuid_dcerpc_backupkey = {
117         0x3dde7c30, 0x165d, 0x11d1,
118         { 0xab, 0x8f, 0x00, 0x80, 0x5f, 0x14, 0xdb, 0x40 }
119 };
120 static guint16 ver_dcerpc_backupkey = 1;
121
122 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_header1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
123 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_header2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
124 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_certificate_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
125 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
126 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
127 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
128 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
129 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_public_exponent(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
130 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_public_exponent_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
131 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_modulus(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
132 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_modulus_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
133 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
134 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime1_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
135 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
136 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime2_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
137 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
138 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent1_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
139 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
140 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent2_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
141 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_coefficient(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
142 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_coefficient_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
143 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_private_exponent(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
144 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_private_exponent_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
145 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_cert(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
146 static int backupkey_dissect_element_bkrp_exported_RSA_key_pair_cert_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
147 static int backupkey_dissect_element_bkrp_dc_serverwrap_key_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
148 static int backupkey_dissect_element_bkrp_dc_serverwrap_key_key(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
149 static int backupkey_dissect_element_bkrp_dc_serverwrap_key_key_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
150 static int backupkey_dissect_element_bkrp_client_side_wrapped_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
151 static int backupkey_dissect_element_bkrp_client_side_wrapped_encrypted_secret_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
152 static int backupkey_dissect_element_bkrp_client_side_wrapped_access_check_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
153 static int backupkey_dissect_element_bkrp_client_side_wrapped_guid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
154 static int backupkey_dissect_element_bkrp_client_side_wrapped_encrypted_secret(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
155 static int backupkey_dissect_element_bkrp_client_side_wrapped_encrypted_secret_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
156 static int backupkey_dissect_element_bkrp_client_side_wrapped_access_check(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
157 static int backupkey_dissect_element_bkrp_client_side_wrapped_access_check_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
158 static int backupkey_dissect_element_bkrp_client_side_unwrapped_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
159 static int backupkey_dissect_element_bkrp_client_side_unwrapped_secret(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
160 static int backupkey_dissect_element_bkrp_client_side_unwrapped_secret_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
161 static int backupkey_dissect_element_bkrp_encrypted_secret_v2_secret_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
162 static int backupkey_dissect_element_bkrp_encrypted_secret_v2_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
163 static int backupkey_dissect_element_bkrp_encrypted_secret_v2_secret(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
164 static int backupkey_dissect_element_bkrp_encrypted_secret_v2_secret_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
165 static int backupkey_dissect_element_bkrp_encrypted_secret_v2_payload_key(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
166 static int backupkey_dissect_element_bkrp_encrypted_secret_v2_payload_key_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
167 static int backupkey_dissect_element_bkrp_encrypted_secret_v3_secret_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
168 static int backupkey_dissect_element_bkrp_encrypted_secret_v3_magic1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
169 static int backupkey_dissect_element_bkrp_encrypted_secret_v3_magic2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
170 static int backupkey_dissect_element_bkrp_encrypted_secret_v3_magic3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
171 static int backupkey_dissect_element_bkrp_encrypted_secret_v3_secret(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
172 static int backupkey_dissect_element_bkrp_encrypted_secret_v3_secret_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
173 static int backupkey_dissect_element_bkrp_encrypted_secret_v3_payload_key(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
174 static int backupkey_dissect_element_bkrp_encrypted_secret_v3_payload_key_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
175 static int backupkey_dissect_element_bkrp_access_check_v2_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
176 static int backupkey_dissect_element_bkrp_access_check_v2_nonce_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
177 static int backupkey_dissect_element_bkrp_access_check_v2_nonce(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
178 static int backupkey_dissect_element_bkrp_access_check_v2_nonce_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
179 static int backupkey_dissect_element_bkrp_access_check_v2_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
180 static int backupkey_dissect_element_bkrp_access_check_v2_hash(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
181 static int backupkey_dissect_element_bkrp_access_check_v2_hash_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
182 static int backupkey_dissect_element_bkrp_access_check_v3_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
183 static int backupkey_dissect_element_bkrp_access_check_v3_nonce_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
184 static int backupkey_dissect_element_bkrp_access_check_v3_nonce(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
185 static int backupkey_dissect_element_bkrp_access_check_v3_nonce_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
186 static int backupkey_dissect_element_bkrp_access_check_v3_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
187 static int backupkey_dissect_element_bkrp_access_check_v3_hash(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
188 static int backupkey_dissect_element_bkrp_access_check_v3_hash_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
189 const value_string backupkey_bkrp_guid_to_integer_vals[] = {
190         { BACKUPKEY_INVALID_GUID_INTEGER, "BACKUPKEY_INVALID_GUID_INTEGER" },
191         { BACKUPKEY_RESTORE_GUID_INTEGER, "BACKUPKEY_RESTORE_GUID_INTEGER" },
192         { BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER, "BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER" },
193 { 0, NULL }
194 };
195 static int backupkey_dissect_element_bkrp_data_in_blob_valBACKUPKEY_RESTORE_GUID_INTEGER_restore_req(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
196 static int backupkey_dissect_element_bkrp_data_in_blob_valBACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER_cert_req(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
197 static int backupkey_dissect_element_bkrp_BackupKey_guidActionAgent(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
198 static int backupkey_dissect_element_bkrp_BackupKey_guidActionAgent_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
199 static int backupkey_dissect_element_bkrp_BackupKey_data_in(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
200 static int backupkey_dissect_element_bkrp_BackupKey_data_in_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
201 static int backupkey_dissect_element_bkrp_BackupKey_data_in__(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
202 static int backupkey_dissect_element_bkrp_BackupKey_data_in_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
203 static int backupkey_dissect_element_bkrp_BackupKey_data_out(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
204 static int backupkey_dissect_element_bkrp_BackupKey_data_out_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
205 static int backupkey_dissect_element_bkrp_BackupKey_data_out__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
206 static int backupkey_dissect_element_bkrp_BackupKey_data_out___(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
207 static int backupkey_dissect_element_bkrp_BackupKey_data_out_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
208 static int backupkey_dissect_element_bkrp_BackupKey_data_out_len_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
209 static int backupkey_dissect_element_bkrp_BackupKey_param(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
210
211
212 /* IDL: struct { */
213 /* IDL:         [value(0x00000002)] uint32 header1; */
214 /* IDL:         [value(0x00000494)] uint32 header2; */
215 /* IDL:         uint32 certificate_len; */
216 /* IDL:         [value(0x00000207)] uint32 magic1; */
217 /* IDL:         [value(0x0000A400)] uint32 magic2; */
218 /* IDL:         [value(0x32415352)] uint32 magic3; */
219 /* IDL:         [value(0x00000800)] uint32 magic4; */
220 /* IDL:         [subcontext_size(4)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB public_exponent; */
221 /* IDL:         [subcontext_size(256)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB modulus; */
222 /* IDL:         [subcontext_size(128)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB prime1; */
223 /* IDL:         [subcontext_size(128)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB prime2; */
224 /* IDL:         [subcontext_size(128)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB exponent1; */
225 /* IDL:         [subcontext_size(128)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB exponent2; */
226 /* IDL:         [subcontext_size(128)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB coefficient; */
227 /* IDL:         [subcontext_size(256)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB private_exponent; */
228 /* IDL:         [subcontext_size(certificate_len)] [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB cert; */
229 /* IDL: } */
230
231 static int
232 backupkey_dissect_element_bkrp_exported_RSA_key_pair_header1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
233 {
234         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_header1, 0);
235
236         return offset;
237 }
238
239 static int
240 backupkey_dissect_element_bkrp_exported_RSA_key_pair_header2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
241 {
242         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_header2, 0);
243
244         return offset;
245 }
246
247 static int
248 backupkey_dissect_element_bkrp_exported_RSA_key_pair_certificate_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
249 {
250         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_certificate_len, 0);
251
252         return offset;
253 }
254
255 static int
256 backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
257 {
258         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_magic1, 0);
259
260         return offset;
261 }
262
263 static int
264 backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
265 {
266         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_magic2, 0);
267
268         return offset;
269 }
270
271 static int
272 backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
273 {
274         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_magic3, 0);
275
276         return offset;
277 }
278
279 static int
280 backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
281 {
282         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_magic4, 0);
283
284         return offset;
285 }
286
287 static int
288 backupkey_dissect_element_bkrp_exported_RSA_key_pair_public_exponent(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
289 {
290         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
291         guint0 size;
292         int conformant = di->conformant_run;
293         tvbuff_t *subtvb;
294
295         if (!conformant) {
296                 guint32 saved_flags = di->call_data->flags;
297                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_public_exponent_, &size);
298                 di->call_data->flags &= ~DCERPC_IS_NDR64;
299                 subtvb = tvb_new_subset(tvb, offset, size, -1);
300                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_public_exponent_(subtvb, 0, pinfo, tree, drep);
301                 offset += size;
302                 di->call_data->flags = saved_flags;
303         }
304
305         return offset;
306 }
307
308 static int
309 backupkey_dissect_element_bkrp_exported_RSA_key_pair_public_exponent_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
310 {
311         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_public_exponent, 1);
312
313         return offset;
314 }
315
316 static int
317 backupkey_dissect_element_bkrp_exported_RSA_key_pair_modulus(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
318 {
319         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
320         guint0 size;
321         int conformant = di->conformant_run;
322         tvbuff_t *subtvb;
323
324         if (!conformant) {
325                 guint32 saved_flags = di->call_data->flags;
326                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_modulus_, &size);
327                 di->call_data->flags &= ~DCERPC_IS_NDR64;
328                 subtvb = tvb_new_subset(tvb, offset, size, -1);
329                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_modulus_(subtvb, 0, pinfo, tree, drep);
330                 offset += size;
331                 di->call_data->flags = saved_flags;
332         }
333
334         return offset;
335 }
336
337 static int
338 backupkey_dissect_element_bkrp_exported_RSA_key_pair_modulus_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
339 {
340         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_modulus, 1);
341
342         return offset;
343 }
344
345 static int
346 backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
347 {
348         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
349         guint0 size;
350         int conformant = di->conformant_run;
351         tvbuff_t *subtvb;
352
353         if (!conformant) {
354                 guint32 saved_flags = di->call_data->flags;
355                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_prime1_, &size);
356                 di->call_data->flags &= ~DCERPC_IS_NDR64;
357                 subtvb = tvb_new_subset(tvb, offset, size, -1);
358                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime1_(subtvb, 0, pinfo, tree, drep);
359                 offset += size;
360                 di->call_data->flags = saved_flags;
361         }
362
363         return offset;
364 }
365
366 static int
367 backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime1_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
368 {
369         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_prime1, 1);
370
371         return offset;
372 }
373
374 static int
375 backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
376 {
377         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
378         guint0 size;
379         int conformant = di->conformant_run;
380         tvbuff_t *subtvb;
381
382         if (!conformant) {
383                 guint32 saved_flags = di->call_data->flags;
384                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_prime2_, &size);
385                 di->call_data->flags &= ~DCERPC_IS_NDR64;
386                 subtvb = tvb_new_subset(tvb, offset, size, -1);
387                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime2_(subtvb, 0, pinfo, tree, drep);
388                 offset += size;
389                 di->call_data->flags = saved_flags;
390         }
391
392         return offset;
393 }
394
395 static int
396 backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime2_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
397 {
398         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_prime2, 1);
399
400         return offset;
401 }
402
403 static int
404 backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
405 {
406         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
407         guint0 size;
408         int conformant = di->conformant_run;
409         tvbuff_t *subtvb;
410
411         if (!conformant) {
412                 guint32 saved_flags = di->call_data->flags;
413                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_exponent1_, &size);
414                 di->call_data->flags &= ~DCERPC_IS_NDR64;
415                 subtvb = tvb_new_subset(tvb, offset, size, -1);
416                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent1_(subtvb, 0, pinfo, tree, drep);
417                 offset += size;
418                 di->call_data->flags = saved_flags;
419         }
420
421         return offset;
422 }
423
424 static int
425 backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent1_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
426 {
427         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_exponent1, 1);
428
429         return offset;
430 }
431
432 static int
433 backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
434 {
435         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
436         guint0 size;
437         int conformant = di->conformant_run;
438         tvbuff_t *subtvb;
439
440         if (!conformant) {
441                 guint32 saved_flags = di->call_data->flags;
442                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_exponent2_, &size);
443                 di->call_data->flags &= ~DCERPC_IS_NDR64;
444                 subtvb = tvb_new_subset(tvb, offset, size, -1);
445                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent2_(subtvb, 0, pinfo, tree, drep);
446                 offset += size;
447                 di->call_data->flags = saved_flags;
448         }
449
450         return offset;
451 }
452
453 static int
454 backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent2_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
455 {
456         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_exponent2, 1);
457
458         return offset;
459 }
460
461 static int
462 backupkey_dissect_element_bkrp_exported_RSA_key_pair_coefficient(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
463 {
464         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
465         guint0 size;
466         int conformant = di->conformant_run;
467         tvbuff_t *subtvb;
468
469         if (!conformant) {
470                 guint32 saved_flags = di->call_data->flags;
471                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_coefficient_, &size);
472                 di->call_data->flags &= ~DCERPC_IS_NDR64;
473                 subtvb = tvb_new_subset(tvb, offset, size, -1);
474                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_coefficient_(subtvb, 0, pinfo, tree, drep);
475                 offset += size;
476                 di->call_data->flags = saved_flags;
477         }
478
479         return offset;
480 }
481
482 static int
483 backupkey_dissect_element_bkrp_exported_RSA_key_pair_coefficient_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
484 {
485         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_coefficient, 1);
486
487         return offset;
488 }
489
490 static int
491 backupkey_dissect_element_bkrp_exported_RSA_key_pair_private_exponent(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
492 {
493         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
494         guint0 size;
495         int conformant = di->conformant_run;
496         tvbuff_t *subtvb;
497
498         if (!conformant) {
499                 guint32 saved_flags = di->call_data->flags;
500                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_private_exponent_, &size);
501                 di->call_data->flags &= ~DCERPC_IS_NDR64;
502                 subtvb = tvb_new_subset(tvb, offset, size, -1);
503                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_private_exponent_(subtvb, 0, pinfo, tree, drep);
504                 offset += size;
505                 di->call_data->flags = saved_flags;
506         }
507
508         return offset;
509 }
510
511 static int
512 backupkey_dissect_element_bkrp_exported_RSA_key_pair_private_exponent_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
513 {
514         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_private_exponent, 1);
515
516         return offset;
517 }
518
519 static int
520 backupkey_dissect_element_bkrp_exported_RSA_key_pair_cert(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
521 {
522         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
523         guint0 size;
524         int conformant = di->conformant_run;
525         tvbuff_t *subtvb;
526
527         if (!conformant) {
528                 guint32 saved_flags = di->call_data->flags;
529                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_cert_, &size);
530                 di->call_data->flags &= ~DCERPC_IS_NDR64;
531                 subtvb = tvb_new_subset(tvb, offset, size, -1);
532                 backupkey_dissect_element_bkrp_exported_RSA_key_pair_cert_(subtvb, 0, pinfo, tree, drep);
533                 offset += size;
534                 di->call_data->flags = saved_flags;
535         }
536
537         return offset;
538 }
539
540 static int
541 backupkey_dissect_element_bkrp_exported_RSA_key_pair_cert_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
542 {
543         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_exported_RSA_key_pair_cert, 1);
544
545         return offset;
546 }
547
548 int
549 backupkey_dissect_struct_bkrp_exported_RSA_key_pair(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
550 {
551         proto_item *item = NULL;
552         proto_tree *tree = NULL;
553         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
554         int old_offset;
555
556         ALIGN_TO_4_BYTES;
557
558         old_offset = offset;
559
560         if (parent_tree) {
561                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
562                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_exported_RSA_key_pair);
563         }
564         
565         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_header1(tvb, offset, pinfo, tree, drep);
566
567         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_header2(tvb, offset, pinfo, tree, drep);
568
569         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_certificate_len(tvb, offset, pinfo, tree, drep);
570
571         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic1(tvb, offset, pinfo, tree, drep);
572
573         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic2(tvb, offset, pinfo, tree, drep);
574
575         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic3(tvb, offset, pinfo, tree, drep);
576
577         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_magic4(tvb, offset, pinfo, tree, drep);
578
579         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_public_exponent(tvb, offset, pinfo, tree, drep);
580
581         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_modulus(tvb, offset, pinfo, tree, drep);
582
583         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime1(tvb, offset, pinfo, tree, drep);
584
585         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_prime2(tvb, offset, pinfo, tree, drep);
586
587         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent1(tvb, offset, pinfo, tree, drep);
588
589         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_exponent2(tvb, offset, pinfo, tree, drep);
590
591         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_coefficient(tvb, offset, pinfo, tree, drep);
592
593         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_private_exponent(tvb, offset, pinfo, tree, drep);
594
595         offset = backupkey_dissect_element_bkrp_exported_RSA_key_pair_cert(tvb, offset, pinfo, tree, drep);
596
597
598         proto_item_set_len(item, offset-old_offset);
599
600
601         if (di->call_data->flags & DCERPC_IS_NDR64) {
602                 ALIGN_TO_4_BYTES;
603         }
604
605         return offset;
606 }
607
608
609 /* IDL: struct { */
610 /* IDL:         [value(0x00000001)] uint32 magic; */
611 /* IDL:         uint8 key[256]; */
612 /* IDL: } */
613
614 static int
615 backupkey_dissect_element_bkrp_dc_serverwrap_key_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
616 {
617         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_dc_serverwrap_key_magic, 0);
618
619         return offset;
620 }
621
622 static int
623 backupkey_dissect_element_bkrp_dc_serverwrap_key_key(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
624 {
625         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
626         int conformant = di->conformant_run;
627         if (!conformant) {
628                 offset = backupkey_dissect_element_bkrp_dc_serverwrap_key_key_(tvb, offset, 256, pinfo, tree, drep);
629         }
630
631         return offset;
632 }
633
634 static int
635 backupkey_dissect_element_bkrp_dc_serverwrap_key_key_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
636 {
637         proto_tree_add_bytes(tree, hf_backupkey_bkrp_dc_serverwrap_key_key, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
638
639         return offset;
640 }
641
642 int
643 backupkey_dissect_struct_bkrp_dc_serverwrap_key(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
644 {
645         proto_item *item = NULL;
646         proto_tree *tree = NULL;
647         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
648         int old_offset;
649
650         ALIGN_TO_4_BYTES;
651
652         old_offset = offset;
653
654         if (parent_tree) {
655                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
656                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_dc_serverwrap_key);
657         }
658         
659         offset = backupkey_dissect_element_bkrp_dc_serverwrap_key_magic(tvb, offset, pinfo, tree, drep);
660
661         offset = backupkey_dissect_element_bkrp_dc_serverwrap_key_key(tvb, offset, pinfo, tree, drep);
662
663
664         proto_item_set_len(item, offset-old_offset);
665
666
667         if (di->call_data->flags & DCERPC_IS_NDR64) {
668                 ALIGN_TO_4_BYTES;
669         }
670
671         return offset;
672 }
673
674
675 /* IDL: struct { */
676 /* IDL:         uint32 version; */
677 /* IDL:         uint32 encrypted_secret_len; */
678 /* IDL:         uint32 access_check_len; */
679 /* IDL:         GUID guid; */
680 /* IDL:         uint8 encrypted_secret[encrypted_secret_len]; */
681 /* IDL:         uint8 access_check[access_check_len]; */
682 /* IDL: } */
683
684 static int
685 backupkey_dissect_element_bkrp_client_side_wrapped_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
686 {
687         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_wrapped_version, 0);
688
689         return offset;
690 }
691
692 static int
693 backupkey_dissect_element_bkrp_client_side_wrapped_encrypted_secret_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
694 {
695         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_wrapped_encrypted_secret_len, 0);
696
697         return offset;
698 }
699
700 static int
701 backupkey_dissect_element_bkrp_client_side_wrapped_access_check_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
702 {
703         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_wrapped_access_check_len, 0);
704
705         return offset;
706 }
707
708 static int
709 backupkey_dissect_element_bkrp_client_side_wrapped_guid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
710 {
711         offset = dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_wrapped_guid, NULL);
712
713         return offset;
714 }
715
716 static int
717 backupkey_dissect_element_bkrp_client_side_wrapped_encrypted_secret(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
718 {
719
720         return offset;
721 }
722
723 static int
724 backupkey_dissect_element_bkrp_client_side_wrapped_encrypted_secret_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
725 {
726         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_wrapped_encrypted_secret, 0);
727
728         return offset;
729 }
730
731 static int
732 backupkey_dissect_element_bkrp_client_side_wrapped_access_check(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
733 {
734
735         return offset;
736 }
737
738 static int
739 backupkey_dissect_element_bkrp_client_side_wrapped_access_check_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
740 {
741         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_wrapped_access_check, 0);
742
743         return offset;
744 }
745
746 int
747 backupkey_dissect_struct_bkrp_client_side_wrapped(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
748 {
749         proto_item *item = NULL;
750         proto_tree *tree = NULL;
751         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
752         int old_offset;
753
754         ALIGN_TO_4_BYTES;
755
756         old_offset = offset;
757
758         if (parent_tree) {
759                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
760                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_client_side_wrapped);
761         }
762         
763         offset = backupkey_dissect_element_bkrp_client_side_wrapped_version(tvb, offset, pinfo, tree, drep);
764
765         offset = backupkey_dissect_element_bkrp_client_side_wrapped_encrypted_secret_len(tvb, offset, pinfo, tree, drep);
766
767         offset = backupkey_dissect_element_bkrp_client_side_wrapped_access_check_len(tvb, offset, pinfo, tree, drep);
768
769         offset = backupkey_dissect_element_bkrp_client_side_wrapped_guid(tvb, offset, pinfo, tree, drep);
770
771         offset = backupkey_dissect_element_bkrp_client_side_wrapped_encrypted_secret(tvb, offset, pinfo, tree, drep);
772
773         offset = backupkey_dissect_element_bkrp_client_side_wrapped_access_check(tvb, offset, pinfo, tree, drep);
774
775
776         proto_item_set_len(item, offset-old_offset);
777
778
779         if (di->call_data->flags & DCERPC_IS_NDR64) {
780                 ALIGN_TO_4_BYTES;
781         }
782
783         return offset;
784 }
785
786
787 /* IDL: struct { */
788 /* IDL:         [value(0x00000000)] uint32 magic; */
789 /* IDL:         [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB secret; */
790 /* IDL: } */
791
792 static int
793 backupkey_dissect_element_bkrp_client_side_unwrapped_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
794 {
795         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_unwrapped_magic, 0);
796
797         return offset;
798 }
799
800 static int
801 backupkey_dissect_element_bkrp_client_side_unwrapped_secret(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
802 {
803         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
804         guint0 size;
805         int conformant = di->conformant_run;
806         tvbuff_t *subtvb;
807
808         if (!conformant) {
809                 guint32 saved_flags = di->call_data->flags;
810                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_unwrapped_secret_, &size);
811                 di->call_data->flags &= ~DCERPC_IS_NDR64;
812                 subtvb = tvb_new_subset(tvb, offset, size, -1);
813                 backupkey_dissect_element_bkrp_client_side_unwrapped_secret_(subtvb, 0, pinfo, tree, drep);
814                 offset += size;
815                 di->call_data->flags = saved_flags;
816         }
817
818         return offset;
819 }
820
821 static int
822 backupkey_dissect_element_bkrp_client_side_unwrapped_secret_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
823 {
824         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_client_side_unwrapped_secret, 1);
825
826         return offset;
827 }
828
829 int
830 backupkey_dissect_struct_bkrp_client_side_unwrapped(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
831 {
832         proto_item *item = NULL;
833         proto_tree *tree = NULL;
834         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
835         int old_offset;
836
837         ALIGN_TO_4_BYTES;
838
839         old_offset = offset;
840
841         if (parent_tree) {
842                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
843                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_client_side_unwrapped);
844         }
845         
846         offset = backupkey_dissect_element_bkrp_client_side_unwrapped_magic(tvb, offset, pinfo, tree, drep);
847
848         offset = backupkey_dissect_element_bkrp_client_side_unwrapped_secret(tvb, offset, pinfo, tree, drep);
849
850
851         proto_item_set_len(item, offset-old_offset);
852
853
854         if (di->call_data->flags & DCERPC_IS_NDR64) {
855                 ALIGN_TO_4_BYTES;
856         }
857
858         return offset;
859 }
860
861
862 /* IDL: struct { */
863 /* IDL:         uint32 secret_len; */
864 /* IDL:         [value(0x00000020)] uint32 magic; */
865 /* IDL:         uint8 secret[secret_len]; */
866 /* IDL:         uint8 payload_key[32]; */
867 /* IDL: } */
868
869 static int
870 backupkey_dissect_element_bkrp_encrypted_secret_v2_secret_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
871 {
872         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_encrypted_secret_v2_secret_len, 0);
873
874         return offset;
875 }
876
877 static int
878 backupkey_dissect_element_bkrp_encrypted_secret_v2_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
879 {
880         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_encrypted_secret_v2_magic, 0);
881
882         return offset;
883 }
884
885 static int
886 backupkey_dissect_element_bkrp_encrypted_secret_v2_secret(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
887 {
888
889         return offset;
890 }
891
892 static int
893 backupkey_dissect_element_bkrp_encrypted_secret_v2_secret_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
894 {
895         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_encrypted_secret_v2_secret, 0);
896
897         return offset;
898 }
899
900 static int
901 backupkey_dissect_element_bkrp_encrypted_secret_v2_payload_key(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
902 {
903         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
904         int conformant = di->conformant_run;
905         if (!conformant) {
906                 offset = backupkey_dissect_element_bkrp_encrypted_secret_v2_payload_key_(tvb, offset, 32, pinfo, tree, drep);
907         }
908
909         return offset;
910 }
911
912 static int
913 backupkey_dissect_element_bkrp_encrypted_secret_v2_payload_key_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
914 {
915         proto_tree_add_bytes(tree, hf_backupkey_bkrp_encrypted_secret_v2_payload_key, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
916
917         return offset;
918 }
919
920 int
921 backupkey_dissect_struct_bkrp_encrypted_secret_v2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
922 {
923         proto_item *item = NULL;
924         proto_tree *tree = NULL;
925         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
926         int old_offset;
927
928         ALIGN_TO_4_BYTES;
929
930         old_offset = offset;
931
932         if (parent_tree) {
933                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
934                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_encrypted_secret_v2);
935         }
936         
937         offset = backupkey_dissect_element_bkrp_encrypted_secret_v2_secret_len(tvb, offset, pinfo, tree, drep);
938
939         offset = backupkey_dissect_element_bkrp_encrypted_secret_v2_magic(tvb, offset, pinfo, tree, drep);
940
941         offset = backupkey_dissect_element_bkrp_encrypted_secret_v2_secret(tvb, offset, pinfo, tree, drep);
942
943         offset = backupkey_dissect_element_bkrp_encrypted_secret_v2_payload_key(tvb, offset, pinfo, tree, drep);
944
945
946         proto_item_set_len(item, offset-old_offset);
947
948
949         if (di->call_data->flags & DCERPC_IS_NDR64) {
950                 ALIGN_TO_4_BYTES;
951         }
952
953         return offset;
954 }
955
956
957 /* IDL: struct { */
958 /* IDL:         uint32 secret_len; */
959 /* IDL:         [value(0x00000030)] uint32 magic1; */
960 /* IDL:         [value(0x00006610)] uint32 magic2; */
961 /* IDL:         [value(0x0000800e)] uint32 magic3; */
962 /* IDL:         uint8 secret[secret_len]; */
963 /* IDL:         uint8 payload_key[48]; */
964 /* IDL: } */
965
966 static int
967 backupkey_dissect_element_bkrp_encrypted_secret_v3_secret_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
968 {
969         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_encrypted_secret_v3_secret_len, 0);
970
971         return offset;
972 }
973
974 static int
975 backupkey_dissect_element_bkrp_encrypted_secret_v3_magic1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
976 {
977         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_encrypted_secret_v3_magic1, 0);
978
979         return offset;
980 }
981
982 static int
983 backupkey_dissect_element_bkrp_encrypted_secret_v3_magic2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
984 {
985         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_encrypted_secret_v3_magic2, 0);
986
987         return offset;
988 }
989
990 static int
991 backupkey_dissect_element_bkrp_encrypted_secret_v3_magic3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
992 {
993         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_encrypted_secret_v3_magic3, 0);
994
995         return offset;
996 }
997
998 static int
999 backupkey_dissect_element_bkrp_encrypted_secret_v3_secret(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1000 {
1001
1002         return offset;
1003 }
1004
1005 static int
1006 backupkey_dissect_element_bkrp_encrypted_secret_v3_secret_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1007 {
1008         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_encrypted_secret_v3_secret, 0);
1009
1010         return offset;
1011 }
1012
1013 static int
1014 backupkey_dissect_element_bkrp_encrypted_secret_v3_payload_key(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1015 {
1016         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1017         int conformant = di->conformant_run;
1018         if (!conformant) {
1019                 offset = backupkey_dissect_element_bkrp_encrypted_secret_v3_payload_key_(tvb, offset, 48, pinfo, tree, drep);
1020         }
1021
1022         return offset;
1023 }
1024
1025 static int
1026 backupkey_dissect_element_bkrp_encrypted_secret_v3_payload_key_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1027 {
1028         proto_tree_add_bytes(tree, hf_backupkey_bkrp_encrypted_secret_v3_payload_key, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1029
1030         return offset;
1031 }
1032
1033 int
1034 backupkey_dissect_struct_bkrp_encrypted_secret_v3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1035 {
1036         proto_item *item = NULL;
1037         proto_tree *tree = NULL;
1038         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1039         int old_offset;
1040
1041         ALIGN_TO_4_BYTES;
1042
1043         old_offset = offset;
1044
1045         if (parent_tree) {
1046                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1047                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_encrypted_secret_v3);
1048         }
1049         
1050         offset = backupkey_dissect_element_bkrp_encrypted_secret_v3_secret_len(tvb, offset, pinfo, tree, drep);
1051
1052         offset = backupkey_dissect_element_bkrp_encrypted_secret_v3_magic1(tvb, offset, pinfo, tree, drep);
1053
1054         offset = backupkey_dissect_element_bkrp_encrypted_secret_v3_magic2(tvb, offset, pinfo, tree, drep);
1055
1056         offset = backupkey_dissect_element_bkrp_encrypted_secret_v3_magic3(tvb, offset, pinfo, tree, drep);
1057
1058         offset = backupkey_dissect_element_bkrp_encrypted_secret_v3_secret(tvb, offset, pinfo, tree, drep);
1059
1060         offset = backupkey_dissect_element_bkrp_encrypted_secret_v3_payload_key(tvb, offset, pinfo, tree, drep);
1061
1062
1063         proto_item_set_len(item, offset-old_offset);
1064
1065
1066         if (di->call_data->flags & DCERPC_IS_NDR64) {
1067                 ALIGN_TO_4_BYTES;
1068         }
1069
1070         return offset;
1071 }
1072
1073
1074 /* IDL: struct { */
1075 /* IDL:         [value(0x00000001)] uint32 magic; */
1076 /* IDL:         uint32 nonce_len; */
1077 /* IDL:         uint8 nonce[nonce_len]; */
1078 /* IDL:         dom_sid sid; */
1079 /* IDL:         uint8 hash[20]; */
1080 /* IDL: } */
1081
1082 static int
1083 backupkey_dissect_element_bkrp_access_check_v2_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1084 {
1085         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_access_check_v2_magic, 0);
1086
1087         return offset;
1088 }
1089
1090 static int
1091 backupkey_dissect_element_bkrp_access_check_v2_nonce_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1092 {
1093         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_access_check_v2_nonce_len, 0);
1094
1095         return offset;
1096 }
1097
1098 static int
1099 backupkey_dissect_element_bkrp_access_check_v2_nonce(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1100 {
1101
1102         return offset;
1103 }
1104
1105 static int
1106 backupkey_dissect_element_bkrp_access_check_v2_nonce_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1107 {
1108         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_access_check_v2_nonce, 0);
1109
1110         return offset;
1111 }
1112
1113 static int
1114 backupkey_dissect_element_bkrp_access_check_v2_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1115 {
1116         offset = backupkey_dissect_struct_dom_sid(tvb,offset,pinfo,tree,drep,hf_backupkey_bkrp_access_check_v2_sid,0);
1117
1118         return offset;
1119 }
1120
1121 static int
1122 backupkey_dissect_element_bkrp_access_check_v2_hash(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1123 {
1124         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1125         int conformant = di->conformant_run;
1126         if (!conformant) {
1127                 offset = backupkey_dissect_element_bkrp_access_check_v2_hash_(tvb, offset, 20, pinfo, tree, drep);
1128         }
1129
1130         return offset;
1131 }
1132
1133 static int
1134 backupkey_dissect_element_bkrp_access_check_v2_hash_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1135 {
1136         proto_tree_add_bytes(tree, hf_backupkey_bkrp_access_check_v2_hash, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1137
1138         return offset;
1139 }
1140
1141 int
1142 backupkey_dissect_struct_bkrp_access_check_v2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1143 {
1144         proto_item *item = NULL;
1145         proto_tree *tree = NULL;
1146         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1147         int old_offset;
1148
1149         ALIGN_TO_4_BYTES;
1150
1151         old_offset = offset;
1152
1153         if (parent_tree) {
1154                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1155                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_access_check_v2);
1156         }
1157         
1158         offset = backupkey_dissect_element_bkrp_access_check_v2_magic(tvb, offset, pinfo, tree, drep);
1159
1160         offset = backupkey_dissect_element_bkrp_access_check_v2_nonce_len(tvb, offset, pinfo, tree, drep);
1161
1162         offset = backupkey_dissect_element_bkrp_access_check_v2_nonce(tvb, offset, pinfo, tree, drep);
1163
1164         offset = backupkey_dissect_element_bkrp_access_check_v2_sid(tvb, offset, pinfo, tree, drep);
1165
1166         offset = backupkey_dissect_element_bkrp_access_check_v2_hash(tvb, offset, pinfo, tree, drep);
1167
1168
1169         proto_item_set_len(item, offset-old_offset);
1170
1171
1172         if (di->call_data->flags & DCERPC_IS_NDR64) {
1173                 ALIGN_TO_4_BYTES;
1174         }
1175
1176         return offset;
1177 }
1178
1179
1180 /* IDL: struct { */
1181 /* IDL:         [value(0x00000001)] uint32 magic; */
1182 /* IDL:         uint32 nonce_len; */
1183 /* IDL:         uint8 nonce[nonce_len]; */
1184 /* IDL:         dom_sid sid; */
1185 /* IDL:         uint8 hash[64]; */
1186 /* IDL: } */
1187
1188 static int
1189 backupkey_dissect_element_bkrp_access_check_v3_magic(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1190 {
1191         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_access_check_v3_magic, 0);
1192
1193         return offset;
1194 }
1195
1196 static int
1197 backupkey_dissect_element_bkrp_access_check_v3_nonce_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1198 {
1199         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_access_check_v3_nonce_len, 0);
1200
1201         return offset;
1202 }
1203
1204 static int
1205 backupkey_dissect_element_bkrp_access_check_v3_nonce(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1206 {
1207
1208         return offset;
1209 }
1210
1211 static int
1212 backupkey_dissect_element_bkrp_access_check_v3_nonce_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1213 {
1214         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_access_check_v3_nonce, 0);
1215
1216         return offset;
1217 }
1218
1219 static int
1220 backupkey_dissect_element_bkrp_access_check_v3_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1221 {
1222         offset = backupkey_dissect_struct_dom_sid(tvb,offset,pinfo,tree,drep,hf_backupkey_bkrp_access_check_v3_sid,0);
1223
1224         return offset;
1225 }
1226
1227 static int
1228 backupkey_dissect_element_bkrp_access_check_v3_hash(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1229 {
1230         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1231         int conformant = di->conformant_run;
1232         if (!conformant) {
1233                 offset = backupkey_dissect_element_bkrp_access_check_v3_hash_(tvb, offset, 64, pinfo, tree, drep);
1234         }
1235
1236         return offset;
1237 }
1238
1239 static int
1240 backupkey_dissect_element_bkrp_access_check_v3_hash_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1241 {
1242         proto_tree_add_bytes(tree, hf_backupkey_bkrp_access_check_v3_hash, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1243
1244         return offset;
1245 }
1246
1247 int
1248 backupkey_dissect_struct_bkrp_access_check_v3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1249 {
1250         proto_item *item = NULL;
1251         proto_tree *tree = NULL;
1252         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1253         int old_offset;
1254
1255         ALIGN_TO_4_BYTES;
1256
1257         old_offset = offset;
1258
1259         if (parent_tree) {
1260                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1261                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_access_check_v3);
1262         }
1263         
1264         offset = backupkey_dissect_element_bkrp_access_check_v3_magic(tvb, offset, pinfo, tree, drep);
1265
1266         offset = backupkey_dissect_element_bkrp_access_check_v3_nonce_len(tvb, offset, pinfo, tree, drep);
1267
1268         offset = backupkey_dissect_element_bkrp_access_check_v3_nonce(tvb, offset, pinfo, tree, drep);
1269
1270         offset = backupkey_dissect_element_bkrp_access_check_v3_sid(tvb, offset, pinfo, tree, drep);
1271
1272         offset = backupkey_dissect_element_bkrp_access_check_v3_hash(tvb, offset, pinfo, tree, drep);
1273
1274
1275         proto_item_set_len(item, offset-old_offset);
1276
1277
1278         if (di->call_data->flags & DCERPC_IS_NDR64) {
1279                 ALIGN_TO_4_BYTES;
1280         }
1281
1282         return offset;
1283 }
1284
1285
1286 /* IDL: enum { */
1287 /* IDL:         BACKUPKEY_INVALID_GUID_INTEGER=0xFFFF, */
1288 /* IDL:         BACKUPKEY_RESTORE_GUID_INTEGER=0x0000, */
1289 /* IDL:         BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER=0x0001, */
1290 /* IDL: } */
1291
1292 int
1293 backupkey_dissect_enum_bkrp_guid_to_integer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
1294 {
1295         guint1632 parameter=0;
1296         if(param){
1297                 parameter=(guint1632)*param;
1298         }
1299         offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
1300         if(param){
1301                 *param=(guint32)parameter;
1302         }
1303         return offset;
1304 }
1305
1306
1307 /* IDL: [nodiscriminant(1)] union { */
1308 /* IDL: [case(BACKUPKEY_RESTORE_GUID_INTEGER)] [case(BACKUPKEY_RESTORE_GUID_INTEGER)] bkrp_client_side_wrapped restore_req; */
1309 /* IDL: [case(BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER)] [case(BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER)] bkrp_client_side_wrapped cert_req; */
1310 /* IDL: } */
1311
1312 static int
1313 backupkey_dissect_element_bkrp_data_in_blob_valBACKUPKEY_RESTORE_GUID_INTEGER_restore_req(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1314 {
1315         offset = backupkey_dissect_struct_bkrp_client_side_wrapped(tvb,offset,pinfo,tree,drep,hf_backupkey_bkrp_data_in_blob_valBACKUPKEY_RESTORE_GUID_INTEGER_restore_req,0);
1316
1317         return offset;
1318 }
1319
1320 static int
1321 backupkey_dissect_element_bkrp_data_in_blob_valBACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER_cert_req(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1322 {
1323         offset = backupkey_dissect_struct_bkrp_client_side_wrapped(tvb,offset,pinfo,tree,drep,hf_backupkey_bkrp_data_in_blob_valBACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER_cert_req,0);
1324
1325         return offset;
1326 }
1327
1328 static int
1329 backupkey_dissect_bkrp_data_in_blob(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1330 {
1331         proto_item *item = NULL;
1332         proto_tree *tree = NULL;
1333         int old_offset;
1334         guint32 level = param;
1335
1336         old_offset = offset;
1337         if (parent_tree) {
1338                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "bkrp_data_in_blob");
1339                 tree = proto_item_add_subtree(item, ett_backupkey_bkrp_data_in_blob);
1340         }
1341
1342         switch(level) {
1343                 case BACKUPKEY_RESTORE_GUID_INTEGER:
1344                         offset = backupkey_dissect_element_bkrp_data_in_blob_valBACKUPKEY_RESTORE_GUID_INTEGER_restore_req(tvb, offset, pinfo, tree, drep);
1345                 break;
1346
1347                 case BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER:
1348                         offset = backupkey_dissect_element_bkrp_data_in_blob_valBACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER_cert_req(tvb, offset, pinfo, tree, drep);
1349                 break;
1350         }
1351         proto_item_set_len(item, offset-old_offset);
1352
1353
1354         return offset;
1355 }
1356 static int
1357 backupkey_dissect_element_bkrp_BackupKey_guidActionAgent(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1358 {
1359         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, backupkey_dissect_element_bkrp_BackupKey_guidActionAgent_, NDR_POINTER_REF, "Pointer to Guidactionagent (GUID)",hf_backupkey_bkrp_BackupKey_guidActionAgent);
1360
1361         return offset;
1362 }
1363
1364 static int
1365 backupkey_dissect_element_bkrp_BackupKey_guidActionAgent_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1366 {
1367         offset = dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_BackupKey_guidActionAgent, NULL);
1368
1369         return offset;
1370 }
1371
1372 static int
1373 backupkey_dissect_element_bkrp_BackupKey_data_in(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1374 {
1375         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, backupkey_dissect_element_bkrp_BackupKey_data_in_, NDR_POINTER_REF, "Pointer to Data In (uint8)",hf_backupkey_bkrp_BackupKey_data_in);
1376
1377         return offset;
1378 }
1379
1380 static int
1381 backupkey_dissect_element_bkrp_BackupKey_data_in_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1382 {
1383         offset = dissect_ndr_ucarray_block(tvb, offset, pinfo, tree, drep, backupkey_dissect_element_bkrp_BackupKey_data_in__);
1384
1385         return offset;
1386 }
1387
1388 static int
1389 backupkey_dissect_element_bkrp_BackupKey_data_in__(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1390 {
1391         proto_tree_add_bytes(tree, hf_backupkey_bkrp_BackupKey_data_in, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1392
1393         return offset;
1394 }
1395
1396 static int
1397 backupkey_dissect_element_bkrp_BackupKey_data_in_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1398 {
1399         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_BackupKey_data_in_len, 0);
1400
1401         return offset;
1402 }
1403
1404 static int
1405 backupkey_dissect_element_bkrp_BackupKey_data_out(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1406 {
1407         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, backupkey_dissect_element_bkrp_BackupKey_data_out_, NDR_POINTER_REF, "Pointer to Data Out (uint8)",hf_backupkey_bkrp_BackupKey_data_out);
1408
1409         return offset;
1410 }
1411
1412 static int
1413 backupkey_dissect_element_bkrp_BackupKey_data_out_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1414 {
1415         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, backupkey_dissect_element_bkrp_BackupKey_data_out__, NDR_POINTER_UNIQUE, "Pointer to Data Out (uint8)",hf_backupkey_bkrp_BackupKey_data_out);
1416
1417         return offset;
1418 }
1419
1420 static int
1421 backupkey_dissect_element_bkrp_BackupKey_data_out__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1422 {
1423         offset = dissect_ndr_ucarray_block(tvb, offset, pinfo, tree, drep, backupkey_dissect_element_bkrp_BackupKey_data_out___);
1424
1425         return offset;
1426 }
1427
1428 static int
1429 backupkey_dissect_element_bkrp_BackupKey_data_out___(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1430 {
1431         proto_tree_add_bytes(tree, hf_backupkey_bkrp_BackupKey_data_out, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1432
1433         return offset;
1434 }
1435
1436 static int
1437 backupkey_dissect_element_bkrp_BackupKey_data_out_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1438 {
1439         offset = dissect_ndr_toplevel_pointer(tvb, offset, pinfo, tree, drep, backupkey_dissect_element_bkrp_BackupKey_data_out_len_, NDR_POINTER_REF, "Pointer to Data Out Len (uint32)",hf_backupkey_bkrp_BackupKey_data_out_len);
1440
1441         return offset;
1442 }
1443
1444 static int
1445 backupkey_dissect_element_bkrp_BackupKey_data_out_len_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1446 {
1447         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_BackupKey_data_out_len, 0);
1448
1449         return offset;
1450 }
1451
1452 static int
1453 backupkey_dissect_element_bkrp_BackupKey_param(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1454 {
1455         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_bkrp_BackupKey_param, 0);
1456
1457         return offset;
1458 }
1459
1460 /* IDL: WERROR bkrp_BackupKey( */
1461 /* IDL: [in] [ref] GUID *guidActionAgent, */
1462 /* IDL: [ref] [in] [size_is(data_in_len)] uint8 *data_in, */
1463 /* IDL: [in] uint32 data_in_len, */
1464 /* IDL: [out] [ref] [size_is(,*data_out_len)] uint8 **data_out, */
1465 /* IDL: [out] [ref] uint32 *data_out_len, */
1466 /* IDL: [in] uint32 param */
1467 /* IDL: ); */
1468
1469 static int
1470 backupkey_dissect_bkrp_BackupKey_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1471 {
1472         guint32 status;
1473
1474         pinfo->dcerpc_procedure_name="bkrp_BackupKey";
1475         offset = backupkey_dissect_element_bkrp_BackupKey_data_out(tvb, offset, pinfo, tree, drep);
1476         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1477
1478         offset = backupkey_dissect_element_bkrp_BackupKey_data_out_len(tvb, offset, pinfo, tree, drep);
1479         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1480
1481         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_backupkey_werror, &status);
1482
1483         if (status != 0)
1484                 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown DOS error 0x%08x"));
1485
1486         return offset;
1487 }
1488
1489 static int
1490 backupkey_dissect_bkrp_BackupKey_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1491 {
1492         pinfo->dcerpc_procedure_name="bkrp_BackupKey";
1493         offset = backupkey_dissect_element_bkrp_BackupKey_guidActionAgent(tvb, offset, pinfo, tree, drep);
1494         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1495         offset = backupkey_dissect_element_bkrp_BackupKey_data_in(tvb, offset, pinfo, tree, drep);
1496         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1497         offset = backupkey_dissect_element_bkrp_BackupKey_data_in_len(tvb, offset, pinfo, tree, drep);
1498         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1499         offset = backupkey_dissect_element_bkrp_BackupKey_param(tvb, offset, pinfo, tree, drep);
1500         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1501         return offset;
1502 }
1503
1504
1505 static dcerpc_sub_dissector backupkey_dissectors[] = {
1506         { 0, "bkrp_BackupKey",
1507            backupkey_dissect_bkrp_BackupKey_request, backupkey_dissect_bkrp_BackupKey_response},
1508         { 0, NULL, NULL, NULL }
1509 };
1510
1511 void proto_register_dcerpc_backupkey(void)
1512 {
1513         static hf_register_info hf[] = {
1514         { &hf_backupkey_bkrp_data_in_blob_valBACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER_cert_req,
1515           { "Cert Req", "backupkey.bkrp_data_in_blob_valBACKUPKEY_RETRIEVE_BACKUP_KEY_GUID_INTEGER.cert_req", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1516         { &hf_backupkey_bkrp_access_check_v2_nonce,
1517           { "Nonce", "backupkey.bkrp_access_check_v2.nonce", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1518         { &hf_backupkey_bkrp_client_side_wrapped_access_check_len,
1519           { "Access Check Len", "backupkey.bkrp_client_side_wrapped.access_check_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1520         { &hf_backupkey_bkrp_data_in_blob_valBACKUPKEY_RESTORE_GUID_INTEGER_restore_req,
1521           { "Restore Req", "backupkey.bkrp_data_in_blob_valBACKUPKEY_RESTORE_GUID_INTEGER.restore_req", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1522         { &hf_backupkey_bkrp_exported_RSA_key_pair_prime2,
1523           { "Prime2", "backupkey.bkrp_exported_RSA_key_pair.prime2", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1524         { &hf_backupkey_bkrp_encrypted_secret_v3_payload_key,
1525           { "Payload Key", "backupkey.bkrp_encrypted_secret_v3.payload_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1526         { &hf_backupkey_bkrp_client_side_wrapped_guid,
1527           { "Guid", "backupkey.bkrp_client_side_wrapped.guid", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }},
1528         { &hf_backupkey_bkrp_exported_RSA_key_pair_modulus_,
1529           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1530         { &hf_backupkey_bkrp_exported_RSA_key_pair_public_exponent_,
1531           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1532         { &hf_backupkey_bkrp_exported_RSA_key_pair_header1,
1533           { "Header1", "backupkey.bkrp_exported_RSA_key_pair.header1", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1534         { &hf_backupkey_bkrp_exported_RSA_key_pair_certificate_len,
1535           { "Certificate Len", "backupkey.bkrp_exported_RSA_key_pair.certificate_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1536         { &hf_backupkey_bkrp_exported_RSA_key_pair_coefficient_,
1537           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1538         { &hf_backupkey_bkrp_dc_serverwrap_key_magic,
1539           { "Magic", "backupkey.bkrp_dc_serverwrap_key.magic", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1540         { &hf_backupkey_bkrp_exported_RSA_key_pair_magic2,
1541           { "Magic2", "backupkey.bkrp_exported_RSA_key_pair.magic2", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1542         { &hf_backupkey_bkrp_client_side_unwrapped_secret_,
1543           { "Subcontext length", "backupkey.bkrp_client_side_unwrapped.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1544         { &hf_backupkey_bkrp_exported_RSA_key_pair_private_exponent_,
1545           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1546         { &hf_backupkey_bkrp_client_side_wrapped_encrypted_secret_len,
1547           { "Encrypted Secret Len", "backupkey.bkrp_client_side_wrapped.encrypted_secret_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1548         { &hf_backupkey_bkrp_client_side_unwrapped_magic,
1549           { "Magic", "backupkey.bkrp_client_side_unwrapped.magic", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1550         { &hf_backupkey_bkrp_exported_RSA_key_pair_exponent1_,
1551           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1552         { &hf_backupkey_bkrp_encrypted_secret_v3_magic3,
1553           { "Magic3", "backupkey.bkrp_encrypted_secret_v3.magic3", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1554         { &hf_backupkey_bkrp_client_side_wrapped_access_check,
1555           { "Access Check", "backupkey.bkrp_client_side_wrapped.access_check", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1556         { &hf_backupkey_bkrp_exported_RSA_key_pair_magic1,
1557           { "Magic1", "backupkey.bkrp_exported_RSA_key_pair.magic1", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1558         { &hf_backupkey_bkrp_encrypted_secret_v3_secret_len,
1559           { "Secret Len", "backupkey.bkrp_encrypted_secret_v3.secret_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1560         { &hf_backupkey_bkrp_client_side_wrapped_encrypted_secret,
1561           { "Encrypted Secret", "backupkey.bkrp_client_side_wrapped.encrypted_secret", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1562         { &hf_backupkey_bkrp_BackupKey_guidActionAgent,
1563           { "Guidactionagent", "backupkey.bkrp_BackupKey.guidActionAgent", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }},
1564         { &hf_backupkey_bkrp_exported_RSA_key_pair_prime1,
1565           { "Prime1", "backupkey.bkrp_exported_RSA_key_pair.prime1", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1566         { &hf_backupkey_bkrp_access_check_v2_magic,
1567           { "Magic", "backupkey.bkrp_access_check_v2.magic", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1568         { &hf_backupkey_bkrp_encrypted_secret_v3_magic1,
1569           { "Magic1", "backupkey.bkrp_encrypted_secret_v3.magic1", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1570         { &hf_backupkey_bkrp_exported_RSA_key_pair_exponent2,
1571           { "Exponent2", "backupkey.bkrp_exported_RSA_key_pair.exponent2", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1572         { &hf_backupkey_bkrp_client_side_unwrapped_secret,
1573           { "Secret", "backupkey.bkrp_client_side_unwrapped.secret", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1574         { &hf_backupkey_bkrp_access_check_v3_sid,
1575           { "Sid", "backupkey.bkrp_access_check_v3.sid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1576         { &hf_backupkey_bkrp_access_check_v2_sid,
1577           { "Sid", "backupkey.bkrp_access_check_v2.sid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1578         { &hf_backupkey_bkrp_exported_RSA_key_pair_header2,
1579           { "Header2", "backupkey.bkrp_exported_RSA_key_pair.header2", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1580         { &hf_backupkey_bkrp_BackupKey_data_out_len,
1581           { "Data Out Len", "backupkey.bkrp_BackupKey.data_out_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1582         { &hf_backupkey_bkrp_client_side_wrapped_version,
1583           { "Version", "backupkey.bkrp_client_side_wrapped.version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1584         { &hf_backupkey_bkrp_exported_RSA_key_pair_public_exponent,
1585           { "Public Exponent", "backupkey.bkrp_exported_RSA_key_pair.public_exponent", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1586         { &hf_backupkey_bkrp_BackupKey_param,
1587           { "Param", "backupkey.bkrp_BackupKey.param", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1588         { &hf_backupkey_werror,
1589           { "Windows Error", "backupkey.werror", FT_UINT32, BASE_HEX, VALS(WERR_errors), 0, NULL, HFILL }},
1590         { &hf_backupkey_bkrp_dc_serverwrap_key_key,
1591           { "Key", "backupkey.bkrp_dc_serverwrap_key.key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1592         { &hf_backupkey_bkrp_encrypted_secret_v2_secret,
1593           { "Secret", "backupkey.bkrp_encrypted_secret_v2.secret", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1594         { &hf_backupkey_bkrp_encrypted_secret_v2_secret_len,
1595           { "Secret Len", "backupkey.bkrp_encrypted_secret_v2.secret_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1596         { &hf_backupkey_bkrp_access_check_v3_nonce_len,
1597           { "Nonce Len", "backupkey.bkrp_access_check_v3.nonce_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1598         { &hf_backupkey_bkrp_access_check_v3_hash,
1599           { "Hash", "backupkey.bkrp_access_check_v3.hash", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1600         { &hf_backupkey_opnum,
1601           { "Operation", "backupkey.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1602         { &hf_backupkey_bkrp_exported_RSA_key_pair_magic3,
1603           { "Magic3", "backupkey.bkrp_exported_RSA_key_pair.magic3", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1604         { &hf_backupkey_bkrp_exported_RSA_key_pair_private_exponent,
1605           { "Private Exponent", "backupkey.bkrp_exported_RSA_key_pair.private_exponent", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1606         { &hf_backupkey_bkrp_BackupKey_data_out,
1607           { "Data Out", "backupkey.bkrp_BackupKey.data_out", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1608         { &hf_backupkey_bkrp_exported_RSA_key_pair_magic4,
1609           { "Magic4", "backupkey.bkrp_exported_RSA_key_pair.magic4", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1610         { &hf_backupkey_bkrp_encrypted_secret_v3_magic2,
1611           { "Magic2", "backupkey.bkrp_encrypted_secret_v3.magic2", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1612         { &hf_backupkey_bkrp_exported_RSA_key_pair_cert_,
1613           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1614         { &hf_backupkey_bkrp_exported_RSA_key_pair_prime2_,
1615           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1616         { &hf_backupkey_bkrp_BackupKey_data_in_len,
1617           { "Data In Len", "backupkey.bkrp_BackupKey.data_in_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1618         { &hf_backupkey_bkrp_BackupKey_data_in,
1619           { "Data In", "backupkey.bkrp_BackupKey.data_in", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1620         { &hf_backupkey_bkrp_access_check_v3_nonce,
1621           { "Nonce", "backupkey.bkrp_access_check_v3.nonce", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1622         { &hf_backupkey_bkrp_exported_RSA_key_pair_exponent1,
1623           { "Exponent1", "backupkey.bkrp_exported_RSA_key_pair.exponent1", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1624         { &hf_backupkey_bkrp_access_check_v2_nonce_len,
1625           { "Nonce Len", "backupkey.bkrp_access_check_v2.nonce_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1626         { &hf_backupkey_bkrp_access_check_v2_hash,
1627           { "Hash", "backupkey.bkrp_access_check_v2.hash", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1628         { &hf_backupkey_bkrp_exported_RSA_key_pair_cert,
1629           { "Cert", "backupkey.bkrp_exported_RSA_key_pair.cert", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1630         { &hf_backupkey_bkrp_exported_RSA_key_pair_exponent2_,
1631           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1632         { &hf_backupkey_bkrp_exported_RSA_key_pair_modulus,
1633           { "Modulus", "backupkey.bkrp_exported_RSA_key_pair.modulus", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1634         { &hf_backupkey_bkrp_encrypted_secret_v2_magic,
1635           { "Magic", "backupkey.bkrp_encrypted_secret_v2.magic", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1636         { &hf_backupkey_bkrp_encrypted_secret_v2_payload_key,
1637           { "Payload Key", "backupkey.bkrp_encrypted_secret_v2.payload_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1638         { &hf_backupkey_bkrp_encrypted_secret_v3_secret,
1639           { "Secret", "backupkey.bkrp_encrypted_secret_v3.secret", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1640         { &hf_backupkey_bkrp_exported_RSA_key_pair_prime1_,
1641           { "Subcontext length", "backupkey.bkrp_exported_RSA_key_pair.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1642         { &hf_backupkey_bkrp_access_check_v3_magic,
1643           { "Magic", "backupkey.bkrp_access_check_v3.magic", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1644         { &hf_backupkey_bkrp_exported_RSA_key_pair_coefficient,
1645           { "Coefficient", "backupkey.bkrp_exported_RSA_key_pair.coefficient", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1646         };
1647
1648
1649         static gint *ett[] = {
1650                 &ett_dcerpc_backupkey,
1651                 &ett_backupkey_bkrp_exported_RSA_key_pair,
1652                 &ett_backupkey_bkrp_dc_serverwrap_key,
1653                 &ett_backupkey_bkrp_client_side_wrapped,
1654                 &ett_backupkey_bkrp_client_side_unwrapped,
1655                 &ett_backupkey_bkrp_encrypted_secret_v2,
1656                 &ett_backupkey_bkrp_encrypted_secret_v3,
1657                 &ett_backupkey_bkrp_access_check_v2,
1658                 &ett_backupkey_bkrp_access_check_v3,
1659                 &ett_backupkey_bkrp_data_in_blob,
1660         };
1661
1662         proto_dcerpc_backupkey = proto_register_protocol("Remote Backup Key Storage", "BACKUPKEY", "backupkey");
1663         proto_register_field_array(proto_dcerpc_backupkey, hf, array_length (hf));
1664         proto_register_subtree_array(ett, array_length(ett));
1665 }
1666
1667 void proto_reg_handoff_dcerpc_backupkey(void)
1668 {
1669         dcerpc_init_uuid(proto_dcerpc_backupkey, ett_dcerpc_backupkey,
1670                 &uuid_dcerpc_backupkey, ver_dcerpc_backupkey,
1671                 backupkey_dissectors, hf_backupkey_opnum);
1672 }