removed some gcc warnings (hopefully)
[obnox/wireshark/wip.git] / epan / dissectors / packet-h235.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
3 /* ./packet-h235.c                                                            */
4 /* ../../tools/asn2eth.py -X -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn */
5
6 /* Input file: packet-h235-template.c */
7
8 /* packet-h235.c
9  * Routines for H.235 packet dissection
10  * 2004  Tomas Kukosa
11  *
12  * $Id$
13  *
14  * Ethereal - Network traffic analyzer
15  * By Gerald Combs <gerald@ethereal.com>
16  * Copyright 1998 Gerald Combs
17  *
18  * This program is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU General Public License
20  * as published by the Free Software Foundation; either version 2
21  * of the License, or (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
31  */
32
33 #ifdef HAVE_CONFIG_H
34 # include "config.h"
35 #endif
36
37 #include <glib.h>
38 #include <epan/packet.h>
39 #include <epan/conversation.h>
40
41 #include <stdio.h>
42 #include <string.h>
43
44 #include "packet-per.h"
45 #include "packet-h235.h"
46
47 #define PNAME  "H235-SECURITY-MESSAGES"
48 #define PSNAME "H235"
49 #define PFNAME "h235"
50
51 /* Initialize the protocol and registered fields */
52 int proto_h235 = -1;
53
54 /*--- Included file: packet-h235-hf.c ---*/
55
56 static int hf_h235_nonStandardIdentifier = -1;    /* OBJECT_IDENTIFIER */
57 static int hf_h235_data = -1;                     /* OCTET_STRING */
58 static int hf_h235_halfkey = -1;                  /* BIT_STRING_SIZE_0_2048 */
59 static int hf_h235_modSize = -1;                  /* BIT_STRING_SIZE_0_2048 */
60 static int hf_h235_generator = -1;                /* BIT_STRING_SIZE_0_2048 */
61 static int hf_h235_x = -1;                        /* BIT_STRING_SIZE_0_511 */
62 static int hf_h235_y = -1;                        /* BIT_STRING_SIZE_0_511 */
63 static int hf_h235_eckasdhp = -1;                 /* T_eckasdhp */
64 static int hf_h235_public_key = -1;               /* ECpoint */
65 static int hf_h235_modulus = -1;                  /* BIT_STRING_SIZE_0_511 */
66 static int hf_h235_base = -1;                     /* ECpoint */
67 static int hf_h235_weierstrassA = -1;             /* BIT_STRING_SIZE_0_511 */
68 static int hf_h235_weierstrassB = -1;             /* BIT_STRING_SIZE_0_511 */
69 static int hf_h235_eckasdh2 = -1;                 /* T_eckasdh2 */
70 static int hf_h235_fieldSize = -1;                /* BIT_STRING_SIZE_0_511 */
71 static int hf_h235_type = -1;                     /* OBJECT_IDENTIFIER */
72 static int hf_h235_certificatedata = -1;          /* OCTET_STRING */
73 static int hf_h235_default = -1;                  /* NULL */
74 static int hf_h235_radius = -1;                   /* NULL */
75 static int hf_h235_dhExch = -1;                   /* NULL */
76 static int hf_h235_pwdSymEnc = -1;                /* NULL */
77 static int hf_h235_pwdHash = -1;                  /* NULL */
78 static int hf_h235_certSign = -1;                 /* NULL */
79 static int hf_h235_ipsec = -1;                    /* NULL */
80 static int hf_h235_tls = -1;                      /* NULL */
81 static int hf_h235_nonStandard = -1;              /* NonStandardParameter */
82 static int hf_h235_authenticationBES = -1;        /* AuthenticationBES */
83 static int hf_h235_tokenOID = -1;                 /* OBJECT_IDENTIFIER */
84 static int hf_h235_timeStamp = -1;                /* TimeStamp */
85 static int hf_h235_password = -1;                 /* Password */
86 static int hf_h235_dhkey = -1;                    /* DHset */
87 static int hf_h235_challenge = -1;                /* ChallengeString */
88 static int hf_h235_random = -1;                   /* RandomVal */
89 static int hf_h235_certificate = -1;              /* TypedCertificate */
90 static int hf_h235_generalID = -1;                /* Identifier */
91 static int hf_h235_eckasdhkey = -1;               /* ECKASDH */
92 static int hf_h235_sendersID = -1;                /* Identifier */
93 static int hf_h235_h235Key = -1;                  /* H235Key */
94 static int hf_h235_toBeSigned = -1;               /* ToBeSigned */
95 static int hf_h235_algorithmOID = -1;             /* OBJECT_IDENTIFIER */
96 static int hf_h235_paramS = -1;                   /* Params */
97 static int hf_h235_signaturedata = -1;            /* BIT_STRING */
98 static int hf_h235_encryptedData = -1;            /* OCTET_STRING */
99 static int hf_h235_hash = -1;                     /* BIT_STRING */
100 static int hf_h235_ranInt = -1;                   /* INTEGER */
101 static int hf_h235_iv8 = -1;                      /* IV8 */
102 static int hf_h235_iv16 = -1;                     /* IV16 */
103 static int hf_h235_iv = -1;                       /* OCTET_STRING */
104 static int hf_h235_clearSalt = -1;                /* OCTET_STRING */
105 static int hf_h235_cryptoEncryptedToken = -1;     /* T_cryptoEncryptedToken */
106 static int hf_h235_encryptedToken = -1;           /* ENCRYPTEDxxx */
107 static int hf_h235_cryptoSignedToken = -1;        /* T_cryptoSignedToken */
108 static int hf_h235_signedToken = -1;              /* SIGNEDxxx */
109 static int hf_h235_cryptoHashedToken = -1;        /* T_cryptoHashedToken */
110 static int hf_h235_hashedVals = -1;               /* ClearToken */
111 static int hf_h235_hashedToken = -1;              /* HASHEDxxx */
112 static int hf_h235_cryptoPwdEncr = -1;            /* ENCRYPTEDxxx */
113 static int hf_h235_secureChannel = -1;            /* KeyMaterial */
114 static int hf_h235_sharedSecret = -1;             /* ENCRYPTEDxxx */
115 static int hf_h235_certProtectedKey = -1;         /* SIGNEDxxx */
116 static int hf_h235_secureSharedSecret = -1;       /* V3KeySyncMaterial */
117 static int hf_h235_encryptedSessionKey = -1;      /* OCTET_STRING */
118 static int hf_h235_encryptedSaltingKey = -1;      /* OCTET_STRING */
119 static int hf_h235_clearSaltingKey = -1;          /* OCTET_STRING */
120 static int hf_h235_paramSsalt = -1;               /* Params */
121 static int hf_h235_keyDerivationOID = -1;         /* OBJECT_IDENTIFIER */
122
123 /*--- End of included file: packet-h235-hf.c ---*/
124
125
126 /* Initialize the subtree pointers */
127
128 /*--- Included file: packet-h235-ett.c ---*/
129
130 static gint ett_h235_NonStandardParameter = -1;
131 static gint ett_h235_DHset = -1;
132 static gint ett_h235_ECpoint = -1;
133 static gint ett_h235_ECKASDH = -1;
134 static gint ett_h235_T_eckasdhp = -1;
135 static gint ett_h235_T_eckasdh2 = -1;
136 static gint ett_h235_TypedCertificate = -1;
137 static gint ett_h235_AuthenticationBES = -1;
138 static gint ett_h235_AuthenticationMechanism = -1;
139 static gint ett_h235_ClearToken = -1;
140 static gint ett_h235_SIGNEDxxx = -1;
141 static gint ett_h235_ENCRYPTEDxxx = -1;
142 static gint ett_h235_HASHEDxxx = -1;
143 static gint ett_h235_Params = -1;
144 static gint ett_h235_CryptoToken = -1;
145 static gint ett_h235_T_cryptoEncryptedToken = -1;
146 static gint ett_h235_T_cryptoSignedToken = -1;
147 static gint ett_h235_T_cryptoHashedToken = -1;
148 static gint ett_h235_H235Key = -1;
149 static gint ett_h235_V3KeySyncMaterial = -1;
150
151 /*--- End of included file: packet-h235-ett.c ---*/
152
153
154 static guint32
155 dissect_xxx_ToBeSigned(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) {
156 PER_NOT_DECODED_YET("ToBeSigned");
157   return offset;
158 }
159
160
161 /*--- Included file: packet-h235-fn.c ---*/
162
163 /*--- Fields for imported types ---*/
164
165 static int dissect_toBeSigned(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
166   return dissect_xxx_ToBeSigned(tvb, offset, pinfo, tree, hf_h235_toBeSigned);
167 }
168
169
170 static int
171 dissect_h235_ChallengeString(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
172   offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index,
173                                     8, 128,
174                                     NULL, NULL);
175
176   return offset;
177 }
178 static int dissect_challenge(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
179   return dissect_h235_ChallengeString(tvb, offset, pinfo, tree, hf_h235_challenge);
180 }
181
182
183
184 int
185 dissect_h235_TimeStamp(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
186   offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
187                                            1U, 4294967295U, NULL, NULL, FALSE);
188
189   return offset;
190 }
191 static int dissect_timeStamp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
192   return dissect_h235_TimeStamp(tvb, offset, pinfo, tree, hf_h235_timeStamp);
193 }
194
195
196
197 static int
198 dissect_h235_RandomVal(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
199   offset = dissect_per_integer(tvb, offset, pinfo, tree, hf_index,
200                                NULL, NULL);
201
202   return offset;
203 }
204 static int dissect_random(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
205   return dissect_h235_RandomVal(tvb, offset, pinfo, tree, hf_h235_random);
206 }
207
208
209 static int
210 dissect_h235_Password(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
211   offset = dissect_per_BMPString(tvb, offset, pinfo, tree, hf_index,
212                                  1, 128);
213
214   return offset;
215 }
216 static int dissect_password(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
217   return dissect_h235_Password(tvb, offset, pinfo, tree, hf_h235_password);
218 }
219
220
221 static int
222 dissect_h235_Identifier(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
223   offset = dissect_per_BMPString(tvb, offset, pinfo, tree, hf_index,
224                                  1, 128);
225
226   return offset;
227 }
228 static int dissect_generalID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
229   return dissect_h235_Identifier(tvb, offset, pinfo, tree, hf_h235_generalID);
230 }
231 static int dissect_sendersID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
232   return dissect_h235_Identifier(tvb, offset, pinfo, tree, hf_h235_sendersID);
233 }
234
235
236 static int
237 dissect_h235_KeyMaterial(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
238   offset = dissect_per_bit_string(tvb, offset, pinfo, tree, hf_index,
239                                   1, 2048);
240
241   return offset;
242 }
243 static int dissect_secureChannel(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
244   return dissect_h235_KeyMaterial(tvb, offset, pinfo, tree, hf_h235_secureChannel);
245 }
246
247
248 static int
249 dissect_h235_OBJECT_IDENTIFIER(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
250   offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index,
251                                          NULL);
252
253   return offset;
254 }
255 static int dissect_nonStandardIdentifier(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
256   return dissect_h235_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h235_nonStandardIdentifier);
257 }
258 static int dissect_type(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
259   return dissect_h235_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h235_type);
260 }
261 static int dissect_tokenOID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
262   return dissect_h235_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h235_tokenOID);
263 }
264 static int dissect_algorithmOID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
265   return dissect_h235_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h235_algorithmOID);
266 }
267 static int dissect_keyDerivationOID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
268   return dissect_h235_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h235_keyDerivationOID);
269 }
270
271
272 static int
273 dissect_h235_OCTET_STRING(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
274   offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index,
275                                     -1, -1,
276                                     NULL, NULL);
277
278   return offset;
279 }
280 static int dissect_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
281   return dissect_h235_OCTET_STRING(tvb, offset, pinfo, tree, hf_h235_data);
282 }
283 static int dissect_certificatedata(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
284   return dissect_h235_OCTET_STRING(tvb, offset, pinfo, tree, hf_h235_certificatedata);
285 }
286 static int dissect_encryptedData(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
287   return dissect_h235_OCTET_STRING(tvb, offset, pinfo, tree, hf_h235_encryptedData);
288 }
289 static int dissect_iv(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
290   return dissect_h235_OCTET_STRING(tvb, offset, pinfo, tree, hf_h235_iv);
291 }
292 static int dissect_clearSalt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
293   return dissect_h235_OCTET_STRING(tvb, offset, pinfo, tree, hf_h235_clearSalt);
294 }
295 static int dissect_encryptedSessionKey(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
296   return dissect_h235_OCTET_STRING(tvb, offset, pinfo, tree, hf_h235_encryptedSessionKey);
297 }
298 static int dissect_encryptedSaltingKey(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
299   return dissect_h235_OCTET_STRING(tvb, offset, pinfo, tree, hf_h235_encryptedSaltingKey);
300 }
301 static int dissect_clearSaltingKey(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
302   return dissect_h235_OCTET_STRING(tvb, offset, pinfo, tree, hf_h235_clearSaltingKey);
303 }
304
305 static const per_sequence_t NonStandardParameter_sequence[] = {
306   { "nonStandardIdentifier"       , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_nonStandardIdentifier },
307   { "data"                        , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_data },
308   { NULL, 0, 0, NULL }
309 };
310
311 static int
312 dissect_h235_NonStandardParameter(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
313   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
314                                 ett_h235_NonStandardParameter, NonStandardParameter_sequence);
315
316   return offset;
317 }
318 static int dissect_nonStandard(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
319   return dissect_h235_NonStandardParameter(tvb, offset, pinfo, tree, hf_h235_nonStandard);
320 }
321
322
323 static int
324 dissect_h235_BIT_STRING_SIZE_0_2048(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
325   offset = dissect_per_bit_string(tvb, offset, pinfo, tree, hf_index,
326                                   0, 2048);
327
328   return offset;
329 }
330 static int dissect_halfkey(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
331   return dissect_h235_BIT_STRING_SIZE_0_2048(tvb, offset, pinfo, tree, hf_h235_halfkey);
332 }
333 static int dissect_modSize(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
334   return dissect_h235_BIT_STRING_SIZE_0_2048(tvb, offset, pinfo, tree, hf_h235_modSize);
335 }
336 static int dissect_generator(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
337   return dissect_h235_BIT_STRING_SIZE_0_2048(tvb, offset, pinfo, tree, hf_h235_generator);
338 }
339
340 static const per_sequence_t DHset_sequence[] = {
341   { "halfkey"                     , ASN1_EXTENSION_ROOT    , ASN1_NOT_OPTIONAL, dissect_halfkey },
342   { "modSize"                     , ASN1_EXTENSION_ROOT    , ASN1_NOT_OPTIONAL, dissect_modSize },
343   { "generator"                   , ASN1_EXTENSION_ROOT    , ASN1_NOT_OPTIONAL, dissect_generator },
344   { NULL, 0, 0, NULL }
345 };
346
347 static int
348 dissect_h235_DHset(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
349   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
350                                 ett_h235_DHset, DHset_sequence);
351
352   return offset;
353 }
354 static int dissect_dhkey(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
355   return dissect_h235_DHset(tvb, offset, pinfo, tree, hf_h235_dhkey);
356 }
357
358
359 static int
360 dissect_h235_BIT_STRING_SIZE_0_511(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
361   offset = dissect_per_bit_string(tvb, offset, pinfo, tree, hf_index,
362                                   0, 511);
363
364   return offset;
365 }
366 static int dissect_x(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
367   return dissect_h235_BIT_STRING_SIZE_0_511(tvb, offset, pinfo, tree, hf_h235_x);
368 }
369 static int dissect_y(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
370   return dissect_h235_BIT_STRING_SIZE_0_511(tvb, offset, pinfo, tree, hf_h235_y);
371 }
372 static int dissect_modulus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
373   return dissect_h235_BIT_STRING_SIZE_0_511(tvb, offset, pinfo, tree, hf_h235_modulus);
374 }
375 static int dissect_weierstrassA(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
376   return dissect_h235_BIT_STRING_SIZE_0_511(tvb, offset, pinfo, tree, hf_h235_weierstrassA);
377 }
378 static int dissect_weierstrassB(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
379   return dissect_h235_BIT_STRING_SIZE_0_511(tvb, offset, pinfo, tree, hf_h235_weierstrassB);
380 }
381 static int dissect_fieldSize(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
382   return dissect_h235_BIT_STRING_SIZE_0_511(tvb, offset, pinfo, tree, hf_h235_fieldSize);
383 }
384
385 static const per_sequence_t ECpoint_sequence[] = {
386   { "x"                           , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_x },
387   { "y"                           , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_y },
388   { NULL, 0, 0, NULL }
389 };
390
391 static int
392 dissect_h235_ECpoint(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
393   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
394                                 ett_h235_ECpoint, ECpoint_sequence);
395
396   return offset;
397 }
398 static int dissect_public_key(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
399   return dissect_h235_ECpoint(tvb, offset, pinfo, tree, hf_h235_public_key);
400 }
401 static int dissect_base(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
402   return dissect_h235_ECpoint(tvb, offset, pinfo, tree, hf_h235_base);
403 }
404
405 static const per_sequence_t T_eckasdhp_sequence[] = {
406   { "public-key"                  , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_public_key },
407   { "modulus"                     , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_modulus },
408   { "base"                        , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_base },
409   { "weierstrassA"                , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_weierstrassA },
410   { "weierstrassB"                , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_weierstrassB },
411   { NULL, 0, 0, NULL }
412 };
413
414 static int
415 dissect_h235_T_eckasdhp(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
416   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
417                                 ett_h235_T_eckasdhp, T_eckasdhp_sequence);
418
419   return offset;
420 }
421 static int dissect_eckasdhp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
422   return dissect_h235_T_eckasdhp(tvb, offset, pinfo, tree, hf_h235_eckasdhp);
423 }
424
425 static const per_sequence_t T_eckasdh2_sequence[] = {
426   { "public-key"                  , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_public_key },
427   { "fieldSize"                   , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_fieldSize },
428   { "base"                        , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_base },
429   { "weierstrassA"                , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_weierstrassA },
430   { "weierstrassB"                , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_weierstrassB },
431   { NULL, 0, 0, NULL }
432 };
433
434 static int
435 dissect_h235_T_eckasdh2(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
436   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
437                                 ett_h235_T_eckasdh2, T_eckasdh2_sequence);
438
439   return offset;
440 }
441 static int dissect_eckasdh2(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
442   return dissect_h235_T_eckasdh2(tvb, offset, pinfo, tree, hf_h235_eckasdh2);
443 }
444
445
446 static const value_string ECKASDH_vals[] = {
447   {   0, "eckasdhp" },
448   {   1, "eckasdh2" },
449   { 0, NULL }
450 };
451
452 static const per_choice_t ECKASDH_choice[] = {
453   {   0, "eckasdhp"                    , ASN1_EXTENSION_ROOT    , dissect_eckasdhp },
454   {   1, "eckasdh2"                    , ASN1_EXTENSION_ROOT    , dissect_eckasdh2 },
455   { 0, NULL, 0, NULL }
456 };
457
458 static int
459 dissect_h235_ECKASDH(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
460   offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index,
461                               ett_h235_ECKASDH, ECKASDH_choice, "ECKASDH",
462                               NULL);
463
464   return offset;
465 }
466 static int dissect_eckasdhkey(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
467   return dissect_h235_ECKASDH(tvb, offset, pinfo, tree, hf_h235_eckasdhkey);
468 }
469
470 static const per_sequence_t TypedCertificate_sequence[] = {
471   { "type"                        , ASN1_EXTENSION_ROOT    , ASN1_NOT_OPTIONAL, dissect_type },
472   { "certificate"                 , ASN1_EXTENSION_ROOT    , ASN1_NOT_OPTIONAL, dissect_certificatedata },
473   { NULL, 0, 0, NULL }
474 };
475
476 static int
477 dissect_h235_TypedCertificate(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
478   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
479                                 ett_h235_TypedCertificate, TypedCertificate_sequence);
480
481   return offset;
482 }
483 static int dissect_certificate(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
484   return dissect_h235_TypedCertificate(tvb, offset, pinfo, tree, hf_h235_certificate);
485 }
486
487
488 static int
489 dissect_h235_NULL(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
490   { proto_item *ti_tmp;
491   ti_tmp = proto_tree_add_item(tree, hf_index, tvb, offset>>8, 0, FALSE);
492   proto_item_append_text(ti_tmp, ": NULL");
493   }
494
495   return offset;
496 }
497 static int dissect_default(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
498   return dissect_h235_NULL(tvb, offset, pinfo, tree, hf_h235_default);
499 }
500 static int dissect_radius(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
501   return dissect_h235_NULL(tvb, offset, pinfo, tree, hf_h235_radius);
502 }
503 static int dissect_dhExch(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
504   return dissect_h235_NULL(tvb, offset, pinfo, tree, hf_h235_dhExch);
505 }
506 static int dissect_pwdSymEnc(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
507   return dissect_h235_NULL(tvb, offset, pinfo, tree, hf_h235_pwdSymEnc);
508 }
509 static int dissect_pwdHash(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
510   return dissect_h235_NULL(tvb, offset, pinfo, tree, hf_h235_pwdHash);
511 }
512 static int dissect_certSign(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
513   return dissect_h235_NULL(tvb, offset, pinfo, tree, hf_h235_certSign);
514 }
515 static int dissect_ipsec(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
516   return dissect_h235_NULL(tvb, offset, pinfo, tree, hf_h235_ipsec);
517 }
518 static int dissect_tls(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
519   return dissect_h235_NULL(tvb, offset, pinfo, tree, hf_h235_tls);
520 }
521
522
523 static const value_string AuthenticationBES_vals[] = {
524   {   0, "default" },
525   {   1, "radius" },
526   { 0, NULL }
527 };
528
529 static const per_choice_t AuthenticationBES_choice[] = {
530   {   0, "default"                     , ASN1_EXTENSION_ROOT    , dissect_default },
531   {   1, "radius"                      , ASN1_EXTENSION_ROOT    , dissect_radius },
532   { 0, NULL, 0, NULL }
533 };
534
535 static int
536 dissect_h235_AuthenticationBES(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
537   offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index,
538                               ett_h235_AuthenticationBES, AuthenticationBES_choice, "AuthenticationBES",
539                               NULL);
540
541   return offset;
542 }
543 static int dissect_authenticationBES(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
544   return dissect_h235_AuthenticationBES(tvb, offset, pinfo, tree, hf_h235_authenticationBES);
545 }
546
547
548 const value_string AuthenticationMechanism_vals[] = {
549   {   0, "dhExch" },
550   {   1, "pwdSymEnc" },
551   {   2, "pwdHash" },
552   {   3, "certSign" },
553   {   4, "ipsec" },
554   {   5, "tls" },
555   {   6, "nonStandard" },
556   {   7, "authenticationBES" },
557   { 0, NULL }
558 };
559
560 static const per_choice_t AuthenticationMechanism_choice[] = {
561   {   0, "dhExch"                      , ASN1_EXTENSION_ROOT    , dissect_dhExch },
562   {   1, "pwdSymEnc"                   , ASN1_EXTENSION_ROOT    , dissect_pwdSymEnc },
563   {   2, "pwdHash"                     , ASN1_EXTENSION_ROOT    , dissect_pwdHash },
564   {   3, "certSign"                    , ASN1_EXTENSION_ROOT    , dissect_certSign },
565   {   4, "ipsec"                       , ASN1_EXTENSION_ROOT    , dissect_ipsec },
566   {   5, "tls"                         , ASN1_EXTENSION_ROOT    , dissect_tls },
567   {   6, "nonStandard"                 , ASN1_EXTENSION_ROOT    , dissect_nonStandard },
568   {   7, "authenticationBES"           , ASN1_NOT_EXTENSION_ROOT, dissect_authenticationBES },
569   { 0, NULL, 0, NULL }
570 };
571
572 int
573 dissect_h235_AuthenticationMechanism(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
574   offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index,
575                               ett_h235_AuthenticationMechanism, AuthenticationMechanism_choice, "AuthenticationMechanism",
576                               NULL);
577
578   return offset;
579 }
580
581
582
583 static int
584 dissect_h235_INTEGER(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
585   offset = dissect_per_integer(tvb, offset, pinfo, tree, hf_index,
586                                NULL, NULL);
587
588   return offset;
589 }
590 static int dissect_ranInt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
591   return dissect_h235_INTEGER(tvb, offset, pinfo, tree, hf_h235_ranInt);
592 }
593
594
595 static int
596 dissect_h235_IV8(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
597   offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index,
598                                     8, 8,
599                                     NULL, NULL);
600
601   return offset;
602 }
603 static int dissect_iv8(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
604   return dissect_h235_IV8(tvb, offset, pinfo, tree, hf_h235_iv8);
605 }
606
607
608 static int
609 dissect_h235_IV16(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
610   offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index,
611                                     16, 16,
612                                     NULL, NULL);
613
614   return offset;
615 }
616 static int dissect_iv16(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
617   return dissect_h235_IV16(tvb, offset, pinfo, tree, hf_h235_iv16);
618 }
619
620 static const per_sequence_t Params_sequence[] = {
621   { "ranInt"                      , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_ranInt },
622   { "iv8"                         , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_iv8 },
623   { "iv16"                        , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL    , dissect_iv16 },
624   { "iv"                          , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL    , dissect_iv },
625   { "clearSalt"                   , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL    , dissect_clearSalt },
626   { NULL, 0, 0, NULL }
627 };
628
629 static int
630 dissect_h235_Params(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
631   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
632                                 ett_h235_Params, Params_sequence);
633
634   return offset;
635 }
636 static int dissect_paramS(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
637   return dissect_h235_Params(tvb, offset, pinfo, tree, hf_h235_paramS);
638 }
639 static int dissect_paramSsalt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
640   return dissect_h235_Params(tvb, offset, pinfo, tree, hf_h235_paramSsalt);
641 }
642
643 static const per_sequence_t ENCRYPTEDxxx_sequence[] = {
644   { "algorithmOID"                , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_algorithmOID },
645   { "paramS"                      , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_paramS },
646   { "encryptedData"               , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_encryptedData },
647   { NULL, 0, 0, NULL }
648 };
649
650 int
651 dissect_h235_ENCRYPTEDxxx(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
652   proto_tree_add_item_hidden(tree, proto_h235, tvb, offset, 0, FALSE);
653   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
654                                 ett_h235_ENCRYPTEDxxx, ENCRYPTEDxxx_sequence);
655
656   return offset;
657 }
658 static int dissect_encryptedToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
659   return dissect_h235_ENCRYPTEDxxx(tvb, offset, pinfo, tree, hf_h235_encryptedToken);
660 }
661 static int dissect_cryptoPwdEncr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
662   return dissect_h235_ENCRYPTEDxxx(tvb, offset, pinfo, tree, hf_h235_cryptoPwdEncr);
663 }
664 static int dissect_sharedSecret(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
665   return dissect_h235_ENCRYPTEDxxx(tvb, offset, pinfo, tree, hf_h235_sharedSecret);
666 }
667
668
669 static int
670 dissect_h235_BIT_STRING(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
671   offset = dissect_per_bit_string(tvb, offset, pinfo, tree, hf_index,
672                                   -1, -1);
673
674   return offset;
675 }
676 static int dissect_signaturedata(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
677   return dissect_h235_BIT_STRING(tvb, offset, pinfo, tree, hf_h235_signaturedata);
678 }
679 static int dissect_hash(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
680   return dissect_h235_BIT_STRING(tvb, offset, pinfo, tree, hf_h235_hash);
681 }
682
683 static const per_sequence_t SIGNEDxxx_sequence[] = {
684   { "toBeSigned"                  , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_toBeSigned },
685   { "algorithmOID"                , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_algorithmOID },
686   { "paramS"                      , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_paramS },
687   { "signature"                   , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_signaturedata },
688   { NULL, 0, 0, NULL }
689 };
690
691 int
692 dissect_h235_SIGNEDxxx(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
693   proto_tree_add_item_hidden(tree, proto_h235, tvb, offset, 0, FALSE);
694   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
695                                 ett_h235_SIGNEDxxx, SIGNEDxxx_sequence);
696
697   return offset;
698 }
699 static int dissect_signedToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
700   return dissect_h235_SIGNEDxxx(tvb, offset, pinfo, tree, hf_h235_signedToken);
701 }
702 static int dissect_certProtectedKey(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
703   return dissect_h235_SIGNEDxxx(tvb, offset, pinfo, tree, hf_h235_certProtectedKey);
704 }
705
706 static const per_sequence_t V3KeySyncMaterial_sequence[] = {
707   { "generalID"                   , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_generalID },
708   { "algorithmOID"                , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_algorithmOID },
709   { "paramS"                      , ASN1_EXTENSION_ROOT    , ASN1_NOT_OPTIONAL, dissect_paramS },
710   { "encryptedSessionKey"         , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_encryptedSessionKey },
711   { "encryptedSaltingKey"         , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_encryptedSaltingKey },
712   { "clearSaltingKey"             , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_clearSaltingKey },
713   { "paramSsalt"                  , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_paramSsalt },
714   { "keyDerivationOID"            , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_keyDerivationOID },
715   { NULL, 0, 0, NULL }
716 };
717
718 static int
719 dissect_h235_V3KeySyncMaterial(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
720   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
721                                 ett_h235_V3KeySyncMaterial, V3KeySyncMaterial_sequence);
722
723   return offset;
724 }
725 static int dissect_secureSharedSecret(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
726   return dissect_h235_V3KeySyncMaterial(tvb, offset, pinfo, tree, hf_h235_secureSharedSecret);
727 }
728
729
730 static const value_string H235Key_vals[] = {
731   {   0, "secureChannel" },
732   {   1, "sharedSecret" },
733   {   2, "certProtectedKey" },
734   {   3, "secureSharedSecret" },
735   { 0, NULL }
736 };
737
738 static const per_choice_t H235Key_choice[] = {
739   {   0, "secureChannel"               , ASN1_EXTENSION_ROOT    , dissect_secureChannel },
740   {   1, "sharedSecret"                , ASN1_EXTENSION_ROOT    , dissect_sharedSecret },
741   {   2, "certProtectedKey"            , ASN1_EXTENSION_ROOT    , dissect_certProtectedKey },
742   {   3, "secureSharedSecret"          , ASN1_NOT_EXTENSION_ROOT, dissect_secureSharedSecret },
743   { 0, NULL, 0, NULL }
744 };
745
746 static int
747 dissect_h235_H235Key(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
748   offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index,
749                               ett_h235_H235Key, H235Key_choice, "H235Key",
750                               NULL);
751
752   return offset;
753 }
754 static int dissect_h235Key(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
755   return dissect_h235_H235Key(tvb, offset, pinfo, tree, hf_h235_h235Key);
756 }
757
758 static const per_sequence_t ClearToken_sequence[] = {
759   { "tokenOID"                    , ASN1_EXTENSION_ROOT    , ASN1_NOT_OPTIONAL, dissect_tokenOID },
760   { "timeStamp"                   , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_timeStamp },
761   { "password"                    , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_password },
762   { "dhkey"                       , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_dhkey },
763   { "challenge"                   , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_challenge },
764   { "random"                      , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_random },
765   { "certificate"                 , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_certificate },
766   { "generalID"                   , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_generalID },
767   { "nonStandard"                 , ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_nonStandard },
768   { "eckasdhkey"                  , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL    , dissect_eckasdhkey },
769   { "sendersID"                   , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL    , dissect_sendersID },
770   { "h235Key"                     , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL    , dissect_h235Key },
771   { NULL, 0, 0, NULL }
772 };
773
774 int
775 dissect_h235_ClearToken(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
776   proto_tree_add_item_hidden(tree, proto_h235, tvb, offset, 0, FALSE);
777   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
778                                 ett_h235_ClearToken, ClearToken_sequence);
779
780   return offset;
781 }
782 static int dissect_hashedVals(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
783   return dissect_h235_ClearToken(tvb, offset, pinfo, tree, hf_h235_hashedVals);
784 }
785
786 static const per_sequence_t HASHEDxxx_sequence[] = {
787   { "algorithmOID"                , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_algorithmOID },
788   { "paramS"                      , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_paramS },
789   { "hash"                        , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_hash },
790   { NULL, 0, 0, NULL }
791 };
792
793 int
794 dissect_h235_HASHEDxxx(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
795   proto_tree_add_item_hidden(tree, proto_h235, tvb, offset, 0, FALSE);
796   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
797                                 ett_h235_HASHEDxxx, HASHEDxxx_sequence);
798
799   return offset;
800 }
801 static int dissect_hashedToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
802   return dissect_h235_HASHEDxxx(tvb, offset, pinfo, tree, hf_h235_hashedToken);
803 }
804
805 static const per_sequence_t T_cryptoEncryptedToken_sequence[] = {
806   { "tokenOID"                    , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_tokenOID },
807   { "token"                       , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_encryptedToken },
808   { NULL, 0, 0, NULL }
809 };
810
811 static int
812 dissect_h235_T_cryptoEncryptedToken(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
813   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
814                                 ett_h235_T_cryptoEncryptedToken, T_cryptoEncryptedToken_sequence);
815
816   return offset;
817 }
818 static int dissect_cryptoEncryptedToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
819   return dissect_h235_T_cryptoEncryptedToken(tvb, offset, pinfo, tree, hf_h235_cryptoEncryptedToken);
820 }
821
822 static const per_sequence_t T_cryptoSignedToken_sequence[] = {
823   { "tokenOID"                    , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_tokenOID },
824   { "token"                       , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_signedToken },
825   { NULL, 0, 0, NULL }
826 };
827
828 static int
829 dissect_h235_T_cryptoSignedToken(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
830   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
831                                 ett_h235_T_cryptoSignedToken, T_cryptoSignedToken_sequence);
832
833   return offset;
834 }
835 static int dissect_cryptoSignedToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
836   return dissect_h235_T_cryptoSignedToken(tvb, offset, pinfo, tree, hf_h235_cryptoSignedToken);
837 }
838
839 static const per_sequence_t T_cryptoHashedToken_sequence[] = {
840   { "tokenOID"                    , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_tokenOID },
841   { "hashedVals"                  , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_hashedVals },
842   { "token"                       , ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_hashedToken },
843   { NULL, 0, 0, NULL }
844 };
845
846 static int
847 dissect_h235_T_cryptoHashedToken(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
848   offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index,
849                                 ett_h235_T_cryptoHashedToken, T_cryptoHashedToken_sequence);
850
851   return offset;
852 }
853 static int dissect_cryptoHashedToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
854   return dissect_h235_T_cryptoHashedToken(tvb, offset, pinfo, tree, hf_h235_cryptoHashedToken);
855 }
856
857
858 const value_string CryptoToken_vals[] = {
859   {   0, "cryptoEncryptedToken" },
860   {   1, "cryptoSignedToken" },
861   {   2, "cryptoHashedToken" },
862   {   3, "cryptoPwdEncr" },
863   { 0, NULL }
864 };
865
866 static const per_choice_t CryptoToken_choice[] = {
867   {   0, "cryptoEncryptedToken"        , ASN1_EXTENSION_ROOT    , dissect_cryptoEncryptedToken },
868   {   1, "cryptoSignedToken"           , ASN1_EXTENSION_ROOT    , dissect_cryptoSignedToken },
869   {   2, "cryptoHashedToken"           , ASN1_EXTENSION_ROOT    , dissect_cryptoHashedToken },
870   {   3, "cryptoPwdEncr"               , ASN1_EXTENSION_ROOT    , dissect_cryptoPwdEncr },
871   { 0, NULL, 0, NULL }
872 };
873
874 int
875 dissect_h235_CryptoToken(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
876   proto_tree_add_item_hidden(tree, proto_h235, tvb, offset, 0, FALSE);
877   offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index,
878                               ett_h235_CryptoToken, CryptoToken_choice, "CryptoToken",
879                               NULL);
880
881   return offset;
882 }
883
884
885 /*--- End of included file: packet-h235-fn.c ---*/
886
887
888
889 /*--- proto_register_h235 ----------------------------------------------*/
890 void proto_register_h235(void) {
891
892   /* List of fields */
893   static hf_register_info hf[] = {
894
895 /*--- Included file: packet-h235-hfarr.c ---*/
896
897     { &hf_h235_nonStandardIdentifier,
898       { "nonStandardIdentifier", "h235.nonStandardIdentifier",
899         FT_STRING, BASE_NONE, NULL, 0,
900         "NonStandardParameter/nonStandardIdentifier", HFILL }},
901     { &hf_h235_data,
902       { "data", "h235.data",
903         FT_UINT32, BASE_DEC, NULL, 0,
904         "NonStandardParameter/data", HFILL }},
905     { &hf_h235_halfkey,
906       { "halfkey", "h235.halfkey",
907         FT_BYTES, BASE_HEX, NULL, 0,
908         "DHset/halfkey", HFILL }},
909     { &hf_h235_modSize,
910       { "modSize", "h235.modSize",
911         FT_BYTES, BASE_HEX, NULL, 0,
912         "DHset/modSize", HFILL }},
913     { &hf_h235_generator,
914       { "generator", "h235.generator",
915         FT_BYTES, BASE_HEX, NULL, 0,
916         "DHset/generator", HFILL }},
917     { &hf_h235_x,
918       { "x", "h235.x",
919         FT_BYTES, BASE_HEX, NULL, 0,
920         "ECpoint/x", HFILL }},
921     { &hf_h235_y,
922       { "y", "h235.y",
923         FT_BYTES, BASE_HEX, NULL, 0,
924         "ECpoint/y", HFILL }},
925     { &hf_h235_eckasdhp,
926       { "eckasdhp", "h235.eckasdhp",
927         FT_NONE, BASE_NONE, NULL, 0,
928         "ECKASDH/eckasdhp", HFILL }},
929     { &hf_h235_public_key,
930       { "public-key", "h235.public_key",
931         FT_NONE, BASE_NONE, NULL, 0,
932         "", HFILL }},
933     { &hf_h235_modulus,
934       { "modulus", "h235.modulus",
935         FT_BYTES, BASE_HEX, NULL, 0,
936         "ECKASDH/eckasdhp/modulus", HFILL }},
937     { &hf_h235_base,
938       { "base", "h235.base",
939         FT_NONE, BASE_NONE, NULL, 0,
940         "", HFILL }},
941     { &hf_h235_weierstrassA,
942       { "weierstrassA", "h235.weierstrassA",
943         FT_BYTES, BASE_HEX, NULL, 0,
944         "", HFILL }},
945     { &hf_h235_weierstrassB,
946       { "weierstrassB", "h235.weierstrassB",
947         FT_BYTES, BASE_HEX, NULL, 0,
948         "", HFILL }},
949     { &hf_h235_eckasdh2,
950       { "eckasdh2", "h235.eckasdh2",
951         FT_NONE, BASE_NONE, NULL, 0,
952         "ECKASDH/eckasdh2", HFILL }},
953     { &hf_h235_fieldSize,
954       { "fieldSize", "h235.fieldSize",
955         FT_BYTES, BASE_HEX, NULL, 0,
956         "ECKASDH/eckasdh2/fieldSize", HFILL }},
957     { &hf_h235_type,
958       { "type", "h235.type",
959         FT_STRING, BASE_NONE, NULL, 0,
960         "TypedCertificate/type", HFILL }},
961     { &hf_h235_certificatedata,
962       { "certificate", "h235.certificate",
963         FT_BYTES, BASE_HEX, NULL, 0,
964         "TypedCertificate/certificate", HFILL }},
965     { &hf_h235_default,
966       { "default", "h235.default",
967         FT_NONE, BASE_NONE, NULL, 0,
968         "AuthenticationBES/default", HFILL }},
969     { &hf_h235_radius,
970       { "radius", "h235.radius",
971         FT_NONE, BASE_NONE, NULL, 0,
972         "AuthenticationBES/radius", HFILL }},
973     { &hf_h235_dhExch,
974       { "dhExch", "h235.dhExch",
975         FT_NONE, BASE_NONE, NULL, 0,
976         "AuthenticationMechanism/dhExch", HFILL }},
977     { &hf_h235_pwdSymEnc,
978       { "pwdSymEnc", "h235.pwdSymEnc",
979         FT_NONE, BASE_NONE, NULL, 0,
980         "AuthenticationMechanism/pwdSymEnc", HFILL }},
981     { &hf_h235_pwdHash,
982       { "pwdHash", "h235.pwdHash",
983         FT_NONE, BASE_NONE, NULL, 0,
984         "AuthenticationMechanism/pwdHash", HFILL }},
985     { &hf_h235_certSign,
986       { "certSign", "h235.certSign",
987         FT_NONE, BASE_NONE, NULL, 0,
988         "AuthenticationMechanism/certSign", HFILL }},
989     { &hf_h235_ipsec,
990       { "ipsec", "h235.ipsec",
991         FT_NONE, BASE_NONE, NULL, 0,
992         "AuthenticationMechanism/ipsec", HFILL }},
993     { &hf_h235_tls,
994       { "tls", "h235.tls",
995         FT_NONE, BASE_NONE, NULL, 0,
996         "AuthenticationMechanism/tls", HFILL }},
997     { &hf_h235_nonStandard,
998       { "nonStandard", "h235.nonStandard",
999         FT_NONE, BASE_NONE, NULL, 0,
1000         "", HFILL }},
1001     { &hf_h235_authenticationBES,
1002       { "authenticationBES", "h235.authenticationBES",
1003         FT_UINT32, BASE_DEC, VALS(AuthenticationBES_vals), 0,
1004         "AuthenticationMechanism/authenticationBES", HFILL }},
1005     { &hf_h235_tokenOID,
1006       { "tokenOID", "h235.tokenOID",
1007         FT_STRING, BASE_NONE, NULL, 0,
1008         "", HFILL }},
1009     { &hf_h235_timeStamp,
1010       { "timeStamp", "h235.timeStamp",
1011         FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0,
1012         "ClearToken/timeStamp", HFILL }},
1013     { &hf_h235_password,
1014       { "password", "h235.password",
1015         FT_STRING, BASE_NONE, NULL, 0,
1016         "ClearToken/password", HFILL }},
1017     { &hf_h235_dhkey,
1018       { "dhkey", "h235.dhkey",
1019         FT_NONE, BASE_NONE, NULL, 0,
1020         "ClearToken/dhkey", HFILL }},
1021     { &hf_h235_challenge,
1022       { "challenge", "h235.challenge",
1023         FT_BYTES, BASE_HEX, NULL, 0,
1024         "ClearToken/challenge", HFILL }},
1025     { &hf_h235_random,
1026       { "random", "h235.random",
1027         FT_INT32, BASE_DEC, NULL, 0,
1028         "ClearToken/random", HFILL }},
1029     { &hf_h235_certificate,
1030       { "certificate", "h235.certificate",
1031         FT_NONE, BASE_NONE, NULL, 0,
1032         "ClearToken/certificate", HFILL }},
1033     { &hf_h235_generalID,
1034       { "generalID", "h235.generalID",
1035         FT_STRING, BASE_NONE, NULL, 0,
1036         "", HFILL }},
1037     { &hf_h235_eckasdhkey,
1038       { "eckasdhkey", "h235.eckasdhkey",
1039         FT_UINT32, BASE_DEC, VALS(ECKASDH_vals), 0,
1040         "ClearToken/eckasdhkey", HFILL }},
1041     { &hf_h235_sendersID,
1042       { "sendersID", "h235.sendersID",
1043         FT_STRING, BASE_NONE, NULL, 0,
1044         "ClearToken/sendersID", HFILL }},
1045     { &hf_h235_h235Key,
1046       { "h235Key", "h235.h235Key",
1047         FT_UINT32, BASE_DEC, VALS(H235Key_vals), 0,
1048         "ClearToken/h235Key", HFILL }},
1049     { &hf_h235_toBeSigned,
1050       { "toBeSigned", "h235.toBeSigned",
1051         FT_NONE, BASE_NONE, NULL, 0,
1052         "SIGNEDxxx/toBeSigned", HFILL }},
1053     { &hf_h235_algorithmOID,
1054       { "algorithmOID", "h235.algorithmOID",
1055         FT_STRING, BASE_NONE, NULL, 0,
1056         "", HFILL }},
1057     { &hf_h235_paramS,
1058       { "paramS", "h235.paramS",
1059         FT_NONE, BASE_NONE, NULL, 0,
1060         "", HFILL }},
1061     { &hf_h235_signaturedata,
1062       { "signature", "h235.signature",
1063         FT_BYTES, BASE_HEX, NULL, 0,
1064         "SIGNEDxxx/signature", HFILL }},
1065     { &hf_h235_encryptedData,
1066       { "encryptedData", "h235.encryptedData",
1067         FT_BYTES, BASE_HEX, NULL, 0,
1068         "ENCRYPTEDxxx/encryptedData", HFILL }},
1069     { &hf_h235_hash,
1070       { "hash", "h235.hash",
1071         FT_BYTES, BASE_HEX, NULL, 0,
1072         "HASHEDxxx/hash", HFILL }},
1073     { &hf_h235_ranInt,
1074       { "ranInt", "h235.ranInt",
1075         FT_INT32, BASE_DEC, NULL, 0,
1076         "Params/ranInt", HFILL }},
1077     { &hf_h235_iv8,
1078       { "iv8", "h235.iv8",
1079         FT_BYTES, BASE_HEX, NULL, 0,
1080         "Params/iv8", HFILL }},
1081     { &hf_h235_iv16,
1082       { "iv16", "h235.iv16",
1083         FT_BYTES, BASE_HEX, NULL, 0,
1084         "Params/iv16", HFILL }},
1085     { &hf_h235_iv,
1086       { "iv", "h235.iv",
1087         FT_BYTES, BASE_HEX, NULL, 0,
1088         "Params/iv", HFILL }},
1089     { &hf_h235_clearSalt,
1090       { "clearSalt", "h235.clearSalt",
1091         FT_BYTES, BASE_HEX, NULL, 0,
1092         "Params/clearSalt", HFILL }},
1093     { &hf_h235_cryptoEncryptedToken,
1094       { "cryptoEncryptedToken", "h235.cryptoEncryptedToken",
1095         FT_NONE, BASE_NONE, NULL, 0,
1096         "CryptoToken/cryptoEncryptedToken", HFILL }},
1097     { &hf_h235_encryptedToken,
1098       { "token", "h235.token",
1099         FT_NONE, BASE_NONE, NULL, 0,
1100         "CryptoToken/cryptoEncryptedToken/token", HFILL }},
1101     { &hf_h235_cryptoSignedToken,
1102       { "cryptoSignedToken", "h235.cryptoSignedToken",
1103         FT_NONE, BASE_NONE, NULL, 0,
1104         "CryptoToken/cryptoSignedToken", HFILL }},
1105     { &hf_h235_signedToken,
1106       { "token", "h235.token",
1107         FT_NONE, BASE_NONE, NULL, 0,
1108         "CryptoToken/cryptoSignedToken/token", HFILL }},
1109     { &hf_h235_cryptoHashedToken,
1110       { "cryptoHashedToken", "h235.cryptoHashedToken",
1111         FT_NONE, BASE_NONE, NULL, 0,
1112         "CryptoToken/cryptoHashedToken", HFILL }},
1113     { &hf_h235_hashedVals,
1114       { "hashedVals", "h235.hashedVals",
1115         FT_NONE, BASE_NONE, NULL, 0,
1116         "CryptoToken/cryptoHashedToken/hashedVals", HFILL }},
1117     { &hf_h235_hashedToken,
1118       { "token", "h235.token",
1119         FT_NONE, BASE_NONE, NULL, 0,
1120         "CryptoToken/cryptoHashedToken/token", HFILL }},
1121     { &hf_h235_cryptoPwdEncr,
1122       { "cryptoPwdEncr", "h235.cryptoPwdEncr",
1123         FT_NONE, BASE_NONE, NULL, 0,
1124         "CryptoToken/cryptoPwdEncr", HFILL }},
1125     { &hf_h235_secureChannel,
1126       { "secureChannel", "h235.secureChannel",
1127         FT_BYTES, BASE_HEX, NULL, 0,
1128         "H235Key/secureChannel", HFILL }},
1129     { &hf_h235_sharedSecret,
1130       { "sharedSecret", "h235.sharedSecret",
1131         FT_NONE, BASE_NONE, NULL, 0,
1132         "H235Key/sharedSecret", HFILL }},
1133     { &hf_h235_certProtectedKey,
1134       { "certProtectedKey", "h235.certProtectedKey",
1135         FT_NONE, BASE_NONE, NULL, 0,
1136         "H235Key/certProtectedKey", HFILL }},
1137     { &hf_h235_secureSharedSecret,
1138       { "secureSharedSecret", "h235.secureSharedSecret",
1139         FT_NONE, BASE_NONE, NULL, 0,
1140         "H235Key/secureSharedSecret", HFILL }},
1141     { &hf_h235_encryptedSessionKey,
1142       { "encryptedSessionKey", "h235.encryptedSessionKey",
1143         FT_BYTES, BASE_HEX, NULL, 0,
1144         "V3KeySyncMaterial/encryptedSessionKey", HFILL }},
1145     { &hf_h235_encryptedSaltingKey,
1146       { "encryptedSaltingKey", "h235.encryptedSaltingKey",
1147         FT_BYTES, BASE_HEX, NULL, 0,
1148         "V3KeySyncMaterial/encryptedSaltingKey", HFILL }},
1149     { &hf_h235_clearSaltingKey,
1150       { "clearSaltingKey", "h235.clearSaltingKey",
1151         FT_BYTES, BASE_HEX, NULL, 0,
1152         "V3KeySyncMaterial/clearSaltingKey", HFILL }},
1153     { &hf_h235_paramSsalt,
1154       { "paramSsalt", "h235.paramSsalt",
1155         FT_NONE, BASE_NONE, NULL, 0,
1156         "V3KeySyncMaterial/paramSsalt", HFILL }},
1157     { &hf_h235_keyDerivationOID,
1158       { "keyDerivationOID", "h235.keyDerivationOID",
1159         FT_STRING, BASE_NONE, NULL, 0,
1160         "V3KeySyncMaterial/keyDerivationOID", HFILL }},
1161
1162 /*--- End of included file: packet-h235-hfarr.c ---*/
1163
1164   };
1165
1166   /* List of subtrees */
1167   static gint *ett[] = {
1168
1169 /*--- Included file: packet-h235-ettarr.c ---*/
1170
1171     &ett_h235_NonStandardParameter,
1172     &ett_h235_DHset,
1173     &ett_h235_ECpoint,
1174     &ett_h235_ECKASDH,
1175     &ett_h235_T_eckasdhp,
1176     &ett_h235_T_eckasdh2,
1177     &ett_h235_TypedCertificate,
1178     &ett_h235_AuthenticationBES,
1179     &ett_h235_AuthenticationMechanism,
1180     &ett_h235_ClearToken,
1181     &ett_h235_SIGNEDxxx,
1182     &ett_h235_ENCRYPTEDxxx,
1183     &ett_h235_HASHEDxxx,
1184     &ett_h235_Params,
1185     &ett_h235_CryptoToken,
1186     &ett_h235_T_cryptoEncryptedToken,
1187     &ett_h235_T_cryptoSignedToken,
1188     &ett_h235_T_cryptoHashedToken,
1189     &ett_h235_H235Key,
1190     &ett_h235_V3KeySyncMaterial,
1191
1192 /*--- End of included file: packet-h235-ettarr.c ---*/
1193
1194   };
1195
1196   /* Register protocol */
1197   proto_h235 = proto_register_protocol(PNAME, PSNAME, PFNAME);
1198
1199   /* Register fields and subtrees */
1200   proto_register_field_array(proto_h235, hf, array_length(hf));
1201   proto_register_subtree_array(ett, array_length(ett));
1202
1203 }
1204
1205
1206 /*--- proto_reg_handoff_h235 -------------------------------------------*/
1207 void proto_reg_handoff_h235(void) {
1208 }
1209