Fix up a bunch of arguments to "dissect_ber_identifier()" to match its
[obnox/wireshark/wip.git] / epan / dissectors / packet-cmp.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
3 /* ./packet-cmp.c                                                             */
4 /* ../../tools/asn2eth.py -X -b -e -p cmp -c cmp.cnf -s packet-cmp-template CMP.asn */
5
6 /* Input file: packet-cmp-template.c */
7
8 /* packet-cmp.c
9  * Routines for RFC2510 Certificate Management Protocol packet dissection
10  *   Ronnie Sahlberg 2004
11  *
12  * $Id: packet-cmp-template.c 12740 2004-12-13 08:15:34Z sahlberg $
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-ber.h"
45 #include "packet-cmp.h"
46 #include "packet-crmf.h"
47 #include "packet-pkix1explicit.h"
48 #include "packet-pkix1implicit.h"
49
50 #define PNAME  "Certificate Management Protocol"
51 #define PSNAME "CMP"
52 #define PFNAME "cmp"
53
54 /* Initialize the protocol and registered fields */
55 int proto_cmp = -1;
56 static int hf_cmp_type_oid = -1;
57
58 /*--- Included file: packet-cmp-hf.c ---*/
59
60 static int hf_cmp_header = -1;                    /* PKIHeader */
61 static int hf_cmp_body = -1;                      /* PKIBody */
62 static int hf_cmp_protection = -1;                /* PKIProtection */
63 static int hf_cmp_extraCerts = -1;                /* SEQUENCE_SIZE_1_MAX_OF_Certificate */
64 static int hf_cmp_extraCerts_item = -1;           /* Certificate */
65 static int hf_cmp_pvno = -1;                      /* T_pvno */
66 static int hf_cmp_sender = -1;                    /* GeneralName */
67 static int hf_cmp_recipient = -1;                 /* GeneralName */
68 static int hf_cmp_messageTime = -1;               /* GeneralizedTime */
69 static int hf_cmp_protectionAlg = -1;             /* AlgorithmIdentifier */
70 static int hf_cmp_senderKID = -1;                 /* KeyIdentifier */
71 static int hf_cmp_recipKID = -1;                  /* KeyIdentifier */
72 static int hf_cmp_transactionID = -1;             /* OCTET_STRING */
73 static int hf_cmp_senderNonce = -1;               /* OCTET_STRING */
74 static int hf_cmp_recipNonce = -1;                /* OCTET_STRING */
75 static int hf_cmp_freeText = -1;                  /* PKIFreeText */
76 static int hf_cmp_generalInfo = -1;               /* SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue */
77 static int hf_cmp_generalInfo_item = -1;          /* InfoTypeAndValue */
78 static int hf_cmp_PKIFreeText_item = -1;          /* UTF8String */
79 static int hf_cmp_ir = -1;                        /* CertReqMessages */
80 static int hf_cmp_ip = -1;                        /* CertRepMessage */
81 static int hf_cmp_cr = -1;                        /* CertReqMessages */
82 static int hf_cmp_cp = -1;                        /* CertRepMessage */
83 static int hf_cmp_popdecc = -1;                   /* POPODecKeyChallContent */
84 static int hf_cmp_popdecr = -1;                   /* POPODecKeyRespContent */
85 static int hf_cmp_kur = -1;                       /* CertReqMessages */
86 static int hf_cmp_kup = -1;                       /* CertRepMessage */
87 static int hf_cmp_krr = -1;                       /* CertReqMessages */
88 static int hf_cmp_krp = -1;                       /* KeyRecRepContent */
89 static int hf_cmp_rr = -1;                        /* RevReqContent */
90 static int hf_cmp_rp = -1;                        /* RevRepContent */
91 static int hf_cmp_ccr = -1;                       /* CertReqMessages */
92 static int hf_cmp_ccp = -1;                       /* CertRepMessage */
93 static int hf_cmp_ckuann = -1;                    /* CAKeyUpdAnnContent */
94 static int hf_cmp_cann = -1;                      /* CertAnnContent */
95 static int hf_cmp_rann = -1;                      /* RevAnnContent */
96 static int hf_cmp_crlann = -1;                    /* CRLAnnContent */
97 static int hf_cmp_conf = -1;                      /* PKIConfirmContent */
98 static int hf_cmp_nested = -1;                    /* NestedMessageContent */
99 static int hf_cmp_genm = -1;                      /* GenMsgContent */
100 static int hf_cmp_genp = -1;                      /* GenRepContent */
101 static int hf_cmp_error = -1;                     /* ErrorMsgContent */
102 static int hf_cmp_salt = -1;                      /* OCTET_STRING */
103 static int hf_cmp_owf = -1;                       /* AlgorithmIdentifier */
104 static int hf_cmp_iterationCount = -1;            /* INTEGER */
105 static int hf_cmp_mac = -1;                       /* AlgorithmIdentifier */
106 static int hf_cmp_status = -1;                    /* PKIStatus */
107 static int hf_cmp_statusString = -1;              /* PKIFreeText */
108 static int hf_cmp_failInfo = -1;                  /* PKIFailureInfo */
109 static int hf_cmp_hashAlg = -1;                   /* AlgorithmIdentifier */
110 static int hf_cmp_certId = -1;                    /* CertId */
111 static int hf_cmp_hashVal = -1;                   /* BIT_STRING */
112 static int hf_cmp_POPODecKeyChallContent_item = -1;  /* Challenge */
113 static int hf_cmp_witness = -1;                   /* OCTET_STRING */
114 static int hf_cmp_challenge = -1;                 /* OCTET_STRING */
115 static int hf_cmp_POPODecKeyRespContent_item = -1;  /* INTEGER */
116 static int hf_cmp_caPubs = -1;                    /* SEQUENCE_SIZE_1_MAX_OF_Certificate */
117 static int hf_cmp_caPubs_item = -1;               /* Certificate */
118 static int hf_cmp_response = -1;                  /* SEQUENCE_OF_CertResponse */
119 static int hf_cmp_response_item = -1;             /* CertResponse */
120 static int hf_cmp_certReqId = -1;                 /* INTEGER */
121 static int hf_cmp_status1 = -1;                   /* PKIStatusInfo */
122 static int hf_cmp_certifiedKeyPair = -1;          /* CertifiedKeyPair */
123 static int hf_cmp_rspInfo = -1;                   /* OCTET_STRING */
124 static int hf_cmp_certOrEncCert = -1;             /* CertOrEncCert */
125 static int hf_cmp_privateKey = -1;                /* EncryptedValue */
126 static int hf_cmp_publicationInfo = -1;           /* PKIPublicationInfo */
127 static int hf_cmp_certificate = -1;               /* Certificate */
128 static int hf_cmp_encryptedCert = -1;             /* EncryptedValue */
129 static int hf_cmp_newSigCert = -1;                /* Certificate */
130 static int hf_cmp_caCerts = -1;                   /* SEQUENCE_SIZE_1_MAX_OF_Certificate */
131 static int hf_cmp_caCerts_item = -1;              /* Certificate */
132 static int hf_cmp_keyPairHist = -1;               /* SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair */
133 static int hf_cmp_keyPairHist_item = -1;          /* CertifiedKeyPair */
134 static int hf_cmp_RevReqContent_item = -1;        /* RevDetails */
135 static int hf_cmp_certDetails = -1;               /* CertTemplate */
136 static int hf_cmp_revocationReason = -1;          /* ReasonFlags */
137 static int hf_cmp_badSinceDate = -1;              /* GeneralizedTime */
138 static int hf_cmp_crlEntryDetails = -1;           /* Extensions */
139 static int hf_cmp_status2 = -1;                   /* SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo */
140 static int hf_cmp_status_item = -1;               /* PKIStatusInfo */
141 static int hf_cmp_revCerts = -1;                  /* SEQUENCE_SIZE_1_MAX_OF_CertId */
142 static int hf_cmp_revCerts_item = -1;             /* CertId */
143 static int hf_cmp_crls = -1;                      /* SEQUENCE_SIZE_1_MAX_OF_CertificateList */
144 static int hf_cmp_crls_item = -1;                 /* CertificateList */
145 static int hf_cmp_oldWithNew = -1;                /* Certificate */
146 static int hf_cmp_newWithOld = -1;                /* Certificate */
147 static int hf_cmp_newWithNew = -1;                /* Certificate */
148 static int hf_cmp_willBeRevokedAt = -1;           /* GeneralizedTime */
149 static int hf_cmp_crlDetails = -1;                /* Extensions */
150 static int hf_cmp_CRLAnnContent_item = -1;        /* CertificateList */
151 static int hf_cmp_infoType = -1;                  /* T_infoType */
152 static int hf_cmp_infoValue = -1;                 /* T_infoValue */
153 static int hf_cmp_GenMsgContent_item = -1;        /* InfoTypeAndValue */
154 static int hf_cmp_GenRepContent_item = -1;        /* InfoTypeAndValue */
155 static int hf_cmp_pKIStatusInfo = -1;             /* PKIStatusInfo */
156 static int hf_cmp_errorCode = -1;                 /* INTEGER */
157 static int hf_cmp_errorDetails = -1;              /* PKIFreeText */
158 /* named bits */
159 static int hf_cmp_PKIFailureInfo_badAlg = -1;
160 static int hf_cmp_PKIFailureInfo_badMessageCheck = -1;
161 static int hf_cmp_PKIFailureInfo_badRequest = -1;
162 static int hf_cmp_PKIFailureInfo_badTime = -1;
163 static int hf_cmp_PKIFailureInfo_badCertId = -1;
164 static int hf_cmp_PKIFailureInfo_badDataFormat = -1;
165 static int hf_cmp_PKIFailureInfo_wrongAuthority = -1;
166 static int hf_cmp_PKIFailureInfo_incorrectData = -1;
167 static int hf_cmp_PKIFailureInfo_missingTimeStamp = -1;
168 static int hf_cmp_PKIFailureInfo_badPOP = -1;
169
170 /*--- End of included file: packet-cmp-hf.c ---*/
171
172
173 /* Initialize the subtree pointers */
174 static gint ett_cmp = -1;
175
176 /*--- Included file: packet-cmp-ett.c ---*/
177
178 static gint ett_cmp_PKIMessage = -1;
179 static gint ett_cmp_SEQUENCE_SIZE_1_MAX_OF_Certificate = -1;
180 static gint ett_cmp_PKIHeader = -1;
181 static gint ett_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue = -1;
182 static gint ett_cmp_PKIFreeText = -1;
183 static gint ett_cmp_PKIBody = -1;
184 static gint ett_cmp_ProtectedPart = -1;
185 static gint ett_cmp_PBMParameter = -1;
186 static gint ett_cmp_DHBMParameter = -1;
187 static gint ett_cmp_PKIFailureInfo = -1;
188 static gint ett_cmp_PKIStatusInfo = -1;
189 static gint ett_cmp_OOBCertHash = -1;
190 static gint ett_cmp_POPODecKeyChallContent = -1;
191 static gint ett_cmp_Challenge = -1;
192 static gint ett_cmp_POPODecKeyRespContent = -1;
193 static gint ett_cmp_CertRepMessage = -1;
194 static gint ett_cmp_SEQUENCE_OF_CertResponse = -1;
195 static gint ett_cmp_CertResponse = -1;
196 static gint ett_cmp_CertifiedKeyPair = -1;
197 static gint ett_cmp_CertOrEncCert = -1;
198 static gint ett_cmp_KeyRecRepContent = -1;
199 static gint ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair = -1;
200 static gint ett_cmp_RevReqContent = -1;
201 static gint ett_cmp_RevDetails = -1;
202 static gint ett_cmp_RevRepContent = -1;
203 static gint ett_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo = -1;
204 static gint ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId = -1;
205 static gint ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList = -1;
206 static gint ett_cmp_CAKeyUpdAnnContent = -1;
207 static gint ett_cmp_RevAnnContent = -1;
208 static gint ett_cmp_CRLAnnContent = -1;
209 static gint ett_cmp_InfoTypeAndValue = -1;
210 static gint ett_cmp_GenMsgContent = -1;
211 static gint ett_cmp_GenRepContent = -1;
212 static gint ett_cmp_ErrorMsgContent = -1;
213
214 /*--- End of included file: packet-cmp-ett.c ---*/
215
216
217 static char object_identifier_id[BER_MAX_OID_STR_LEN];
218
219
220
221 /*--- Included file: packet-cmp-fn.c ---*/
222
223 /*--- Cyclic dependencies ---*/
224
225 /* PKIMessage -> PKIBody -> NestedMessageContent -> PKIMessage */
226 int dissect_cmp_PKIMessage(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
227
228
229
230 /*--- Fields for imported types ---*/
231
232 static int dissect_extraCerts_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
233   return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_extraCerts_item);
234 }
235 static int dissect_sender(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
236   return dissect_pkix1implicit_GeneralName(FALSE, tvb, offset, pinfo, tree, hf_cmp_sender);
237 }
238 static int dissect_recipient(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
239   return dissect_pkix1implicit_GeneralName(FALSE, tvb, offset, pinfo, tree, hf_cmp_recipient);
240 }
241 static int dissect_protectionAlg(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
242   return dissect_pkix1explicit_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cmp_protectionAlg);
243 }
244 static int dissect_ir(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
245   return dissect_crmf_CertReqMessages(FALSE, tvb, offset, pinfo, tree, hf_cmp_ir);
246 }
247 static int dissect_cr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
248   return dissect_crmf_CertReqMessages(FALSE, tvb, offset, pinfo, tree, hf_cmp_cr);
249 }
250 static int dissect_kur(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
251   return dissect_crmf_CertReqMessages(FALSE, tvb, offset, pinfo, tree, hf_cmp_kur);
252 }
253 static int dissect_krr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
254   return dissect_crmf_CertReqMessages(FALSE, tvb, offset, pinfo, tree, hf_cmp_krr);
255 }
256 static int dissect_ccr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
257   return dissect_crmf_CertReqMessages(FALSE, tvb, offset, pinfo, tree, hf_cmp_ccr);
258 }
259 static int dissect_owf(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
260   return dissect_pkix1explicit_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cmp_owf);
261 }
262 static int dissect_mac(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
263   return dissect_pkix1explicit_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cmp_mac);
264 }
265 static int dissect_hashAlg(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
266   return dissect_pkix1explicit_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cmp_hashAlg);
267 }
268 static int dissect_certId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
269   return dissect_crmf_CertId(FALSE, tvb, offset, pinfo, tree, hf_cmp_certId);
270 }
271 static int dissect_caPubs_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
272   return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_caPubs_item);
273 }
274 static int dissect_privateKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
275   return dissect_crmf_EncryptedValue(FALSE, tvb, offset, pinfo, tree, hf_cmp_privateKey);
276 }
277 static int dissect_publicationInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
278   return dissect_crmf_PKIPublicationInfo(FALSE, tvb, offset, pinfo, tree, hf_cmp_publicationInfo);
279 }
280 static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
281   return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_certificate);
282 }
283 static int dissect_encryptedCert(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
284   return dissect_crmf_EncryptedValue(FALSE, tvb, offset, pinfo, tree, hf_cmp_encryptedCert);
285 }
286 static int dissect_newSigCert(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
287   return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_newSigCert);
288 }
289 static int dissect_caCerts_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
290   return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_caCerts_item);
291 }
292 static int dissect_certDetails(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
293   return dissect_crmf_CertTemplate(FALSE, tvb, offset, pinfo, tree, hf_cmp_certDetails);
294 }
295 static int dissect_revocationReason(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
296   return dissect_pkix1implicit_ReasonFlags(FALSE, tvb, offset, pinfo, tree, hf_cmp_revocationReason);
297 }
298 static int dissect_crlEntryDetails(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
299   return dissect_pkix1explicit_Extensions(FALSE, tvb, offset, pinfo, tree, hf_cmp_crlEntryDetails);
300 }
301 static int dissect_revCerts_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
302   return dissect_crmf_CertId(FALSE, tvb, offset, pinfo, tree, hf_cmp_revCerts_item);
303 }
304 static int dissect_crls_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
305   return dissect_pkix1explicit_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cmp_crls_item);
306 }
307 static int dissect_oldWithNew(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
308   return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_oldWithNew);
309 }
310 static int dissect_newWithOld(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
311   return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_newWithOld);
312 }
313 static int dissect_newWithNew(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
314   return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_newWithNew);
315 }
316 static int dissect_crlDetails(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
317   return dissect_pkix1explicit_Extensions(FALSE, tvb, offset, pinfo, tree, hf_cmp_crlDetails);
318 }
319 static int dissect_CRLAnnContent_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
320   return dissect_pkix1explicit_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cmp_CRLAnnContent_item);
321 }
322
323
324 static int
325 dissect_cmp_KeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
326   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
327                                     NULL);
328
329   return offset;
330 }
331 static int dissect_senderKID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
332   return dissect_cmp_KeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cmp_senderKID);
333 }
334 static int dissect_recipKID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
335   return dissect_cmp_KeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cmp_recipKID);
336 }
337
338
339 static const value_string cmp_T_pvno_vals[] = {
340   {   1, "ietf-version2" },
341   { 0, NULL }
342 };
343
344
345 static int
346 dissect_cmp_T_pvno(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
347   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
348                                   NULL);
349
350   return offset;
351 }
352 static int dissect_pvno(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
353   return dissect_cmp_T_pvno(FALSE, tvb, offset, pinfo, tree, hf_cmp_pvno);
354 }
355
356
357 static int
358 dissect_cmp_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
359   offset = dissect_ber_GeneralizedTime(implicit_tag, pinfo, tree, tvb, offset, hf_index);
360
361   return offset;
362 }
363 static int dissect_messageTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
364   return dissect_cmp_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cmp_messageTime);
365 }
366 static int dissect_badSinceDate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
367   return dissect_cmp_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cmp_badSinceDate);
368 }
369 static int dissect_willBeRevokedAt(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
370   return dissect_cmp_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cmp_willBeRevokedAt);
371 }
372
373
374 static int
375 dissect_cmp_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
376   offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
377                                     NULL);
378
379   return offset;
380 }
381 static int dissect_transactionID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
382   return dissect_cmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cmp_transactionID);
383 }
384 static int dissect_senderNonce(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
385   return dissect_cmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cmp_senderNonce);
386 }
387 static int dissect_recipNonce(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
388   return dissect_cmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cmp_recipNonce);
389 }
390 static int dissect_salt(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
391   return dissect_cmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cmp_salt);
392 }
393 static int dissect_witness(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
394   return dissect_cmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cmp_witness);
395 }
396 static int dissect_challenge(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
397   return dissect_cmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cmp_challenge);
398 }
399 static int dissect_rspInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
400   return dissect_cmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cmp_rspInfo);
401 }
402
403
404 static int
405 dissect_cmp_UTF8String(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
406   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTF8String,
407                                          pinfo, tree, tvb, offset, hf_index,
408                                          NULL);
409
410   return offset;
411 }
412 static int dissect_PKIFreeText_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
413   return dissect_cmp_UTF8String(FALSE, tvb, offset, pinfo, tree, hf_cmp_PKIFreeText_item);
414 }
415
416 static const ber_sequence_t PKIFreeText_sequence_of[1] = {
417   { BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_PKIFreeText_item },
418 };
419
420 int
421 dissect_cmp_PKIFreeText(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
422   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
423                                    PKIFreeText_sequence_of, hf_index, ett_cmp_PKIFreeText);
424
425   return offset;
426 }
427 static int dissect_freeText(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
428   return dissect_cmp_PKIFreeText(FALSE, tvb, offset, pinfo, tree, hf_cmp_freeText);
429 }
430 static int dissect_statusString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
431   return dissect_cmp_PKIFreeText(FALSE, tvb, offset, pinfo, tree, hf_cmp_statusString);
432 }
433 static int dissect_errorDetails(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
434   return dissect_cmp_PKIFreeText(FALSE, tvb, offset, pinfo, tree, hf_cmp_errorDetails);
435 }
436
437
438
439 static int
440 dissect_cmp_T_infoType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
441   offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
442                                          hf_cmp_type_oid, object_identifier_id);
443
444
445   return offset;
446 }
447 static int dissect_infoType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
448   return dissect_cmp_T_infoType(FALSE, tvb, offset, pinfo, tree, hf_cmp_infoType);
449 }
450
451
452
453 static int
454 dissect_cmp_T_infoValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
455   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
456
457
458   return offset;
459 }
460 static int dissect_infoValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
461   return dissect_cmp_T_infoValue(FALSE, tvb, offset, pinfo, tree, hf_cmp_infoValue);
462 }
463
464 static const ber_sequence_t InfoTypeAndValue_sequence[] = {
465   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_infoType },
466   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_infoValue },
467   { 0, 0, 0, NULL }
468 };
469
470 int
471 dissect_cmp_InfoTypeAndValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
472   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
473                                 InfoTypeAndValue_sequence, hf_index, ett_cmp_InfoTypeAndValue);
474
475   return offset;
476 }
477 static int dissect_generalInfo_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
478   return dissect_cmp_InfoTypeAndValue(FALSE, tvb, offset, pinfo, tree, hf_cmp_generalInfo_item);
479 }
480 static int dissect_GenMsgContent_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
481   return dissect_cmp_InfoTypeAndValue(FALSE, tvb, offset, pinfo, tree, hf_cmp_GenMsgContent_item);
482 }
483 static int dissect_GenRepContent_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
484   return dissect_cmp_InfoTypeAndValue(FALSE, tvb, offset, pinfo, tree, hf_cmp_GenRepContent_item);
485 }
486
487 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue_sequence_of[1] = {
488   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_generalInfo_item },
489 };
490
491 static int
492 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
493   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
494                                    SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue);
495
496   return offset;
497 }
498 static int dissect_generalInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
499   return dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue(FALSE, tvb, offset, pinfo, tree, hf_cmp_generalInfo);
500 }
501
502 static const ber_sequence_t PKIHeader_sequence[] = {
503   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pvno },
504   { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_sender },
505   { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_recipient },
506   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_messageTime },
507   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_protectionAlg },
508   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_senderKID },
509   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL, dissect_recipKID },
510   { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL, dissect_transactionID },
511   { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL, dissect_senderNonce },
512   { BER_CLASS_CON, 6, BER_FLAGS_OPTIONAL, dissect_recipNonce },
513   { BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL, dissect_freeText },
514   { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL, dissect_generalInfo },
515   { 0, 0, 0, NULL }
516 };
517
518 int
519 dissect_cmp_PKIHeader(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
520   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
521                                 PKIHeader_sequence, hf_index, ett_cmp_PKIHeader);
522
523   return offset;
524 }
525 static int dissect_header(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
526   return dissect_cmp_PKIHeader(FALSE, tvb, offset, pinfo, tree, hf_cmp_header);
527 }
528
529 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_Certificate_sequence_of[1] = {
530   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_extraCerts_item },
531 };
532
533 static int
534 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
535   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
536                                    SEQUENCE_SIZE_1_MAX_OF_Certificate_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_Certificate);
537
538   return offset;
539 }
540 static int dissect_extraCerts(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
541   return dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_extraCerts);
542 }
543 static int dissect_caPubs(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
544   return dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_caPubs);
545 }
546 static int dissect_caCerts(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
547   return dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_caCerts);
548 }
549
550
551
552 static int
553 dissect_cmp_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
554   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
555                                   NULL);
556
557   return offset;
558 }
559 static int dissect_iterationCount(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
560   return dissect_cmp_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_cmp_iterationCount);
561 }
562 static int dissect_POPODecKeyRespContent_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
563   return dissect_cmp_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_cmp_POPODecKeyRespContent_item);
564 }
565 static int dissect_certReqId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
566   return dissect_cmp_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_cmp_certReqId);
567 }
568 static int dissect_errorCode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
569   return dissect_cmp_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_cmp_errorCode);
570 }
571
572
573 const value_string cmp_PKIStatus_vals[] = {
574   {   0, "granted" },
575   {   1, "grantedWithMods" },
576   {   2, "rejection" },
577   {   3, "waiting" },
578   {   4, "revocationWarning" },
579   {   5, "revocationNotification" },
580   {   6, "keyUpdateWarning" },
581   { 0, NULL }
582 };
583
584
585 int
586 dissect_cmp_PKIStatus(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
587   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
588                                   NULL);
589
590   return offset;
591 }
592 static int dissect_status(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
593   return dissect_cmp_PKIStatus(FALSE, tvb, offset, pinfo, tree, hf_cmp_status);
594 }
595
596 static const asn_namedbit PKIFailureInfo_bits[] = {
597   {  0, &hf_cmp_PKIFailureInfo_badAlg, -1, -1, "badAlg", NULL },
598   {  1, &hf_cmp_PKIFailureInfo_badMessageCheck, -1, -1, "badMessageCheck", NULL },
599   {  2, &hf_cmp_PKIFailureInfo_badRequest, -1, -1, "badRequest", NULL },
600   {  3, &hf_cmp_PKIFailureInfo_badTime, -1, -1, "badTime", NULL },
601   {  4, &hf_cmp_PKIFailureInfo_badCertId, -1, -1, "badCertId", NULL },
602   {  5, &hf_cmp_PKIFailureInfo_badDataFormat, -1, -1, "badDataFormat", NULL },
603   {  6, &hf_cmp_PKIFailureInfo_wrongAuthority, -1, -1, "wrongAuthority", NULL },
604   {  7, &hf_cmp_PKIFailureInfo_incorrectData, -1, -1, "incorrectData", NULL },
605   {  8, &hf_cmp_PKIFailureInfo_missingTimeStamp, -1, -1, "missingTimeStamp", NULL },
606   {  9, &hf_cmp_PKIFailureInfo_badPOP, -1, -1, "badPOP", NULL },
607   { 0, NULL, 0, 0, NULL, NULL }
608 };
609
610 int
611 dissect_cmp_PKIFailureInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
612   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
613                                  PKIFailureInfo_bits, hf_index, ett_cmp_PKIFailureInfo,
614                                  NULL);
615
616   return offset;
617 }
618 static int dissect_failInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
619   return dissect_cmp_PKIFailureInfo(FALSE, tvb, offset, pinfo, tree, hf_cmp_failInfo);
620 }
621
622 static const ber_sequence_t PKIStatusInfo_sequence[] = {
623   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_status },
624   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_statusString },
625   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_failInfo },
626   { 0, 0, 0, NULL }
627 };
628
629 int
630 dissect_cmp_PKIStatusInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
631   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
632                                 PKIStatusInfo_sequence, hf_index, ett_cmp_PKIStatusInfo);
633
634   return offset;
635 }
636 static int dissect_status1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
637   return dissect_cmp_PKIStatusInfo(FALSE, tvb, offset, pinfo, tree, hf_cmp_status1);
638 }
639 static int dissect_status_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
640   return dissect_cmp_PKIStatusInfo(FALSE, tvb, offset, pinfo, tree, hf_cmp_status_item);
641 }
642 static int dissect_pKIStatusInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
643   return dissect_cmp_PKIStatusInfo(FALSE, tvb, offset, pinfo, tree, hf_cmp_pKIStatusInfo);
644 }
645
646
647 const value_string cmp_CertOrEncCert_vals[] = {
648   {   0, "certificate" },
649   {   1, "encryptedCert" },
650   { 0, NULL }
651 };
652
653 static const ber_choice_t CertOrEncCert_choice[] = {
654   {   0, BER_CLASS_CON, 0, 0, dissect_certificate },
655   {   1, BER_CLASS_CON, 1, 0, dissect_encryptedCert },
656   { 0, 0, 0, 0, NULL }
657 };
658
659 int
660 dissect_cmp_CertOrEncCert(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
661   offset = dissect_ber_CHOICE(pinfo, tree, tvb, offset,
662                               CertOrEncCert_choice, hf_index, ett_cmp_CertOrEncCert, NULL);
663
664   return offset;
665 }
666 static int dissect_certOrEncCert(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
667   return dissect_cmp_CertOrEncCert(FALSE, tvb, offset, pinfo, tree, hf_cmp_certOrEncCert);
668 }
669
670 static const ber_sequence_t CertifiedKeyPair_sequence[] = {
671   { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_certOrEncCert },
672   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_privateKey },
673   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_publicationInfo },
674   { 0, 0, 0, NULL }
675 };
676
677 int
678 dissect_cmp_CertifiedKeyPair(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
679   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
680                                 CertifiedKeyPair_sequence, hf_index, ett_cmp_CertifiedKeyPair);
681
682   return offset;
683 }
684 static int dissect_certifiedKeyPair(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
685   return dissect_cmp_CertifiedKeyPair(FALSE, tvb, offset, pinfo, tree, hf_cmp_certifiedKeyPair);
686 }
687 static int dissect_keyPairHist_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
688   return dissect_cmp_CertifiedKeyPair(FALSE, tvb, offset, pinfo, tree, hf_cmp_keyPairHist_item);
689 }
690
691 static const ber_sequence_t CertResponse_sequence[] = {
692   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_certReqId },
693   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_status1 },
694   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_certifiedKeyPair },
695   { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_rspInfo },
696   { 0, 0, 0, NULL }
697 };
698
699 int
700 dissect_cmp_CertResponse(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
701   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
702                                 CertResponse_sequence, hf_index, ett_cmp_CertResponse);
703
704   return offset;
705 }
706 static int dissect_response_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
707   return dissect_cmp_CertResponse(FALSE, tvb, offset, pinfo, tree, hf_cmp_response_item);
708 }
709
710 static const ber_sequence_t SEQUENCE_OF_CertResponse_sequence_of[1] = {
711   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_response_item },
712 };
713
714 static int
715 dissect_cmp_SEQUENCE_OF_CertResponse(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
716   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
717                                    SEQUENCE_OF_CertResponse_sequence_of, hf_index, ett_cmp_SEQUENCE_OF_CertResponse);
718
719   return offset;
720 }
721 static int dissect_response(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
722   return dissect_cmp_SEQUENCE_OF_CertResponse(FALSE, tvb, offset, pinfo, tree, hf_cmp_response);
723 }
724
725 static const ber_sequence_t CertRepMessage_sequence[] = {
726   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_caPubs },
727   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_response },
728   { 0, 0, 0, NULL }
729 };
730
731 int
732 dissect_cmp_CertRepMessage(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
733   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
734                                 CertRepMessage_sequence, hf_index, ett_cmp_CertRepMessage);
735
736   return offset;
737 }
738 static int dissect_ip(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
739   return dissect_cmp_CertRepMessage(FALSE, tvb, offset, pinfo, tree, hf_cmp_ip);
740 }
741 static int dissect_cp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
742   return dissect_cmp_CertRepMessage(FALSE, tvb, offset, pinfo, tree, hf_cmp_cp);
743 }
744 static int dissect_kup(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
745   return dissect_cmp_CertRepMessage(FALSE, tvb, offset, pinfo, tree, hf_cmp_kup);
746 }
747 static int dissect_ccp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
748   return dissect_cmp_CertRepMessage(FALSE, tvb, offset, pinfo, tree, hf_cmp_ccp);
749 }
750
751 static const ber_sequence_t Challenge_sequence[] = {
752   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_owf },
753   { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_witness },
754   { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_challenge },
755   { 0, 0, 0, NULL }
756 };
757
758 int
759 dissect_cmp_Challenge(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
760   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
761                                 Challenge_sequence, hf_index, ett_cmp_Challenge);
762
763   return offset;
764 }
765 static int dissect_POPODecKeyChallContent_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
766   return dissect_cmp_Challenge(FALSE, tvb, offset, pinfo, tree, hf_cmp_POPODecKeyChallContent_item);
767 }
768
769 static const ber_sequence_t POPODecKeyChallContent_sequence_of[1] = {
770   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_POPODecKeyChallContent_item },
771 };
772
773 int
774 dissect_cmp_POPODecKeyChallContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
775   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
776                                    POPODecKeyChallContent_sequence_of, hf_index, ett_cmp_POPODecKeyChallContent);
777
778   return offset;
779 }
780 static int dissect_popdecc(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
781   return dissect_cmp_POPODecKeyChallContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_popdecc);
782 }
783
784 static const ber_sequence_t POPODecKeyRespContent_sequence_of[1] = {
785   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_POPODecKeyRespContent_item },
786 };
787
788 int
789 dissect_cmp_POPODecKeyRespContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
790   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
791                                    POPODecKeyRespContent_sequence_of, hf_index, ett_cmp_POPODecKeyRespContent);
792
793   return offset;
794 }
795 static int dissect_popdecr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
796   return dissect_cmp_POPODecKeyRespContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_popdecr);
797 }
798
799 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair_sequence_of[1] = {
800   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyPairHist_item },
801 };
802
803 static int
804 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
805   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
806                                    SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair);
807
808   return offset;
809 }
810 static int dissect_keyPairHist(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
811   return dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair(FALSE, tvb, offset, pinfo, tree, hf_cmp_keyPairHist);
812 }
813
814 static const ber_sequence_t KeyRecRepContent_sequence[] = {
815   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_status1 },
816   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_newSigCert },
817   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_caCerts },
818   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_keyPairHist },
819   { 0, 0, 0, NULL }
820 };
821
822 int
823 dissect_cmp_KeyRecRepContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
824   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
825                                 KeyRecRepContent_sequence, hf_index, ett_cmp_KeyRecRepContent);
826
827   return offset;
828 }
829 static int dissect_krp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
830   return dissect_cmp_KeyRecRepContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_krp);
831 }
832
833 static const ber_sequence_t RevDetails_sequence[] = {
834   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certDetails },
835   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_revocationReason },
836   { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_badSinceDate },
837   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_crlEntryDetails },
838   { 0, 0, 0, NULL }
839 };
840
841 int
842 dissect_cmp_RevDetails(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
843   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
844                                 RevDetails_sequence, hf_index, ett_cmp_RevDetails);
845
846   return offset;
847 }
848 static int dissect_RevReqContent_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
849   return dissect_cmp_RevDetails(FALSE, tvb, offset, pinfo, tree, hf_cmp_RevReqContent_item);
850 }
851
852 static const ber_sequence_t RevReqContent_sequence_of[1] = {
853   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_RevReqContent_item },
854 };
855
856 int
857 dissect_cmp_RevReqContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
858   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
859                                    RevReqContent_sequence_of, hf_index, ett_cmp_RevReqContent);
860
861   return offset;
862 }
863 static int dissect_rr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
864   return dissect_cmp_RevReqContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_rr);
865 }
866
867 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo_sequence_of[1] = {
868   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_status_item },
869 };
870
871 static int
872 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
873   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
874                                    SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo);
875
876   return offset;
877 }
878 static int dissect_status2(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
879   return dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo(FALSE, tvb, offset, pinfo, tree, hf_cmp_status2);
880 }
881
882 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_CertId_sequence_of[1] = {
883   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_revCerts_item },
884 };
885
886 static int
887 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
888   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
889                                    SEQUENCE_SIZE_1_MAX_OF_CertId_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId);
890
891   return offset;
892 }
893 static int dissect_revCerts(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
894   return dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId(FALSE, tvb, offset, pinfo, tree, hf_cmp_revCerts);
895 }
896
897 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_CertificateList_sequence_of[1] = {
898   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_crls_item },
899 };
900
901 static int
902 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
903   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
904                                    SEQUENCE_SIZE_1_MAX_OF_CertificateList_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList);
905
906   return offset;
907 }
908 static int dissect_crls(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
909   return dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cmp_crls);
910 }
911
912 static const ber_sequence_t RevRepContent_sequence[] = {
913   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_status2 },
914   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_revCerts },
915   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_crls },
916   { 0, 0, 0, NULL }
917 };
918
919 int
920 dissect_cmp_RevRepContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
921   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
922                                 RevRepContent_sequence, hf_index, ett_cmp_RevRepContent);
923
924   return offset;
925 }
926 static int dissect_rp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
927   return dissect_cmp_RevRepContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_rp);
928 }
929
930 static const ber_sequence_t CAKeyUpdAnnContent_sequence[] = {
931   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_oldWithNew },
932   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_newWithOld },
933   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_newWithNew },
934   { 0, 0, 0, NULL }
935 };
936
937 int
938 dissect_cmp_CAKeyUpdAnnContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
939   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
940                                 CAKeyUpdAnnContent_sequence, hf_index, ett_cmp_CAKeyUpdAnnContent);
941
942   return offset;
943 }
944 static int dissect_ckuann(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
945   return dissect_cmp_CAKeyUpdAnnContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_ckuann);
946 }
947
948
949 int
950 dissect_cmp_CertAnnContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
951   offset = dissect_pkix1explicit_Certificate(implicit_tag, tvb, offset, pinfo, tree, hf_index);
952
953   return offset;
954 }
955 static int dissect_cann(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
956   return dissect_cmp_CertAnnContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_cann);
957 }
958
959 static const ber_sequence_t RevAnnContent_sequence[] = {
960   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_status },
961   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certId },
962   { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_willBeRevokedAt },
963   { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_badSinceDate },
964   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_crlDetails },
965   { 0, 0, 0, NULL }
966 };
967
968 int
969 dissect_cmp_RevAnnContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
970   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
971                                 RevAnnContent_sequence, hf_index, ett_cmp_RevAnnContent);
972
973   return offset;
974 }
975 static int dissect_rann(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
976   return dissect_cmp_RevAnnContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_rann);
977 }
978
979 static const ber_sequence_t CRLAnnContent_sequence_of[1] = {
980   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_CRLAnnContent_item },
981 };
982
983 int
984 dissect_cmp_CRLAnnContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
985   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
986                                    CRLAnnContent_sequence_of, hf_index, ett_cmp_CRLAnnContent);
987
988   return offset;
989 }
990 static int dissect_crlann(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
991   return dissect_cmp_CRLAnnContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_crlann);
992 }
993
994
995
996 int
997 dissect_cmp_PKIConfirmContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
998   offset = dissect_ber_null(implicit_tag, pinfo, tree, tvb, offset, hf_index);
999
1000   return offset;
1001 }
1002 static int dissect_conf(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1003   return dissect_cmp_PKIConfirmContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_conf);
1004 }
1005
1006
1007 int
1008 dissect_cmp_NestedMessageContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1009   offset = dissect_cmp_PKIMessage(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1010
1011   return offset;
1012 }
1013 static int dissect_nested(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1014   return dissect_cmp_NestedMessageContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_nested);
1015 }
1016
1017 static const ber_sequence_t GenMsgContent_sequence_of[1] = {
1018   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_GenMsgContent_item },
1019 };
1020
1021 int
1022 dissect_cmp_GenMsgContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1023   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1024                                    GenMsgContent_sequence_of, hf_index, ett_cmp_GenMsgContent);
1025
1026   return offset;
1027 }
1028 static int dissect_genm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1029   return dissect_cmp_GenMsgContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_genm);
1030 }
1031
1032 static const ber_sequence_t GenRepContent_sequence_of[1] = {
1033   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_GenRepContent_item },
1034 };
1035
1036 int
1037 dissect_cmp_GenRepContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1038   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1039                                    GenRepContent_sequence_of, hf_index, ett_cmp_GenRepContent);
1040
1041   return offset;
1042 }
1043 static int dissect_genp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1044   return dissect_cmp_GenRepContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_genp);
1045 }
1046
1047 static const ber_sequence_t ErrorMsgContent_sequence[] = {
1048   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pKIStatusInfo },
1049   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_errorCode },
1050   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_errorDetails },
1051   { 0, 0, 0, NULL }
1052 };
1053
1054 int
1055 dissect_cmp_ErrorMsgContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1056   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1057                                 ErrorMsgContent_sequence, hf_index, ett_cmp_ErrorMsgContent);
1058
1059   return offset;
1060 }
1061 static int dissect_error(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1062   return dissect_cmp_ErrorMsgContent(FALSE, tvb, offset, pinfo, tree, hf_cmp_error);
1063 }
1064
1065
1066 const value_string cmp_PKIBody_vals[] = {
1067   {   0, "ir" },
1068   {   1, "ip" },
1069   {   2, "cr" },
1070   {   3, "cp" },
1071   {   5, "popdecc" },
1072   {   6, "popdecr" },
1073   {   7, "kur" },
1074   {   8, "kup" },
1075   {   9, "krr" },
1076   {  10, "krp" },
1077   {  11, "rr" },
1078   {  12, "rp" },
1079   {  13, "ccr" },
1080   {  14, "ccp" },
1081   {  15, "ckuann" },
1082   {  16, "cann" },
1083   {  17, "rann" },
1084   {  18, "crlann" },
1085   {  19, "conf" },
1086   {  20, "nested" },
1087   {  21, "genm" },
1088   {  22, "genp" },
1089   {  23, "error" },
1090   { 0, NULL }
1091 };
1092
1093 static const ber_choice_t PKIBody_choice[] = {
1094   {   0, BER_CLASS_CON, 0, 0, dissect_ir },
1095   {   1, BER_CLASS_CON, 1, 0, dissect_ip },
1096   {   2, BER_CLASS_CON, 2, 0, dissect_cr },
1097   {   3, BER_CLASS_CON, 3, 0, dissect_cp },
1098   {   5, BER_CLASS_CON, 5, 0, dissect_popdecc },
1099   {   6, BER_CLASS_CON, 6, 0, dissect_popdecr },
1100   {   7, BER_CLASS_CON, 7, 0, dissect_kur },
1101   {   8, BER_CLASS_CON, 8, 0, dissect_kup },
1102   {   9, BER_CLASS_CON, 9, 0, dissect_krr },
1103   {  10, BER_CLASS_CON, 10, 0, dissect_krp },
1104   {  11, BER_CLASS_CON, 11, 0, dissect_rr },
1105   {  12, BER_CLASS_CON, 12, 0, dissect_rp },
1106   {  13, BER_CLASS_CON, 13, 0, dissect_ccr },
1107   {  14, BER_CLASS_CON, 14, 0, dissect_ccp },
1108   {  15, BER_CLASS_CON, 15, 0, dissect_ckuann },
1109   {  16, BER_CLASS_CON, 16, 0, dissect_cann },
1110   {  17, BER_CLASS_CON, 17, 0, dissect_rann },
1111   {  18, BER_CLASS_CON, 18, 0, dissect_crlann },
1112   {  19, BER_CLASS_CON, 19, 0, dissect_conf },
1113   {  20, BER_CLASS_CON, 20, 0, dissect_nested },
1114   {  21, BER_CLASS_CON, 21, 0, dissect_genm },
1115   {  22, BER_CLASS_CON, 22, 0, dissect_genp },
1116   {  23, BER_CLASS_CON, 23, 0, dissect_error },
1117   { 0, 0, 0, 0, NULL }
1118 };
1119
1120 int
1121 dissect_cmp_PKIBody(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1122   offset = dissect_ber_CHOICE(pinfo, tree, tvb, offset,
1123                               PKIBody_choice, hf_index, ett_cmp_PKIBody, NULL);
1124
1125   return offset;
1126 }
1127 static int dissect_body(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1128   return dissect_cmp_PKIBody(FALSE, tvb, offset, pinfo, tree, hf_cmp_body);
1129 }
1130
1131
1132 int
1133 dissect_cmp_PKIProtection(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1134   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
1135                                  NULL, hf_index, -1,
1136                                  NULL);
1137
1138   return offset;
1139 }
1140 static int dissect_protection(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1141   return dissect_cmp_PKIProtection(FALSE, tvb, offset, pinfo, tree, hf_cmp_protection);
1142 }
1143
1144 static const ber_sequence_t PKIMessage_sequence[] = {
1145   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_header },
1146   { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_body },
1147   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_protection },
1148   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_extraCerts },
1149   { 0, 0, 0, NULL }
1150 };
1151
1152 int
1153 dissect_cmp_PKIMessage(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1154   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1155                                 PKIMessage_sequence, hf_index, ett_cmp_PKIMessage);
1156
1157   return offset;
1158 }
1159
1160 static const ber_sequence_t ProtectedPart_sequence[] = {
1161   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_header },
1162   { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_body },
1163   { 0, 0, 0, NULL }
1164 };
1165
1166 int
1167 dissect_cmp_ProtectedPart(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1168   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1169                                 ProtectedPart_sequence, hf_index, ett_cmp_ProtectedPart);
1170
1171   return offset;
1172 }
1173
1174
1175
1176 int
1177 dissect_cmp_PasswordBasedMac(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1178   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1179                                             NULL);
1180
1181   return offset;
1182 }
1183
1184 static const ber_sequence_t PBMParameter_sequence[] = {
1185   { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_salt },
1186   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_owf },
1187   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_iterationCount },
1188   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_mac },
1189   { 0, 0, 0, NULL }
1190 };
1191
1192 int
1193 dissect_cmp_PBMParameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1194   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1195                                 PBMParameter_sequence, hf_index, ett_cmp_PBMParameter);
1196
1197   return offset;
1198 }
1199
1200
1201
1202 int
1203 dissect_cmp_DHBasedMac(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1204   offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1205                                             NULL);
1206
1207   return offset;
1208 }
1209
1210 static const ber_sequence_t DHBMParameter_sequence[] = {
1211   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_owf },
1212   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_mac },
1213   { 0, 0, 0, NULL }
1214 };
1215
1216 int
1217 dissect_cmp_DHBMParameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1218   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1219                                 DHBMParameter_sequence, hf_index, ett_cmp_DHBMParameter);
1220
1221   return offset;
1222 }
1223
1224
1225 int
1226 dissect_cmp_OOBCert(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1227   offset = dissect_pkix1explicit_Certificate(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1228
1229   return offset;
1230 }
1231
1232
1233 static int
1234 dissect_cmp_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1235   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
1236                                  NULL, hf_index, -1,
1237                                  NULL);
1238
1239   return offset;
1240 }
1241 static int dissect_hashVal(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1242   return dissect_cmp_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_cmp_hashVal);
1243 }
1244
1245 static const ber_sequence_t OOBCertHash_sequence[] = {
1246   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_hashAlg },
1247   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_certId },
1248   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_hashVal },
1249   { 0, 0, 0, NULL }
1250 };
1251
1252 int
1253 dissect_cmp_OOBCertHash(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1254   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1255                                 OOBCertHash_sequence, hf_index, ett_cmp_OOBCertHash);
1256
1257   return offset;
1258 }
1259
1260
1261 /*--- End of included file: packet-cmp-fn.c ---*/
1262
1263
1264 static int
1265 dissect_cmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
1266 {
1267         proto_item *item=NULL;
1268         proto_tree *tree=NULL;
1269
1270         if (check_col(pinfo->cinfo, COL_PROTOCOL)) 
1271                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "CMP");
1272
1273         if (check_col(pinfo->cinfo, COL_INFO)) {
1274                 col_clear(pinfo->cinfo, COL_INFO);
1275                 
1276                 col_add_fstr(pinfo->cinfo, COL_INFO, "PKIXCMP");
1277         }
1278
1279
1280         if(parent_tree){
1281                 item=proto_tree_add_item(parent_tree, proto_cmp, tvb, 0, -1, FALSE);
1282                 tree = proto_item_add_subtree(item, ett_cmp);
1283         }
1284
1285         return dissect_cmp_PKIMessage(FALSE, tvb, 0, pinfo, tree, -1);
1286 }
1287
1288 /*--- proto_register_cmp ----------------------------------------------*/
1289 void proto_register_cmp(void) {
1290
1291   /* List of fields */
1292   static hf_register_info hf[] = {
1293     { &hf_cmp_type_oid,
1294       { "InfoType", "cmp.type.oid",
1295         FT_STRING, BASE_NONE, NULL, 0,
1296         "Type of InfoTypeAndValue", HFILL }},
1297
1298 /*--- Included file: packet-cmp-hfarr.c ---*/
1299
1300     { &hf_cmp_header,
1301       { "header", "cmp.header",
1302         FT_NONE, BASE_NONE, NULL, 0,
1303         "", HFILL }},
1304     { &hf_cmp_body,
1305       { "body", "cmp.body",
1306         FT_UINT32, BASE_DEC, VALS(cmp_PKIBody_vals), 0,
1307         "", HFILL }},
1308     { &hf_cmp_protection,
1309       { "protection", "cmp.protection",
1310         FT_BYTES, BASE_HEX, NULL, 0,
1311         "PKIMessage/protection", HFILL }},
1312     { &hf_cmp_extraCerts,
1313       { "extraCerts", "cmp.extraCerts",
1314         FT_NONE, BASE_NONE, NULL, 0,
1315         "PKIMessage/extraCerts", HFILL }},
1316     { &hf_cmp_extraCerts_item,
1317       { "Item", "cmp.extraCerts_item",
1318         FT_NONE, BASE_NONE, NULL, 0,
1319         "PKIMessage/extraCerts/_item", HFILL }},
1320     { &hf_cmp_pvno,
1321       { "pvno", "cmp.pvno",
1322         FT_INT32, BASE_DEC, VALS(cmp_T_pvno_vals), 0,
1323         "PKIHeader/pvno", HFILL }},
1324     { &hf_cmp_sender,
1325       { "sender", "cmp.sender",
1326         FT_UINT32, BASE_DEC, NULL, 0,
1327         "PKIHeader/sender", HFILL }},
1328     { &hf_cmp_recipient,
1329       { "recipient", "cmp.recipient",
1330         FT_UINT32, BASE_DEC, NULL, 0,
1331         "PKIHeader/recipient", HFILL }},
1332     { &hf_cmp_messageTime,
1333       { "messageTime", "cmp.messageTime",
1334         FT_STRING, BASE_NONE, NULL, 0,
1335         "PKIHeader/messageTime", HFILL }},
1336     { &hf_cmp_protectionAlg,
1337       { "protectionAlg", "cmp.protectionAlg",
1338         FT_NONE, BASE_NONE, NULL, 0,
1339         "PKIHeader/protectionAlg", HFILL }},
1340     { &hf_cmp_senderKID,
1341       { "senderKID", "cmp.senderKID",
1342         FT_BYTES, BASE_HEX, NULL, 0,
1343         "PKIHeader/senderKID", HFILL }},
1344     { &hf_cmp_recipKID,
1345       { "recipKID", "cmp.recipKID",
1346         FT_BYTES, BASE_HEX, NULL, 0,
1347         "PKIHeader/recipKID", HFILL }},
1348     { &hf_cmp_transactionID,
1349       { "transactionID", "cmp.transactionID",
1350         FT_BYTES, BASE_HEX, NULL, 0,
1351         "PKIHeader/transactionID", HFILL }},
1352     { &hf_cmp_senderNonce,
1353       { "senderNonce", "cmp.senderNonce",
1354         FT_BYTES, BASE_HEX, NULL, 0,
1355         "PKIHeader/senderNonce", HFILL }},
1356     { &hf_cmp_recipNonce,
1357       { "recipNonce", "cmp.recipNonce",
1358         FT_BYTES, BASE_HEX, NULL, 0,
1359         "PKIHeader/recipNonce", HFILL }},
1360     { &hf_cmp_freeText,
1361       { "freeText", "cmp.freeText",
1362         FT_NONE, BASE_NONE, NULL, 0,
1363         "PKIHeader/freeText", HFILL }},
1364     { &hf_cmp_generalInfo,
1365       { "generalInfo", "cmp.generalInfo",
1366         FT_NONE, BASE_NONE, NULL, 0,
1367         "PKIHeader/generalInfo", HFILL }},
1368     { &hf_cmp_generalInfo_item,
1369       { "Item", "cmp.generalInfo_item",
1370         FT_NONE, BASE_NONE, NULL, 0,
1371         "PKIHeader/generalInfo/_item", HFILL }},
1372     { &hf_cmp_PKIFreeText_item,
1373       { "Item", "cmp.PKIFreeText_item",
1374         FT_STRING, BASE_NONE, NULL, 0,
1375         "PKIFreeText/_item", HFILL }},
1376     { &hf_cmp_ir,
1377       { "ir", "cmp.ir",
1378         FT_NONE, BASE_NONE, NULL, 0,
1379         "PKIBody/ir", HFILL }},
1380     { &hf_cmp_ip,
1381       { "ip", "cmp.ip",
1382         FT_NONE, BASE_NONE, NULL, 0,
1383         "PKIBody/ip", HFILL }},
1384     { &hf_cmp_cr,
1385       { "cr", "cmp.cr",
1386         FT_NONE, BASE_NONE, NULL, 0,
1387         "PKIBody/cr", HFILL }},
1388     { &hf_cmp_cp,
1389       { "cp", "cmp.cp",
1390         FT_NONE, BASE_NONE, NULL, 0,
1391         "PKIBody/cp", HFILL }},
1392     { &hf_cmp_popdecc,
1393       { "popdecc", "cmp.popdecc",
1394         FT_NONE, BASE_NONE, NULL, 0,
1395         "PKIBody/popdecc", HFILL }},
1396     { &hf_cmp_popdecr,
1397       { "popdecr", "cmp.popdecr",
1398         FT_NONE, BASE_NONE, NULL, 0,
1399         "PKIBody/popdecr", HFILL }},
1400     { &hf_cmp_kur,
1401       { "kur", "cmp.kur",
1402         FT_NONE, BASE_NONE, NULL, 0,
1403         "PKIBody/kur", HFILL }},
1404     { &hf_cmp_kup,
1405       { "kup", "cmp.kup",
1406         FT_NONE, BASE_NONE, NULL, 0,
1407         "PKIBody/kup", HFILL }},
1408     { &hf_cmp_krr,
1409       { "krr", "cmp.krr",
1410         FT_NONE, BASE_NONE, NULL, 0,
1411         "PKIBody/krr", HFILL }},
1412     { &hf_cmp_krp,
1413       { "krp", "cmp.krp",
1414         FT_NONE, BASE_NONE, NULL, 0,
1415         "PKIBody/krp", HFILL }},
1416     { &hf_cmp_rr,
1417       { "rr", "cmp.rr",
1418         FT_NONE, BASE_NONE, NULL, 0,
1419         "PKIBody/rr", HFILL }},
1420     { &hf_cmp_rp,
1421       { "rp", "cmp.rp",
1422         FT_NONE, BASE_NONE, NULL, 0,
1423         "PKIBody/rp", HFILL }},
1424     { &hf_cmp_ccr,
1425       { "ccr", "cmp.ccr",
1426         FT_NONE, BASE_NONE, NULL, 0,
1427         "PKIBody/ccr", HFILL }},
1428     { &hf_cmp_ccp,
1429       { "ccp", "cmp.ccp",
1430         FT_NONE, BASE_NONE, NULL, 0,
1431         "PKIBody/ccp", HFILL }},
1432     { &hf_cmp_ckuann,
1433       { "ckuann", "cmp.ckuann",
1434         FT_NONE, BASE_NONE, NULL, 0,
1435         "PKIBody/ckuann", HFILL }},
1436     { &hf_cmp_cann,
1437       { "cann", "cmp.cann",
1438         FT_NONE, BASE_NONE, NULL, 0,
1439         "PKIBody/cann", HFILL }},
1440     { &hf_cmp_rann,
1441       { "rann", "cmp.rann",
1442         FT_NONE, BASE_NONE, NULL, 0,
1443         "PKIBody/rann", HFILL }},
1444     { &hf_cmp_crlann,
1445       { "crlann", "cmp.crlann",
1446         FT_NONE, BASE_NONE, NULL, 0,
1447         "PKIBody/crlann", HFILL }},
1448     { &hf_cmp_conf,
1449       { "conf", "cmp.conf",
1450         FT_NONE, BASE_NONE, NULL, 0,
1451         "PKIBody/conf", HFILL }},
1452     { &hf_cmp_nested,
1453       { "nested", "cmp.nested",
1454         FT_NONE, BASE_NONE, NULL, 0,
1455         "PKIBody/nested", HFILL }},
1456     { &hf_cmp_genm,
1457       { "genm", "cmp.genm",
1458         FT_NONE, BASE_NONE, NULL, 0,
1459         "PKIBody/genm", HFILL }},
1460     { &hf_cmp_genp,
1461       { "genp", "cmp.genp",
1462         FT_NONE, BASE_NONE, NULL, 0,
1463         "PKIBody/genp", HFILL }},
1464     { &hf_cmp_error,
1465       { "error", "cmp.error",
1466         FT_NONE, BASE_NONE, NULL, 0,
1467         "PKIBody/error", HFILL }},
1468     { &hf_cmp_salt,
1469       { "salt", "cmp.salt",
1470         FT_BYTES, BASE_HEX, NULL, 0,
1471         "PBMParameter/salt", HFILL }},
1472     { &hf_cmp_owf,
1473       { "owf", "cmp.owf",
1474         FT_NONE, BASE_NONE, NULL, 0,
1475         "", HFILL }},
1476     { &hf_cmp_iterationCount,
1477       { "iterationCount", "cmp.iterationCount",
1478         FT_INT32, BASE_DEC, NULL, 0,
1479         "PBMParameter/iterationCount", HFILL }},
1480     { &hf_cmp_mac,
1481       { "mac", "cmp.mac",
1482         FT_NONE, BASE_NONE, NULL, 0,
1483         "", HFILL }},
1484     { &hf_cmp_status,
1485       { "status", "cmp.status",
1486         FT_INT32, BASE_DEC, VALS(cmp_PKIStatus_vals), 0,
1487         "", HFILL }},
1488     { &hf_cmp_statusString,
1489       { "statusString", "cmp.statusString",
1490         FT_NONE, BASE_NONE, NULL, 0,
1491         "PKIStatusInfo/statusString", HFILL }},
1492     { &hf_cmp_failInfo,
1493       { "failInfo", "cmp.failInfo",
1494         FT_BYTES, BASE_HEX, NULL, 0,
1495         "PKIStatusInfo/failInfo", HFILL }},
1496     { &hf_cmp_hashAlg,
1497       { "hashAlg", "cmp.hashAlg",
1498         FT_NONE, BASE_NONE, NULL, 0,
1499         "OOBCertHash/hashAlg", HFILL }},
1500     { &hf_cmp_certId,
1501       { "certId", "cmp.certId",
1502         FT_NONE, BASE_NONE, NULL, 0,
1503         "", HFILL }},
1504     { &hf_cmp_hashVal,
1505       { "hashVal", "cmp.hashVal",
1506         FT_BYTES, BASE_HEX, NULL, 0,
1507         "OOBCertHash/hashVal", HFILL }},
1508     { &hf_cmp_POPODecKeyChallContent_item,
1509       { "Item", "cmp.POPODecKeyChallContent_item",
1510         FT_NONE, BASE_NONE, NULL, 0,
1511         "POPODecKeyChallContent/_item", HFILL }},
1512     { &hf_cmp_witness,
1513       { "witness", "cmp.witness",
1514         FT_BYTES, BASE_HEX, NULL, 0,
1515         "Challenge/witness", HFILL }},
1516     { &hf_cmp_challenge,
1517       { "challenge", "cmp.challenge",
1518         FT_BYTES, BASE_HEX, NULL, 0,
1519         "Challenge/challenge", HFILL }},
1520     { &hf_cmp_POPODecKeyRespContent_item,
1521       { "Item", "cmp.POPODecKeyRespContent_item",
1522         FT_INT32, BASE_DEC, NULL, 0,
1523         "POPODecKeyRespContent/_item", HFILL }},
1524     { &hf_cmp_caPubs,
1525       { "caPubs", "cmp.caPubs",
1526         FT_NONE, BASE_NONE, NULL, 0,
1527         "CertRepMessage/caPubs", HFILL }},
1528     { &hf_cmp_caPubs_item,
1529       { "Item", "cmp.caPubs_item",
1530         FT_NONE, BASE_NONE, NULL, 0,
1531         "CertRepMessage/caPubs/_item", HFILL }},
1532     { &hf_cmp_response,
1533       { "response", "cmp.response",
1534         FT_NONE, BASE_NONE, NULL, 0,
1535         "CertRepMessage/response", HFILL }},
1536     { &hf_cmp_response_item,
1537       { "Item", "cmp.response_item",
1538         FT_NONE, BASE_NONE, NULL, 0,
1539         "CertRepMessage/response/_item", HFILL }},
1540     { &hf_cmp_certReqId,
1541       { "certReqId", "cmp.certReqId",
1542         FT_INT32, BASE_DEC, NULL, 0,
1543         "CertResponse/certReqId", HFILL }},
1544     { &hf_cmp_status1,
1545       { "status", "cmp.status",
1546         FT_NONE, BASE_NONE, NULL, 0,
1547         "", HFILL }},
1548     { &hf_cmp_certifiedKeyPair,
1549       { "certifiedKeyPair", "cmp.certifiedKeyPair",
1550         FT_NONE, BASE_NONE, NULL, 0,
1551         "CertResponse/certifiedKeyPair", HFILL }},
1552     { &hf_cmp_rspInfo,
1553       { "rspInfo", "cmp.rspInfo",
1554         FT_BYTES, BASE_HEX, NULL, 0,
1555         "CertResponse/rspInfo", HFILL }},
1556     { &hf_cmp_certOrEncCert,
1557       { "certOrEncCert", "cmp.certOrEncCert",
1558         FT_UINT32, BASE_DEC, VALS(cmp_CertOrEncCert_vals), 0,
1559         "CertifiedKeyPair/certOrEncCert", HFILL }},
1560     { &hf_cmp_privateKey,
1561       { "privateKey", "cmp.privateKey",
1562         FT_NONE, BASE_NONE, NULL, 0,
1563         "CertifiedKeyPair/privateKey", HFILL }},
1564     { &hf_cmp_publicationInfo,
1565       { "publicationInfo", "cmp.publicationInfo",
1566         FT_NONE, BASE_NONE, NULL, 0,
1567         "CertifiedKeyPair/publicationInfo", HFILL }},
1568     { &hf_cmp_certificate,
1569       { "certificate", "cmp.certificate",
1570         FT_NONE, BASE_NONE, NULL, 0,
1571         "CertOrEncCert/certificate", HFILL }},
1572     { &hf_cmp_encryptedCert,
1573       { "encryptedCert", "cmp.encryptedCert",
1574         FT_NONE, BASE_NONE, NULL, 0,
1575         "CertOrEncCert/encryptedCert", HFILL }},
1576     { &hf_cmp_newSigCert,
1577       { "newSigCert", "cmp.newSigCert",
1578         FT_NONE, BASE_NONE, NULL, 0,
1579         "KeyRecRepContent/newSigCert", HFILL }},
1580     { &hf_cmp_caCerts,
1581       { "caCerts", "cmp.caCerts",
1582         FT_NONE, BASE_NONE, NULL, 0,
1583         "KeyRecRepContent/caCerts", HFILL }},
1584     { &hf_cmp_caCerts_item,
1585       { "Item", "cmp.caCerts_item",
1586         FT_NONE, BASE_NONE, NULL, 0,
1587         "KeyRecRepContent/caCerts/_item", HFILL }},
1588     { &hf_cmp_keyPairHist,
1589       { "keyPairHist", "cmp.keyPairHist",
1590         FT_NONE, BASE_NONE, NULL, 0,
1591         "KeyRecRepContent/keyPairHist", HFILL }},
1592     { &hf_cmp_keyPairHist_item,
1593       { "Item", "cmp.keyPairHist_item",
1594         FT_NONE, BASE_NONE, NULL, 0,
1595         "KeyRecRepContent/keyPairHist/_item", HFILL }},
1596     { &hf_cmp_RevReqContent_item,
1597       { "Item", "cmp.RevReqContent_item",
1598         FT_NONE, BASE_NONE, NULL, 0,
1599         "RevReqContent/_item", HFILL }},
1600     { &hf_cmp_certDetails,
1601       { "certDetails", "cmp.certDetails",
1602         FT_NONE, BASE_NONE, NULL, 0,
1603         "RevDetails/certDetails", HFILL }},
1604     { &hf_cmp_revocationReason,
1605       { "revocationReason", "cmp.revocationReason",
1606         FT_BYTES, BASE_HEX, NULL, 0,
1607         "RevDetails/revocationReason", HFILL }},
1608     { &hf_cmp_badSinceDate,
1609       { "badSinceDate", "cmp.badSinceDate",
1610         FT_STRING, BASE_NONE, NULL, 0,
1611         "", HFILL }},
1612     { &hf_cmp_crlEntryDetails,
1613       { "crlEntryDetails", "cmp.crlEntryDetails",
1614         FT_UINT32, BASE_DEC, NULL, 0,
1615         "RevDetails/crlEntryDetails", HFILL }},
1616     { &hf_cmp_status2,
1617       { "status", "cmp.status",
1618         FT_NONE, BASE_NONE, NULL, 0,
1619         "RevRepContent/status", HFILL }},
1620     { &hf_cmp_status_item,
1621       { "Item", "cmp.status_item",
1622         FT_NONE, BASE_NONE, NULL, 0,
1623         "RevRepContent/status/_item", HFILL }},
1624     { &hf_cmp_revCerts,
1625       { "revCerts", "cmp.revCerts",
1626         FT_NONE, BASE_NONE, NULL, 0,
1627         "RevRepContent/revCerts", HFILL }},
1628     { &hf_cmp_revCerts_item,
1629       { "Item", "cmp.revCerts_item",
1630         FT_NONE, BASE_NONE, NULL, 0,
1631         "RevRepContent/revCerts/_item", HFILL }},
1632     { &hf_cmp_crls,
1633       { "crls", "cmp.crls",
1634         FT_NONE, BASE_NONE, NULL, 0,
1635         "RevRepContent/crls", HFILL }},
1636     { &hf_cmp_crls_item,
1637       { "Item", "cmp.crls_item",
1638         FT_NONE, BASE_NONE, NULL, 0,
1639         "RevRepContent/crls/_item", HFILL }},
1640     { &hf_cmp_oldWithNew,
1641       { "oldWithNew", "cmp.oldWithNew",
1642         FT_NONE, BASE_NONE, NULL, 0,
1643         "CAKeyUpdAnnContent/oldWithNew", HFILL }},
1644     { &hf_cmp_newWithOld,
1645       { "newWithOld", "cmp.newWithOld",
1646         FT_NONE, BASE_NONE, NULL, 0,
1647         "CAKeyUpdAnnContent/newWithOld", HFILL }},
1648     { &hf_cmp_newWithNew,
1649       { "newWithNew", "cmp.newWithNew",
1650         FT_NONE, BASE_NONE, NULL, 0,
1651         "CAKeyUpdAnnContent/newWithNew", HFILL }},
1652     { &hf_cmp_willBeRevokedAt,
1653       { "willBeRevokedAt", "cmp.willBeRevokedAt",
1654         FT_STRING, BASE_NONE, NULL, 0,
1655         "RevAnnContent/willBeRevokedAt", HFILL }},
1656     { &hf_cmp_crlDetails,
1657       { "crlDetails", "cmp.crlDetails",
1658         FT_UINT32, BASE_DEC, NULL, 0,
1659         "RevAnnContent/crlDetails", HFILL }},
1660     { &hf_cmp_CRLAnnContent_item,
1661       { "Item", "cmp.CRLAnnContent_item",
1662         FT_NONE, BASE_NONE, NULL, 0,
1663         "CRLAnnContent/_item", HFILL }},
1664     { &hf_cmp_infoType,
1665       { "infoType", "cmp.infoType",
1666         FT_STRING, BASE_NONE, NULL, 0,
1667         "InfoTypeAndValue/infoType", HFILL }},
1668     { &hf_cmp_infoValue,
1669       { "infoValue", "cmp.infoValue",
1670         FT_NONE, BASE_NONE, NULL, 0,
1671         "InfoTypeAndValue/infoValue", HFILL }},
1672     { &hf_cmp_GenMsgContent_item,
1673       { "Item", "cmp.GenMsgContent_item",
1674         FT_NONE, BASE_NONE, NULL, 0,
1675         "GenMsgContent/_item", HFILL }},
1676     { &hf_cmp_GenRepContent_item,
1677       { "Item", "cmp.GenRepContent_item",
1678         FT_NONE, BASE_NONE, NULL, 0,
1679         "GenRepContent/_item", HFILL }},
1680     { &hf_cmp_pKIStatusInfo,
1681       { "pKIStatusInfo", "cmp.pKIStatusInfo",
1682         FT_NONE, BASE_NONE, NULL, 0,
1683         "ErrorMsgContent/pKIStatusInfo", HFILL }},
1684     { &hf_cmp_errorCode,
1685       { "errorCode", "cmp.errorCode",
1686         FT_INT32, BASE_DEC, NULL, 0,
1687         "ErrorMsgContent/errorCode", HFILL }},
1688     { &hf_cmp_errorDetails,
1689       { "errorDetails", "cmp.errorDetails",
1690         FT_NONE, BASE_NONE, NULL, 0,
1691         "ErrorMsgContent/errorDetails", HFILL }},
1692     { &hf_cmp_PKIFailureInfo_badAlg,
1693       { "badAlg", "cmp.badAlg",
1694         FT_BOOLEAN, 8, NULL, 0x80,
1695         "", HFILL }},
1696     { &hf_cmp_PKIFailureInfo_badMessageCheck,
1697       { "badMessageCheck", "cmp.badMessageCheck",
1698         FT_BOOLEAN, 8, NULL, 0x40,
1699         "", HFILL }},
1700     { &hf_cmp_PKIFailureInfo_badRequest,
1701       { "badRequest", "cmp.badRequest",
1702         FT_BOOLEAN, 8, NULL, 0x20,
1703         "", HFILL }},
1704     { &hf_cmp_PKIFailureInfo_badTime,
1705       { "badTime", "cmp.badTime",
1706         FT_BOOLEAN, 8, NULL, 0x10,
1707         "", HFILL }},
1708     { &hf_cmp_PKIFailureInfo_badCertId,
1709       { "badCertId", "cmp.badCertId",
1710         FT_BOOLEAN, 8, NULL, 0x08,
1711         "", HFILL }},
1712     { &hf_cmp_PKIFailureInfo_badDataFormat,
1713       { "badDataFormat", "cmp.badDataFormat",
1714         FT_BOOLEAN, 8, NULL, 0x04,
1715         "", HFILL }},
1716     { &hf_cmp_PKIFailureInfo_wrongAuthority,
1717       { "wrongAuthority", "cmp.wrongAuthority",
1718         FT_BOOLEAN, 8, NULL, 0x02,
1719         "", HFILL }},
1720     { &hf_cmp_PKIFailureInfo_incorrectData,
1721       { "incorrectData", "cmp.incorrectData",
1722         FT_BOOLEAN, 8, NULL, 0x01,
1723         "", HFILL }},
1724     { &hf_cmp_PKIFailureInfo_missingTimeStamp,
1725       { "missingTimeStamp", "cmp.missingTimeStamp",
1726         FT_BOOLEAN, 8, NULL, 0x80,
1727         "", HFILL }},
1728     { &hf_cmp_PKIFailureInfo_badPOP,
1729       { "badPOP", "cmp.badPOP",
1730         FT_BOOLEAN, 8, NULL, 0x40,
1731         "", HFILL }},
1732
1733 /*--- End of included file: packet-cmp-hfarr.c ---*/
1734
1735   };
1736
1737   /* List of subtrees */
1738   static gint *ett[] = {
1739     &ett_cmp,
1740
1741 /*--- Included file: packet-cmp-ettarr.c ---*/
1742
1743     &ett_cmp_PKIMessage,
1744     &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_Certificate,
1745     &ett_cmp_PKIHeader,
1746     &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue,
1747     &ett_cmp_PKIFreeText,
1748     &ett_cmp_PKIBody,
1749     &ett_cmp_ProtectedPart,
1750     &ett_cmp_PBMParameter,
1751     &ett_cmp_DHBMParameter,
1752     &ett_cmp_PKIFailureInfo,
1753     &ett_cmp_PKIStatusInfo,
1754     &ett_cmp_OOBCertHash,
1755     &ett_cmp_POPODecKeyChallContent,
1756     &ett_cmp_Challenge,
1757     &ett_cmp_POPODecKeyRespContent,
1758     &ett_cmp_CertRepMessage,
1759     &ett_cmp_SEQUENCE_OF_CertResponse,
1760     &ett_cmp_CertResponse,
1761     &ett_cmp_CertifiedKeyPair,
1762     &ett_cmp_CertOrEncCert,
1763     &ett_cmp_KeyRecRepContent,
1764     &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair,
1765     &ett_cmp_RevReqContent,
1766     &ett_cmp_RevDetails,
1767     &ett_cmp_RevRepContent,
1768     &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo,
1769     &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId,
1770     &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList,
1771     &ett_cmp_CAKeyUpdAnnContent,
1772     &ett_cmp_RevAnnContent,
1773     &ett_cmp_CRLAnnContent,
1774     &ett_cmp_InfoTypeAndValue,
1775     &ett_cmp_GenMsgContent,
1776     &ett_cmp_GenRepContent,
1777     &ett_cmp_ErrorMsgContent,
1778
1779 /*--- End of included file: packet-cmp-ettarr.c ---*/
1780
1781   };
1782
1783   /* Register protocol */
1784   proto_cmp = proto_register_protocol(PNAME, PSNAME, PFNAME);
1785
1786   /* Register fields and subtrees */
1787   proto_register_field_array(proto_cmp, hf, array_length(hf));
1788   proto_register_subtree_array(ett, array_length(ett));
1789
1790 }
1791
1792
1793 /*--- proto_reg_handoff_cmp -------------------------------------------*/
1794 void proto_reg_handoff_cmp(void) {
1795         dissector_handle_t cmp_handle;
1796
1797         cmp_handle = new_create_dissector_handle(dissect_cmp, proto_cmp);
1798         dissector_add_string("media_type", "application/pkixcmp", cmp_handle);
1799
1800 /*#include "packet-cmp-dis-tab.c"*/
1801 }
1802