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