Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-cmp.c
blob393bcf7e7dbffdd235946301d63e647cc63b3de5
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-cmp.c */
4 /* asn2wrs.py -b -q -L -p cmp -c ./cmp.cnf -s ./packet-cmp-template -D . -O ../.. CMP.asn */
6 /* packet-cmp.c
8 * Routines for RFC2510 Certificate Management Protocol packet dissection
9 * Ronnie Sahlberg 2004
10 * Updated to RFC4210 CMPv2 and associated "Transport Protocols for CMP" draft
11 * Martin Peylo 2008
13 * Wireshark - Network traffic analyzer
14 * By Gerald Combs <gerald@wireshark.org>
15 * Copyright 1998 Gerald Combs
17 * SPDX-License-Identifier: GPL-2.0-or-later
20 #include "config.h"
22 #include <epan/packet.h>
24 #include <epan/oids.h>
25 #include <epan/asn1.h>
26 #include <epan/proto_data.h>
27 #include <wsutil/array.h>
28 #include "packet-ber.h"
29 #include "packet-cmp.h"
30 #include "packet-crmf.h"
31 #include "packet-pkix1explicit.h"
32 #include "packet-pkix1implicit.h"
33 #include "packet-pkcs10.h"
34 #include "packet-tcp.h"
35 #include "packet-http.h"
36 #include <epan/prefs.h>
38 #define PNAME "Certificate Management Protocol"
39 #define PSNAME "CMP"
40 #define PFNAME "cmp"
42 #define TCP_PORT_CMP 829
44 void proto_register_cmp(void);
46 static dissector_handle_t cmp_http_handle;
47 static dissector_handle_t cmp_tcp_style_http_handle;
48 static dissector_handle_t cmp_tcp_handle;
50 /* desegmentation of CMP over TCP */
51 static bool cmp_desegment = true;
53 static unsigned cmp_alternate_http_port;
54 static unsigned cmp_alternate_tcp_style_http_port;
56 /* Initialize the protocol and registered fields */
57 static int proto_cmp;
58 static int hf_cmp_type_oid;
59 static int hf_cmp_tcptrans_len;
60 static int hf_cmp_tcptrans_type;
61 static int hf_cmp_tcptrans_poll_ref;
62 static int hf_cmp_tcptrans_next_poll_ref;
63 static int hf_cmp_tcptrans_ttcb;
64 static int hf_cmp_tcptrans10_version;
65 static int hf_cmp_tcptrans10_flags;
66 static int hf_cmp_PBMParameter_PDU; /* PBMParameter */
67 static int hf_cmp_DHBMParameter_PDU; /* DHBMParameter */
68 static int hf_cmp_CAProtEncCertValue_PDU; /* CAProtEncCertValue */
69 static int hf_cmp_SignKeyPairTypesValue_PDU; /* SignKeyPairTypesValue */
70 static int hf_cmp_EncKeyPairTypesValue_PDU; /* EncKeyPairTypesValue */
71 static int hf_cmp_PreferredSymmAlgValue_PDU; /* PreferredSymmAlgValue */
72 static int hf_cmp_CAKeyUpdateInfoValue_PDU; /* CAKeyUpdateInfoValue */
73 static int hf_cmp_CurrentCRLValue_PDU; /* CurrentCRLValue */
74 static int hf_cmp_UnsupportedOIDsValue_PDU; /* UnsupportedOIDsValue */
75 static int hf_cmp_KeyPairParamReqValue_PDU; /* KeyPairParamReqValue */
76 static int hf_cmp_KeyPairParamRepValue_PDU; /* KeyPairParamRepValue */
77 static int hf_cmp_RevPassphraseValue_PDU; /* RevPassphraseValue */
78 static int hf_cmp_ImplicitConfirmValue_PDU; /* ImplicitConfirmValue */
79 static int hf_cmp_ConfirmWaitTimeValue_PDU; /* ConfirmWaitTimeValue */
80 static int hf_cmp_OrigPKIMessageValue_PDU; /* OrigPKIMessageValue */
81 static int hf_cmp_SuppLangTagsValue_PDU; /* SuppLangTagsValue */
82 static int hf_cmp_x509v3PKCert; /* Certificate */
83 static int hf_cmp_header; /* PKIHeader */
84 static int hf_cmp_body; /* PKIBody */
85 static int hf_cmp_protection; /* PKIProtection */
86 static int hf_cmp_extraCerts; /* SEQUENCE_SIZE_1_MAX_OF_CMPCertificate */
87 static int hf_cmp_extraCerts_item; /* CMPCertificate */
88 static int hf_cmp_PKIMessages_item; /* PKIMessage */
89 static int hf_cmp_pvno; /* T_pvno */
90 static int hf_cmp_sender; /* GeneralName */
91 static int hf_cmp_recipient; /* GeneralName */
92 static int hf_cmp_messageTime; /* GeneralizedTime */
93 static int hf_cmp_protectionAlg; /* AlgorithmIdentifier */
94 static int hf_cmp_senderKID; /* KeyIdentifier */
95 static int hf_cmp_recipKID; /* KeyIdentifier */
96 static int hf_cmp_transactionID; /* OCTET_STRING */
97 static int hf_cmp_senderNonce; /* OCTET_STRING */
98 static int hf_cmp_recipNonce; /* OCTET_STRING */
99 static int hf_cmp_freeText; /* PKIFreeText */
100 static int hf_cmp_generalInfo; /* SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue */
101 static int hf_cmp_generalInfo_item; /* InfoTypeAndValue */
102 static int hf_cmp_PKIFreeText_item; /* UTF8String */
103 static int hf_cmp_ir; /* CertReqMessages */
104 static int hf_cmp_ip; /* CertRepMessage */
105 static int hf_cmp_cr; /* CertReqMessages */
106 static int hf_cmp_cp; /* CertRepMessage */
107 static int hf_cmp_p10cr; /* CertificationRequest */
108 static int hf_cmp_popdecc; /* POPODecKeyChallContent */
109 static int hf_cmp_popdecr; /* POPODecKeyRespContent */
110 static int hf_cmp_kur; /* CertReqMessages */
111 static int hf_cmp_kup; /* CertRepMessage */
112 static int hf_cmp_krr; /* CertReqMessages */
113 static int hf_cmp_krp; /* KeyRecRepContent */
114 static int hf_cmp_rr; /* RevReqContent */
115 static int hf_cmp_rp; /* RevRepContent */
116 static int hf_cmp_ccr; /* CertReqMessages */
117 static int hf_cmp_ccp; /* CertRepMessage */
118 static int hf_cmp_ckuann; /* CAKeyUpdAnnContent */
119 static int hf_cmp_cann; /* CertAnnContent */
120 static int hf_cmp_rann; /* RevAnnContent */
121 static int hf_cmp_crlann; /* CRLAnnContent */
122 static int hf_cmp_pkiconf; /* PKIConfirmContent */
123 static int hf_cmp_nested; /* NestedMessageContent */
124 static int hf_cmp_genm; /* GenMsgContent */
125 static int hf_cmp_genp; /* GenRepContent */
126 static int hf_cmp_error; /* ErrorMsgContent */
127 static int hf_cmp_certConf; /* CertConfirmContent */
128 static int hf_cmp_pollReq; /* PollReqContent */
129 static int hf_cmp_pollRep; /* PollRepContent */
130 static int hf_cmp_salt; /* OCTET_STRING */
131 static int hf_cmp_owf; /* AlgorithmIdentifier */
132 static int hf_cmp_iterationCount; /* INTEGER */
133 static int hf_cmp_mac; /* AlgorithmIdentifier */
134 static int hf_cmp_pkistatus; /* PKIStatus */
135 static int hf_cmp_statusString; /* PKIFreeText */
136 static int hf_cmp_failInfo; /* PKIFailureInfo */
137 static int hf_cmp_hashAlg; /* AlgorithmIdentifier */
138 static int hf_cmp_certId; /* CertId */
139 static int hf_cmp_hashVal; /* BIT_STRING */
140 static int hf_cmp_POPODecKeyChallContent_item; /* Challenge */
141 static int hf_cmp_witness; /* OCTET_STRING */
142 static int hf_cmp_challenge; /* OCTET_STRING */
143 static int hf_cmp_POPODecKeyRespContent_item; /* INTEGER */
144 static int hf_cmp_caPubs; /* SEQUENCE_SIZE_1_MAX_OF_CMPCertificate */
145 static int hf_cmp_caPubs_item; /* CMPCertificate */
146 static int hf_cmp_response; /* SEQUENCE_OF_CertResponse */
147 static int hf_cmp_response_item; /* CertResponse */
148 static int hf_cmp_certReqId; /* INTEGER */
149 static int hf_cmp_pkistatusinf; /* PKIStatusInfo */
150 static int hf_cmp_certifiedKeyPair; /* CertifiedKeyPair */
151 static int hf_cmp_rspInfo; /* OCTET_STRING */
152 static int hf_cmp_certOrEncCert; /* CertOrEncCert */
153 static int hf_cmp_privateKey; /* EncryptedValue */
154 static int hf_cmp_publicationInfo; /* PKIPublicationInfo */
155 static int hf_cmp_certificate; /* CMPCertificate */
156 static int hf_cmp_encryptedCert; /* EncryptedValue */
157 static int hf_cmp_newSigCert; /* CMPCertificate */
158 static int hf_cmp_caCerts; /* SEQUENCE_SIZE_1_MAX_OF_CMPCertificate */
159 static int hf_cmp_caCerts_item; /* CMPCertificate */
160 static int hf_cmp_keyPairHist; /* SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair */
161 static int hf_cmp_keyPairHist_item; /* CertifiedKeyPair */
162 static int hf_cmp_RevReqContent_item; /* RevDetails */
163 static int hf_cmp_certDetails; /* CertTemplate */
164 static int hf_cmp_crlEntryDetails; /* Extensions */
165 static int hf_cmp_rvrpcnt_status; /* SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo */
166 static int hf_cmp_rvrpcnt_status_item; /* PKIStatusInfo */
167 static int hf_cmp_revCerts; /* SEQUENCE_SIZE_1_MAX_OF_CertId */
168 static int hf_cmp_revCerts_item; /* CertId */
169 static int hf_cmp_crls; /* SEQUENCE_SIZE_1_MAX_OF_CertificateList */
170 static int hf_cmp_crls_item; /* CertificateList */
171 static int hf_cmp_oldWithNew; /* CMPCertificate */
172 static int hf_cmp_newWithOld; /* CMPCertificate */
173 static int hf_cmp_newWithNew; /* CMPCertificate */
174 static int hf_cmp_pkistatus_01; /* PKIStatus */
175 static int hf_cmp_willBeRevokedAt; /* GeneralizedTime */
176 static int hf_cmp_badSinceDate; /* GeneralizedTime */
177 static int hf_cmp_crlDetails; /* Extensions */
178 static int hf_cmp_CRLAnnContent_item; /* CertificateList */
179 static int hf_cmp_CertConfirmContent_item; /* CertStatus */
180 static int hf_cmp_certHash; /* OCTET_STRING */
181 static int hf_cmp_statusInfo; /* PKIStatusInfo */
182 static int hf_cmp_infoType; /* T_infoType */
183 static int hf_cmp_infoValue; /* T_infoValue */
184 static int hf_cmp_SignKeyPairTypesValue_item; /* AlgorithmIdentifier */
185 static int hf_cmp_EncKeyPairTypesValue_item; /* AlgorithmIdentifier */
186 static int hf_cmp_UnsupportedOIDsValue_item; /* OBJECT_IDENTIFIER */
187 static int hf_cmp_SuppLangTagsValue_item; /* UTF8String */
188 static int hf_cmp_GenMsgContent_item; /* InfoTypeAndValue */
189 static int hf_cmp_GenRepContent_item; /* InfoTypeAndValue */
190 static int hf_cmp_pKIStatusInfo; /* PKIStatusInfo */
191 static int hf_cmp_errorCode; /* INTEGER */
192 static int hf_cmp_errorDetails; /* PKIFreeText */
193 static int hf_cmp_PollReqContent_item; /* PollReqContent_item */
194 static int hf_cmp_PollRepContent_item; /* PollRepContent_item */
195 static int hf_cmp_checkAfter; /* INTEGER */
196 static int hf_cmp_reason; /* PKIFreeText */
197 /* named bits */
198 static int hf_cmp_PKIFailureInfo_badAlg;
199 static int hf_cmp_PKIFailureInfo_badMessageCheck;
200 static int hf_cmp_PKIFailureInfo_badRequest;
201 static int hf_cmp_PKIFailureInfo_badTime;
202 static int hf_cmp_PKIFailureInfo_badCertId;
203 static int hf_cmp_PKIFailureInfo_badDataFormat;
204 static int hf_cmp_PKIFailureInfo_wrongAuthority;
205 static int hf_cmp_PKIFailureInfo_incorrectData;
206 static int hf_cmp_PKIFailureInfo_missingTimeStamp;
207 static int hf_cmp_PKIFailureInfo_badPOP;
208 static int hf_cmp_PKIFailureInfo_certRevoked;
209 static int hf_cmp_PKIFailureInfo_certConfirmed;
210 static int hf_cmp_PKIFailureInfo_wrongIntegrity;
211 static int hf_cmp_PKIFailureInfo_badRecipientNonce;
212 static int hf_cmp_PKIFailureInfo_timeNotAvailable;
213 static int hf_cmp_PKIFailureInfo_unacceptedPolicy;
214 static int hf_cmp_PKIFailureInfo_unacceptedExtension;
215 static int hf_cmp_PKIFailureInfo_addInfoNotAvailable;
216 static int hf_cmp_PKIFailureInfo_badSenderNonce;
217 static int hf_cmp_PKIFailureInfo_badCertTemplate;
218 static int hf_cmp_PKIFailureInfo_signerNotTrusted;
219 static int hf_cmp_PKIFailureInfo_transactionIdInUse;
220 static int hf_cmp_PKIFailureInfo_unsupportedVersion;
221 static int hf_cmp_PKIFailureInfo_notAuthorized;
222 static int hf_cmp_PKIFailureInfo_systemUnavail;
223 static int hf_cmp_PKIFailureInfo_systemFailure;
224 static int hf_cmp_PKIFailureInfo_duplicateCertReq;
226 /* Initialize the subtree pointers */
227 static int ett_cmp;
228 static int ett_cmp_CMPCertificate;
229 static int ett_cmp_PKIMessage;
230 static int ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CMPCertificate;
231 static int ett_cmp_PKIMessages;
232 static int ett_cmp_PKIHeader;
233 static int ett_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue;
234 static int ett_cmp_PKIFreeText;
235 static int ett_cmp_PKIBody;
236 static int ett_cmp_ProtectedPart;
237 static int ett_cmp_PBMParameter;
238 static int ett_cmp_DHBMParameter;
239 static int ett_cmp_PKIFailureInfo;
240 static int ett_cmp_PKIStatusInfo;
241 static int ett_cmp_OOBCertHash;
242 static int ett_cmp_POPODecKeyChallContent;
243 static int ett_cmp_Challenge;
244 static int ett_cmp_POPODecKeyRespContent;
245 static int ett_cmp_CertRepMessage;
246 static int ett_cmp_SEQUENCE_OF_CertResponse;
247 static int ett_cmp_CertResponse;
248 static int ett_cmp_CertifiedKeyPair;
249 static int ett_cmp_CertOrEncCert;
250 static int ett_cmp_KeyRecRepContent;
251 static int ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair;
252 static int ett_cmp_RevReqContent;
253 static int ett_cmp_RevDetails;
254 static int ett_cmp_RevRepContent;
255 static int ett_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo;
256 static int ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId;
257 static int ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList;
258 static int ett_cmp_CAKeyUpdAnnContent;
259 static int ett_cmp_RevAnnContent;
260 static int ett_cmp_CRLAnnContent;
261 static int ett_cmp_CertConfirmContent;
262 static int ett_cmp_CertStatus;
263 static int ett_cmp_InfoTypeAndValue;
264 static int ett_cmp_SignKeyPairTypesValue;
265 static int ett_cmp_EncKeyPairTypesValue;
266 static int ett_cmp_UnsupportedOIDsValue;
267 static int ett_cmp_SuppLangTagsValue;
268 static int ett_cmp_GenMsgContent;
269 static int ett_cmp_GenRepContent;
270 static int ett_cmp_ErrorMsgContent;
271 static int ett_cmp_PollReqContent;
272 static int ett_cmp_PollReqContent_item;
273 static int ett_cmp_PollRepContent;
274 static int ett_cmp_PollRepContent_item;
275 /*--- Cyclic dependencies ---*/
277 /* PKIMessage -> PKIBody -> NestedMessageContent -> PKIMessages -> PKIMessage */
278 /*int dissect_cmp_PKIMessage(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);*/
282 static const value_string cmp_CMPCertificate_vals[] = {
283 { 0, "x509v3PKCert" },
284 { 0, NULL }
287 static const ber_choice_t CMPCertificate_choice[] = {
288 { 0, &hf_cmp_x509v3PKCert , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_Certificate },
289 { 0, NULL, 0, 0, 0, NULL }
292 static int
293 dissect_cmp_CMPCertificate(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
294 offset = dissect_ber_choice(actx, tree, tvb, offset,
295 CMPCertificate_choice, hf_index, ett_cmp_CMPCertificate,
296 NULL);
298 return offset;
302 static const value_string cmp_T_pvno_vals[] = {
303 { 1, "cmp1999" },
304 { 2, "cmp2000" },
305 { 0, NULL }
309 static int
310 dissect_cmp_T_pvno(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
311 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
312 NULL);
314 return offset;
319 static int
320 dissect_cmp_GeneralizedTime(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
321 offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
323 return offset;
328 static int
329 dissect_cmp_OCTET_STRING(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
330 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
331 NULL);
333 return offset;
338 static int
339 dissect_cmp_UTF8String(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
340 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTF8String,
341 actx, tree, tvb, offset, hf_index,
342 NULL);
344 return offset;
348 static const ber_sequence_t PKIFreeText_sequence_of[1] = {
349 { &hf_cmp_PKIFreeText_item, BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_cmp_UTF8String },
352 static int
353 dissect_cmp_PKIFreeText(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
354 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
355 PKIFreeText_sequence_of, hf_index, ett_cmp_PKIFreeText);
357 return offset;
362 static int
363 dissect_cmp_T_infoType(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
364 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cmp_type_oid, &actx->external.direct_reference);
366 return offset;
371 static int
372 dissect_cmp_T_infoValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
373 offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
376 return offset;
380 static const ber_sequence_t InfoTypeAndValue_sequence[] = {
381 { &hf_cmp_infoType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cmp_T_infoType },
382 { &hf_cmp_infoValue , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_T_infoValue },
383 { NULL, 0, 0, 0, NULL }
386 static int
387 dissect_cmp_InfoTypeAndValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
388 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
389 InfoTypeAndValue_sequence, hf_index, ett_cmp_InfoTypeAndValue);
391 return offset;
395 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue_sequence_of[1] = {
396 { &hf_cmp_generalInfo_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_InfoTypeAndValue },
399 static int
400 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
401 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
402 SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue);
404 return offset;
408 static const ber_sequence_t PKIHeader_sequence[] = {
409 { &hf_cmp_pvno , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_T_pvno },
410 { &hf_cmp_sender , BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_pkix1implicit_GeneralName },
411 { &hf_cmp_recipient , BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_pkix1implicit_GeneralName },
412 { &hf_cmp_messageTime , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_cmp_GeneralizedTime },
413 { &hf_cmp_protectionAlg , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_AlgorithmIdentifier },
414 { &hf_cmp_senderKID , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_pkix1implicit_KeyIdentifier },
415 { &hf_cmp_recipKID , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL, dissect_pkix1implicit_KeyIdentifier },
416 { &hf_cmp_transactionID , BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL, dissect_cmp_OCTET_STRING },
417 { &hf_cmp_senderNonce , BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL, dissect_cmp_OCTET_STRING },
418 { &hf_cmp_recipNonce , BER_CLASS_CON, 6, BER_FLAGS_OPTIONAL, dissect_cmp_OCTET_STRING },
419 { &hf_cmp_freeText , BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL, dissect_cmp_PKIFreeText },
420 { &hf_cmp_generalInfo , BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL, dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue },
421 { NULL, 0, 0, 0, NULL }
424 static int
425 dissect_cmp_PKIHeader(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
426 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
427 PKIHeader_sequence, hf_index, ett_cmp_PKIHeader);
429 return offset;
433 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_CMPCertificate_sequence_of[1] = {
434 { &hf_cmp_extraCerts_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cmp_CMPCertificate },
437 static int
438 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CMPCertificate(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
439 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
440 SEQUENCE_SIZE_1_MAX_OF_CMPCertificate_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CMPCertificate);
442 return offset;
447 static int
448 dissect_cmp_INTEGER(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
449 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
450 NULL);
452 return offset;
456 static const value_string cmp_PKIStatus_vals[] = {
457 { 0, "accepted" },
458 { 1, "grantedWithMods" },
459 { 2, "rejection" },
460 { 3, "waiting" },
461 { 4, "revocationWarning" },
462 { 5, "revocationNotification" },
463 { 6, "keyUpdateWarning" },
464 { 0, NULL }
468 static int
469 dissect_cmp_PKIStatus(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
470 uint32_t value;
472 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
473 &value);
476 col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Status=%s", val_to_str_const(value, cmp_PKIStatus_vals, "unknown"));
479 return offset;
483 static int * const PKIFailureInfo_bits[] = {
484 &hf_cmp_PKIFailureInfo_badAlg,
485 &hf_cmp_PKIFailureInfo_badMessageCheck,
486 &hf_cmp_PKIFailureInfo_badRequest,
487 &hf_cmp_PKIFailureInfo_badTime,
488 &hf_cmp_PKIFailureInfo_badCertId,
489 &hf_cmp_PKIFailureInfo_badDataFormat,
490 &hf_cmp_PKIFailureInfo_wrongAuthority,
491 &hf_cmp_PKIFailureInfo_incorrectData,
492 &hf_cmp_PKIFailureInfo_missingTimeStamp,
493 &hf_cmp_PKIFailureInfo_badPOP,
494 &hf_cmp_PKIFailureInfo_certRevoked,
495 &hf_cmp_PKIFailureInfo_certConfirmed,
496 &hf_cmp_PKIFailureInfo_wrongIntegrity,
497 &hf_cmp_PKIFailureInfo_badRecipientNonce,
498 &hf_cmp_PKIFailureInfo_timeNotAvailable,
499 &hf_cmp_PKIFailureInfo_unacceptedPolicy,
500 &hf_cmp_PKIFailureInfo_unacceptedExtension,
501 &hf_cmp_PKIFailureInfo_addInfoNotAvailable,
502 &hf_cmp_PKIFailureInfo_badSenderNonce,
503 &hf_cmp_PKIFailureInfo_badCertTemplate,
504 &hf_cmp_PKIFailureInfo_signerNotTrusted,
505 &hf_cmp_PKIFailureInfo_transactionIdInUse,
506 &hf_cmp_PKIFailureInfo_unsupportedVersion,
507 &hf_cmp_PKIFailureInfo_notAuthorized,
508 &hf_cmp_PKIFailureInfo_systemUnavail,
509 &hf_cmp_PKIFailureInfo_systemFailure,
510 &hf_cmp_PKIFailureInfo_duplicateCertReq,
511 NULL
514 static int
515 dissect_cmp_PKIFailureInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
516 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
517 PKIFailureInfo_bits, 27, hf_index, ett_cmp_PKIFailureInfo,
518 NULL);
520 return offset;
524 static const ber_sequence_t PKIStatusInfo_sequence[] = {
525 { &hf_cmp_pkistatus , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIStatus },
526 { &hf_cmp_statusString , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_PKIFreeText },
527 { &hf_cmp_failInfo , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_PKIFailureInfo },
528 { NULL, 0, 0, 0, NULL }
531 static int
532 dissect_cmp_PKIStatusInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
533 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
534 PKIStatusInfo_sequence, hf_index, ett_cmp_PKIStatusInfo);
536 return offset;
540 static const value_string cmp_CertOrEncCert_vals[] = {
541 { 0, "certificate" },
542 { 1, "encryptedCert" },
543 { 0, NULL }
546 static const ber_choice_t CertOrEncCert_choice[] = {
547 { 0, &hf_cmp_certificate , BER_CLASS_CON, 0, 0, dissect_cmp_CMPCertificate },
548 { 1, &hf_cmp_encryptedCert , BER_CLASS_CON, 1, 0, dissect_crmf_EncryptedValue },
549 { 0, NULL, 0, 0, 0, NULL }
552 static int
553 dissect_cmp_CertOrEncCert(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
554 offset = dissect_ber_choice(actx, tree, tvb, offset,
555 CertOrEncCert_choice, hf_index, ett_cmp_CertOrEncCert,
556 NULL);
558 return offset;
562 static const ber_sequence_t CertifiedKeyPair_sequence[] = {
563 { &hf_cmp_certOrEncCert , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cmp_CertOrEncCert },
564 { &hf_cmp_privateKey , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_crmf_EncryptedValue },
565 { &hf_cmp_publicationInfo , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_crmf_PKIPublicationInfo },
566 { NULL, 0, 0, 0, NULL }
569 static int
570 dissect_cmp_CertifiedKeyPair(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
571 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
572 CertifiedKeyPair_sequence, hf_index, ett_cmp_CertifiedKeyPair);
574 return offset;
578 static const ber_sequence_t CertResponse_sequence[] = {
579 { &hf_cmp_certReqId , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_INTEGER },
580 { &hf_cmp_pkistatusinf , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIStatusInfo },
581 { &hf_cmp_certifiedKeyPair, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_CertifiedKeyPair },
582 { &hf_cmp_rspInfo , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_OCTET_STRING },
583 { NULL, 0, 0, 0, NULL }
586 static int
587 dissect_cmp_CertResponse(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
588 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
589 CertResponse_sequence, hf_index, ett_cmp_CertResponse);
591 return offset;
595 static const ber_sequence_t SEQUENCE_OF_CertResponse_sequence_of[1] = {
596 { &hf_cmp_response_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_CertResponse },
599 static int
600 dissect_cmp_SEQUENCE_OF_CertResponse(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
601 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
602 SEQUENCE_OF_CertResponse_sequence_of, hf_index, ett_cmp_SEQUENCE_OF_CertResponse);
604 return offset;
608 static const ber_sequence_t CertRepMessage_sequence[] = {
609 { &hf_cmp_caPubs , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CMPCertificate },
610 { &hf_cmp_response , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_SEQUENCE_OF_CertResponse },
611 { NULL, 0, 0, 0, NULL }
614 static int
615 dissect_cmp_CertRepMessage(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
616 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
617 CertRepMessage_sequence, hf_index, ett_cmp_CertRepMessage);
619 return offset;
623 static const ber_sequence_t Challenge_sequence[] = {
624 { &hf_cmp_owf , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
625 { &hf_cmp_witness , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cmp_OCTET_STRING },
626 { &hf_cmp_challenge , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cmp_OCTET_STRING },
627 { NULL, 0, 0, 0, NULL }
630 static int
631 dissect_cmp_Challenge(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
632 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
633 Challenge_sequence, hf_index, ett_cmp_Challenge);
635 return offset;
639 static const ber_sequence_t POPODecKeyChallContent_sequence_of[1] = {
640 { &hf_cmp_POPODecKeyChallContent_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_Challenge },
643 static int
644 dissect_cmp_POPODecKeyChallContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
645 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
646 POPODecKeyChallContent_sequence_of, hf_index, ett_cmp_POPODecKeyChallContent);
648 return offset;
652 static const ber_sequence_t POPODecKeyRespContent_sequence_of[1] = {
653 { &hf_cmp_POPODecKeyRespContent_item, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_INTEGER },
656 static int
657 dissect_cmp_POPODecKeyRespContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
658 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
659 POPODecKeyRespContent_sequence_of, hf_index, ett_cmp_POPODecKeyRespContent);
661 return offset;
665 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair_sequence_of[1] = {
666 { &hf_cmp_keyPairHist_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_CertifiedKeyPair },
669 static int
670 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
671 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
672 SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair);
674 return offset;
678 static const ber_sequence_t KeyRecRepContent_sequence[] = {
679 { &hf_cmp_pkistatusinf , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIStatusInfo },
680 { &hf_cmp_newSigCert , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOTCHKTAG, dissect_cmp_CMPCertificate },
681 { &hf_cmp_caCerts , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CMPCertificate },
682 { &hf_cmp_keyPairHist , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair },
683 { NULL, 0, 0, 0, NULL }
686 static int
687 dissect_cmp_KeyRecRepContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
688 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
689 KeyRecRepContent_sequence, hf_index, ett_cmp_KeyRecRepContent);
691 return offset;
695 static const ber_sequence_t RevDetails_sequence[] = {
696 { &hf_cmp_certDetails , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_crmf_CertTemplate },
697 { &hf_cmp_crlEntryDetails , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_Extensions },
698 { NULL, 0, 0, 0, NULL }
701 static int
702 dissect_cmp_RevDetails(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
703 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
704 RevDetails_sequence, hf_index, ett_cmp_RevDetails);
706 return offset;
710 static const ber_sequence_t RevReqContent_sequence_of[1] = {
711 { &hf_cmp_RevReqContent_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_RevDetails },
714 static int
715 dissect_cmp_RevReqContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
716 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
717 RevReqContent_sequence_of, hf_index, ett_cmp_RevReqContent);
719 return offset;
723 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo_sequence_of[1] = {
724 { &hf_cmp_rvrpcnt_status_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIStatusInfo },
727 static int
728 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
729 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
730 SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo);
732 return offset;
736 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_CertId_sequence_of[1] = {
737 { &hf_cmp_revCerts_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_crmf_CertId },
740 static int
741 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
742 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
743 SEQUENCE_SIZE_1_MAX_OF_CertId_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId);
745 return offset;
749 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_CertificateList_sequence_of[1] = {
750 { &hf_cmp_crls_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_CertificateList },
753 static int
754 dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
755 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
756 SEQUENCE_SIZE_1_MAX_OF_CertificateList_sequence_of, hf_index, ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList);
758 return offset;
762 static const ber_sequence_t RevRepContent_sequence[] = {
763 { &hf_cmp_rvrpcnt_status , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo },
764 { &hf_cmp_revCerts , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId },
765 { &hf_cmp_crls , BER_CLASS_CON, 1, 0, dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList },
766 { NULL, 0, 0, 0, NULL }
769 static int
770 dissect_cmp_RevRepContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
771 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
772 RevRepContent_sequence, hf_index, ett_cmp_RevRepContent);
774 return offset;
778 static const ber_sequence_t CAKeyUpdAnnContent_sequence[] = {
779 { &hf_cmp_oldWithNew , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cmp_CMPCertificate },
780 { &hf_cmp_newWithOld , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cmp_CMPCertificate },
781 { &hf_cmp_newWithNew , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cmp_CMPCertificate },
782 { NULL, 0, 0, 0, NULL }
785 static int
786 dissect_cmp_CAKeyUpdAnnContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
787 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
788 CAKeyUpdAnnContent_sequence, hf_index, ett_cmp_CAKeyUpdAnnContent);
790 return offset;
795 static int
796 dissect_cmp_CertAnnContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
797 offset = dissect_cmp_CMPCertificate(implicit_tag, tvb, offset, actx, tree, hf_index);
799 return offset;
803 static const ber_sequence_t RevAnnContent_sequence[] = {
804 { &hf_cmp_pkistatus_01 , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIStatus },
805 { &hf_cmp_certId , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_crmf_CertId },
806 { &hf_cmp_willBeRevokedAt , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_cmp_GeneralizedTime },
807 { &hf_cmp_badSinceDate , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_cmp_GeneralizedTime },
808 { &hf_cmp_crlDetails , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_Extensions },
809 { NULL, 0, 0, 0, NULL }
812 static int
813 dissect_cmp_RevAnnContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
814 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
815 RevAnnContent_sequence, hf_index, ett_cmp_RevAnnContent);
817 return offset;
821 static const ber_sequence_t CRLAnnContent_sequence_of[1] = {
822 { &hf_cmp_CRLAnnContent_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_CertificateList },
825 static int
826 dissect_cmp_CRLAnnContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
827 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
828 CRLAnnContent_sequence_of, hf_index, ett_cmp_CRLAnnContent);
830 return offset;
835 static int
836 dissect_cmp_PKIConfirmContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
837 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
839 return offset;
843 static const ber_sequence_t PKIMessages_sequence_of[1] = {
844 { &hf_cmp_PKIMessages_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIMessage },
847 static int
848 dissect_cmp_PKIMessages(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
849 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
850 PKIMessages_sequence_of, hf_index, ett_cmp_PKIMessages);
852 return offset;
857 static int
858 dissect_cmp_NestedMessageContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
859 offset = dissect_cmp_PKIMessages(implicit_tag, tvb, offset, actx, tree, hf_index);
861 return offset;
865 static const ber_sequence_t GenMsgContent_sequence_of[1] = {
866 { &hf_cmp_GenMsgContent_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_InfoTypeAndValue },
869 static int
870 dissect_cmp_GenMsgContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
871 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
872 GenMsgContent_sequence_of, hf_index, ett_cmp_GenMsgContent);
874 return offset;
878 static const ber_sequence_t GenRepContent_sequence_of[1] = {
879 { &hf_cmp_GenRepContent_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_InfoTypeAndValue },
882 static int
883 dissect_cmp_GenRepContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
884 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
885 GenRepContent_sequence_of, hf_index, ett_cmp_GenRepContent);
887 return offset;
891 static const ber_sequence_t ErrorMsgContent_sequence[] = {
892 { &hf_cmp_pKIStatusInfo , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIStatusInfo },
893 { &hf_cmp_errorCode , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_INTEGER },
894 { &hf_cmp_errorDetails , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_PKIFreeText },
895 { NULL, 0, 0, 0, NULL }
898 static int
899 dissect_cmp_ErrorMsgContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
900 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
901 ErrorMsgContent_sequence, hf_index, ett_cmp_ErrorMsgContent);
903 return offset;
907 static const ber_sequence_t CertStatus_sequence[] = {
908 { &hf_cmp_certHash , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cmp_OCTET_STRING },
909 { &hf_cmp_certReqId , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_INTEGER },
910 { &hf_cmp_statusInfo , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_PKIStatusInfo },
911 { NULL, 0, 0, 0, NULL }
914 static int
915 dissect_cmp_CertStatus(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
916 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
917 CertStatus_sequence, hf_index, ett_cmp_CertStatus);
919 return offset;
923 static const ber_sequence_t CertConfirmContent_sequence_of[1] = {
924 { &hf_cmp_CertConfirmContent_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_CertStatus },
927 static int
928 dissect_cmp_CertConfirmContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
929 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
930 CertConfirmContent_sequence_of, hf_index, ett_cmp_CertConfirmContent);
932 return offset;
936 static const ber_sequence_t PollReqContent_item_sequence[] = {
937 { &hf_cmp_certReqId , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_INTEGER },
938 { NULL, 0, 0, 0, NULL }
941 static int
942 dissect_cmp_PollReqContent_item(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
943 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
944 PollReqContent_item_sequence, hf_index, ett_cmp_PollReqContent_item);
946 return offset;
950 static const ber_sequence_t PollReqContent_sequence_of[1] = {
951 { &hf_cmp_PollReqContent_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PollReqContent_item },
954 static int
955 dissect_cmp_PollReqContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
956 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
957 PollReqContent_sequence_of, hf_index, ett_cmp_PollReqContent);
959 return offset;
963 static const ber_sequence_t PollRepContent_item_sequence[] = {
964 { &hf_cmp_certReqId , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_INTEGER },
965 { &hf_cmp_checkAfter , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_INTEGER },
966 { &hf_cmp_reason , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cmp_PKIFreeText },
967 { NULL, 0, 0, 0, NULL }
970 static int
971 dissect_cmp_PollRepContent_item(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
972 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
973 PollRepContent_item_sequence, hf_index, ett_cmp_PollRepContent_item);
975 return offset;
979 static const ber_sequence_t PollRepContent_sequence_of[1] = {
980 { &hf_cmp_PollRepContent_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PollRepContent_item },
983 static int
984 dissect_cmp_PollRepContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
985 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
986 PollRepContent_sequence_of, hf_index, ett_cmp_PollRepContent);
988 return offset;
992 static const value_string cmp_PKIBody_vals[] = {
993 { 0, "ir" },
994 { 1, "ip" },
995 { 2, "cr" },
996 { 3, "cp" },
997 { 4, "p10cr" },
998 { 5, "popdecc" },
999 { 6, "popdecr" },
1000 { 7, "kur" },
1001 { 8, "kup" },
1002 { 9, "krr" },
1003 { 10, "krp" },
1004 { 11, "rr" },
1005 { 12, "rp" },
1006 { 13, "ccr" },
1007 { 14, "ccp" },
1008 { 15, "ckuann" },
1009 { 16, "cann" },
1010 { 17, "rann" },
1011 { 18, "crlann" },
1012 { 19, "pkiconf" },
1013 { 20, "nested" },
1014 { 21, "genm" },
1015 { 22, "genp" },
1016 { 23, "error" },
1017 { 24, "certConf" },
1018 { 25, "pollReq" },
1019 { 26, "pollRep" },
1020 { 0, NULL }
1023 static const ber_choice_t PKIBody_choice[] = {
1024 { 0, &hf_cmp_ir , BER_CLASS_CON, 0, 0, dissect_crmf_CertReqMessages },
1025 { 1, &hf_cmp_ip , BER_CLASS_CON, 1, 0, dissect_cmp_CertRepMessage },
1026 { 2, &hf_cmp_cr , BER_CLASS_CON, 2, 0, dissect_crmf_CertReqMessages },
1027 { 3, &hf_cmp_cp , BER_CLASS_CON, 3, 0, dissect_cmp_CertRepMessage },
1028 { 4, &hf_cmp_p10cr , BER_CLASS_CON, 4, 0, dissect_pkcs10_CertificationRequest },
1029 { 5, &hf_cmp_popdecc , BER_CLASS_CON, 5, 0, dissect_cmp_POPODecKeyChallContent },
1030 { 6, &hf_cmp_popdecr , BER_CLASS_CON, 6, 0, dissect_cmp_POPODecKeyRespContent },
1031 { 7, &hf_cmp_kur , BER_CLASS_CON, 7, 0, dissect_crmf_CertReqMessages },
1032 { 8, &hf_cmp_kup , BER_CLASS_CON, 8, 0, dissect_cmp_CertRepMessage },
1033 { 9, &hf_cmp_krr , BER_CLASS_CON, 9, 0, dissect_crmf_CertReqMessages },
1034 { 10, &hf_cmp_krp , BER_CLASS_CON, 10, 0, dissect_cmp_KeyRecRepContent },
1035 { 11, &hf_cmp_rr , BER_CLASS_CON, 11, 0, dissect_cmp_RevReqContent },
1036 { 12, &hf_cmp_rp , BER_CLASS_CON, 12, 0, dissect_cmp_RevRepContent },
1037 { 13, &hf_cmp_ccr , BER_CLASS_CON, 13, 0, dissect_crmf_CertReqMessages },
1038 { 14, &hf_cmp_ccp , BER_CLASS_CON, 14, 0, dissect_cmp_CertRepMessage },
1039 { 15, &hf_cmp_ckuann , BER_CLASS_CON, 15, 0, dissect_cmp_CAKeyUpdAnnContent },
1040 { 16, &hf_cmp_cann , BER_CLASS_CON, 16, 0, dissect_cmp_CertAnnContent },
1041 { 17, &hf_cmp_rann , BER_CLASS_CON, 17, 0, dissect_cmp_RevAnnContent },
1042 { 18, &hf_cmp_crlann , BER_CLASS_CON, 18, 0, dissect_cmp_CRLAnnContent },
1043 { 19, &hf_cmp_pkiconf , BER_CLASS_CON, 19, 0, dissect_cmp_PKIConfirmContent },
1044 { 20, &hf_cmp_nested , BER_CLASS_CON, 20, 0, dissect_cmp_NestedMessageContent },
1045 { 21, &hf_cmp_genm , BER_CLASS_CON, 21, 0, dissect_cmp_GenMsgContent },
1046 { 22, &hf_cmp_genp , BER_CLASS_CON, 22, 0, dissect_cmp_GenRepContent },
1047 { 23, &hf_cmp_error , BER_CLASS_CON, 23, 0, dissect_cmp_ErrorMsgContent },
1048 { 24, &hf_cmp_certConf , BER_CLASS_CON, 24, 0, dissect_cmp_CertConfirmContent },
1049 { 25, &hf_cmp_pollReq , BER_CLASS_CON, 25, 0, dissect_cmp_PollReqContent },
1050 { 26, &hf_cmp_pollRep , BER_CLASS_CON, 26, 0, dissect_cmp_PollRepContent },
1051 { 0, NULL, 0, 0, 0, NULL }
1054 static int
1055 dissect_cmp_PKIBody(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1056 int branch_taken;
1058 offset = dissect_ber_choice(actx, tree, tvb, offset,
1059 PKIBody_choice, hf_index, ett_cmp_PKIBody,
1060 &branch_taken);
1063 col_append_fstr(actx->pinfo->cinfo, COL_INFO, " Body=%s", val_to_str_const(branch_taken, cmp_PKIBody_vals, "unknown"));
1066 return offset;
1071 static int
1072 dissect_cmp_PKIProtection(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1073 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
1074 NULL, 0, hf_index, -1,
1075 NULL);
1077 return offset;
1081 static const ber_sequence_t PKIMessage_sequence[] = {
1082 { &hf_cmp_header , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIHeader },
1083 { &hf_cmp_body , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cmp_PKIBody },
1084 { &hf_cmp_protection , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_cmp_PKIProtection },
1085 { &hf_cmp_extraCerts , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_cmp_SEQUENCE_SIZE_1_MAX_OF_CMPCertificate },
1086 { NULL, 0, 0, 0, NULL }
1090 dissect_cmp_PKIMessage(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1091 // PKIMessage -> PKIBody -> NestedMessageContent -> PKIMessages -> PKIMessage
1092 actx->pinfo->dissection_depth += 4;
1093 increment_dissection_depth(actx->pinfo);
1094 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1095 PKIMessage_sequence, hf_index, ett_cmp_PKIMessage);
1097 actx->pinfo->dissection_depth -= 4;
1098 decrement_dissection_depth(actx->pinfo);
1099 return offset;
1103 static const ber_sequence_t ProtectedPart_sequence[] = {
1104 { &hf_cmp_header , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cmp_PKIHeader },
1105 { &hf_cmp_body , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cmp_PKIBody },
1106 { NULL, 0, 0, 0, NULL }
1110 dissect_cmp_ProtectedPart(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1111 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1112 ProtectedPart_sequence, hf_index, ett_cmp_ProtectedPart);
1114 return offset;
1118 static const ber_sequence_t PBMParameter_sequence[] = {
1119 { &hf_cmp_salt , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cmp_OCTET_STRING },
1120 { &hf_cmp_owf , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
1121 { &hf_cmp_iterationCount , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cmp_INTEGER },
1122 { &hf_cmp_mac , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
1123 { NULL, 0, 0, 0, NULL }
1126 static int
1127 dissect_cmp_PBMParameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1128 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1129 PBMParameter_sequence, hf_index, ett_cmp_PBMParameter);
1131 return offset;
1135 static const ber_sequence_t DHBMParameter_sequence[] = {
1136 { &hf_cmp_owf , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
1137 { &hf_cmp_mac , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
1138 { NULL, 0, 0, 0, NULL }
1141 static int
1142 dissect_cmp_DHBMParameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1143 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1144 DHBMParameter_sequence, hf_index, ett_cmp_DHBMParameter);
1146 return offset;
1152 dissect_cmp_OOBCert(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1153 offset = dissect_cmp_CMPCertificate(implicit_tag, tvb, offset, actx, tree, hf_index);
1155 return offset;
1160 static int
1161 dissect_cmp_BIT_STRING(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1162 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
1163 NULL, 0, hf_index, -1,
1164 NULL);
1166 return offset;
1170 static const ber_sequence_t OOBCertHash_sequence[] = {
1171 { &hf_cmp_hashAlg , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_AlgorithmIdentifier },
1172 { &hf_cmp_certId , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_crmf_CertId },
1173 { &hf_cmp_hashVal , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cmp_BIT_STRING },
1174 { NULL, 0, 0, 0, NULL }
1178 dissect_cmp_OOBCertHash(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1179 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1180 OOBCertHash_sequence, hf_index, ett_cmp_OOBCertHash);
1182 return offset;
1187 static int
1188 dissect_cmp_CAProtEncCertValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1189 offset = dissect_cmp_CMPCertificate(implicit_tag, tvb, offset, actx, tree, hf_index);
1191 return offset;
1195 static const ber_sequence_t SignKeyPairTypesValue_sequence_of[1] = {
1196 { &hf_cmp_SignKeyPairTypesValue_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
1199 static int
1200 dissect_cmp_SignKeyPairTypesValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1201 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1202 SignKeyPairTypesValue_sequence_of, hf_index, ett_cmp_SignKeyPairTypesValue);
1204 return offset;
1208 static const ber_sequence_t EncKeyPairTypesValue_sequence_of[1] = {
1209 { &hf_cmp_EncKeyPairTypesValue_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
1212 static int
1213 dissect_cmp_EncKeyPairTypesValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1214 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1215 EncKeyPairTypesValue_sequence_of, hf_index, ett_cmp_EncKeyPairTypesValue);
1217 return offset;
1222 static int
1223 dissect_cmp_PreferredSymmAlgValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1224 offset = dissect_pkix1explicit_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1226 return offset;
1231 static int
1232 dissect_cmp_CAKeyUpdateInfoValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1233 offset = dissect_cmp_CAKeyUpdAnnContent(implicit_tag, tvb, offset, actx, tree, hf_index);
1235 return offset;
1240 static int
1241 dissect_cmp_CurrentCRLValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1242 offset = dissect_pkix1explicit_CertificateList(implicit_tag, tvb, offset, actx, tree, hf_index);
1244 return offset;
1249 static int
1250 dissect_cmp_OBJECT_IDENTIFIER(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1251 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
1253 return offset;
1257 static const ber_sequence_t UnsupportedOIDsValue_sequence_of[1] = {
1258 { &hf_cmp_UnsupportedOIDsValue_item, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cmp_OBJECT_IDENTIFIER },
1261 static int
1262 dissect_cmp_UnsupportedOIDsValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1263 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1264 UnsupportedOIDsValue_sequence_of, hf_index, ett_cmp_UnsupportedOIDsValue);
1266 return offset;
1271 static int
1272 dissect_cmp_KeyPairParamReqValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1273 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
1275 return offset;
1280 static int
1281 dissect_cmp_KeyPairParamRepValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1282 offset = dissect_pkix1explicit_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1284 return offset;
1289 static int
1290 dissect_cmp_RevPassphraseValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1291 offset = dissect_crmf_EncryptedValue(implicit_tag, tvb, offset, actx, tree, hf_index);
1293 return offset;
1298 static int
1299 dissect_cmp_ImplicitConfirmValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1300 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
1302 return offset;
1307 static int
1308 dissect_cmp_ConfirmWaitTimeValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1309 offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
1311 return offset;
1316 static int
1317 dissect_cmp_OrigPKIMessageValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1318 offset = dissect_cmp_PKIMessages(implicit_tag, tvb, offset, actx, tree, hf_index);
1320 return offset;
1324 static const ber_sequence_t SuppLangTagsValue_sequence_of[1] = {
1325 { &hf_cmp_SuppLangTagsValue_item, BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_cmp_UTF8String },
1328 static int
1329 dissect_cmp_SuppLangTagsValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1330 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1331 SuppLangTagsValue_sequence_of, hf_index, ett_cmp_SuppLangTagsValue);
1333 return offset;
1336 /*--- PDUs ---*/
1338 static int dissect_PBMParameter_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1339 int offset = 0;
1340 asn1_ctx_t asn1_ctx;
1341 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1342 offset = dissect_cmp_PBMParameter(false, tvb, offset, &asn1_ctx, tree, hf_cmp_PBMParameter_PDU);
1343 return offset;
1345 static int dissect_DHBMParameter_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1346 int offset = 0;
1347 asn1_ctx_t asn1_ctx;
1348 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1349 offset = dissect_cmp_DHBMParameter(false, tvb, offset, &asn1_ctx, tree, hf_cmp_DHBMParameter_PDU);
1350 return offset;
1352 static int dissect_CAProtEncCertValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1353 int offset = 0;
1354 asn1_ctx_t asn1_ctx;
1355 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1356 offset = dissect_cmp_CAProtEncCertValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_CAProtEncCertValue_PDU);
1357 return offset;
1359 static int dissect_SignKeyPairTypesValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1360 int offset = 0;
1361 asn1_ctx_t asn1_ctx;
1362 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1363 offset = dissect_cmp_SignKeyPairTypesValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_SignKeyPairTypesValue_PDU);
1364 return offset;
1366 static int dissect_EncKeyPairTypesValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1367 int offset = 0;
1368 asn1_ctx_t asn1_ctx;
1369 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1370 offset = dissect_cmp_EncKeyPairTypesValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_EncKeyPairTypesValue_PDU);
1371 return offset;
1373 static int dissect_PreferredSymmAlgValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1374 int offset = 0;
1375 asn1_ctx_t asn1_ctx;
1376 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1377 offset = dissect_cmp_PreferredSymmAlgValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_PreferredSymmAlgValue_PDU);
1378 return offset;
1380 static int dissect_CAKeyUpdateInfoValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1381 int offset = 0;
1382 asn1_ctx_t asn1_ctx;
1383 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1384 offset = dissect_cmp_CAKeyUpdateInfoValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_CAKeyUpdateInfoValue_PDU);
1385 return offset;
1387 static int dissect_CurrentCRLValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1388 int offset = 0;
1389 asn1_ctx_t asn1_ctx;
1390 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1391 offset = dissect_cmp_CurrentCRLValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_CurrentCRLValue_PDU);
1392 return offset;
1394 static int dissect_UnsupportedOIDsValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1395 int offset = 0;
1396 asn1_ctx_t asn1_ctx;
1397 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1398 offset = dissect_cmp_UnsupportedOIDsValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_UnsupportedOIDsValue_PDU);
1399 return offset;
1401 static int dissect_KeyPairParamReqValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1402 int offset = 0;
1403 asn1_ctx_t asn1_ctx;
1404 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1405 offset = dissect_cmp_KeyPairParamReqValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_KeyPairParamReqValue_PDU);
1406 return offset;
1408 static int dissect_KeyPairParamRepValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1409 int offset = 0;
1410 asn1_ctx_t asn1_ctx;
1411 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1412 offset = dissect_cmp_KeyPairParamRepValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_KeyPairParamRepValue_PDU);
1413 return offset;
1415 static int dissect_RevPassphraseValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1416 int offset = 0;
1417 asn1_ctx_t asn1_ctx;
1418 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1419 offset = dissect_cmp_RevPassphraseValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_RevPassphraseValue_PDU);
1420 return offset;
1422 static int dissect_ImplicitConfirmValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1423 int offset = 0;
1424 asn1_ctx_t asn1_ctx;
1425 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1426 offset = dissect_cmp_ImplicitConfirmValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_ImplicitConfirmValue_PDU);
1427 return offset;
1429 static int dissect_ConfirmWaitTimeValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1430 int offset = 0;
1431 asn1_ctx_t asn1_ctx;
1432 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1433 offset = dissect_cmp_ConfirmWaitTimeValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_ConfirmWaitTimeValue_PDU);
1434 return offset;
1436 static int dissect_OrigPKIMessageValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1437 int offset = 0;
1438 asn1_ctx_t asn1_ctx;
1439 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1440 offset = dissect_cmp_OrigPKIMessageValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_OrigPKIMessageValue_PDU);
1441 return offset;
1443 static int dissect_SuppLangTagsValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
1444 int offset = 0;
1445 asn1_ctx_t asn1_ctx;
1446 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1447 offset = dissect_cmp_SuppLangTagsValue(false, tvb, offset, &asn1_ctx, tree, hf_cmp_SuppLangTagsValue_PDU);
1448 return offset;
1452 static int
1453 dissect_cmp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1455 asn1_ctx_t asn1_ctx;
1456 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1458 return dissect_cmp_PKIMessage(false, tvb, 0, &asn1_ctx, tree, -1);
1461 #define CMP_TYPE_PKIMSG 0
1462 #define CMP_TYPE_POLLREP 1
1463 #define CMP_TYPE_POLLREQ 2
1464 #define CMP_TYPE_NEGPOLLREP 3
1465 #define CMP_TYPE_PARTIALMSGREP 4
1466 #define CMP_TYPE_FINALMSGREP 5
1467 #define CMP_TYPE_ERRORMSGREP 6
1468 static const value_string cmp_pdu_types[] = {
1469 { CMP_TYPE_PKIMSG, "pkiMsg" },
1470 { CMP_TYPE_POLLREP, "pollRep" },
1471 { CMP_TYPE_POLLREQ, "pollReq" },
1472 { CMP_TYPE_NEGPOLLREP, "negPollRep" },
1473 { CMP_TYPE_PARTIALMSGREP, "partialMsgRep" },
1474 { CMP_TYPE_FINALMSGREP, "finalMsgRep" },
1475 { CMP_TYPE_ERRORMSGREP, "errorMsgRep" },
1476 { 0, NULL },
1480 static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
1482 tvbuff_t *next_tvb;
1483 uint32_t pdu_len;
1484 uint8_t pdu_type;
1485 proto_item *item=NULL;
1486 proto_item *ti=NULL;
1487 proto_tree *tree=NULL;
1488 proto_tree *tcptrans_tree=NULL;
1489 int offset=0;
1491 col_set_str(pinfo->cinfo, COL_PROTOCOL, "CMP");
1492 col_set_str(pinfo->cinfo, COL_INFO, "PKIXCMP");
1494 if(parent_tree){
1495 item=proto_tree_add_item(parent_tree, proto_cmp, tvb, 0, -1, ENC_NA);
1496 tree = proto_item_add_subtree(item, ett_cmp);
1499 pdu_len=tvb_get_ntohl(tvb, 0);
1500 pdu_type=tvb_get_uint8(tvb, 4);
1502 if (pdu_type < 10) {
1503 /* RFC2510 TCP transport */
1504 ti = proto_tree_add_item(tree, proto_cmp, tvb, offset, 5, ENC_NA);
1505 tcptrans_tree = proto_item_add_subtree(ti, ett_cmp);
1506 proto_tree_add_item(tree, hf_cmp_tcptrans_len, tvb, offset, 4, ENC_BIG_ENDIAN);
1507 offset += 4;
1508 proto_tree_add_item(tree, hf_cmp_tcptrans_type, tvb, offset++, 1, ENC_BIG_ENDIAN);
1509 } else {
1510 /* post RFC2510 TCP transport - the former "type" field is now "version" */
1511 tcptrans_tree = proto_tree_add_subtree(tree, tvb, offset, 7, ett_cmp, NULL, "TCP transport");
1512 pdu_type=tvb_get_uint8(tvb, 6);
1513 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_len, tvb, offset, 4, ENC_BIG_ENDIAN);
1514 offset += 4;
1515 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans10_version, tvb, offset++, 1, ENC_BIG_ENDIAN);
1516 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans10_flags, tvb, offset++, 1, ENC_BIG_ENDIAN);
1517 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_type, tvb, offset++, 1, ENC_BIG_ENDIAN);
1520 col_add_str (pinfo->cinfo, COL_INFO, val_to_str (pdu_type, cmp_pdu_types, "0x%x"));
1522 switch(pdu_type){
1523 case CMP_TYPE_PKIMSG:
1524 next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
1525 dissect_cmp_pdu(next_tvb, pinfo, tree, NULL);
1526 offset += tvb_reported_length_remaining(tvb, offset);
1527 break;
1528 case CMP_TYPE_POLLREP:
1529 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_poll_ref, tvb, offset, 4, ENC_BIG_ENDIAN);
1530 offset += 4;
1532 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_ttcb, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN);
1533 offset += 4;
1534 break;
1535 case CMP_TYPE_POLLREQ:
1536 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_poll_ref, tvb, offset, 4, ENC_BIG_ENDIAN);
1537 offset += 4;
1538 break;
1539 case CMP_TYPE_NEGPOLLREP:
1540 break;
1541 case CMP_TYPE_PARTIALMSGREP:
1542 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_next_poll_ref, tvb, offset, 4, ENC_BIG_ENDIAN);
1543 offset += 4;
1545 proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_ttcb, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN);
1546 offset += 4;
1548 next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
1549 dissect_cmp_pdu(next_tvb, pinfo, tree, NULL);
1550 offset += tvb_reported_length_remaining(tvb, offset);
1551 break;
1552 case CMP_TYPE_FINALMSGREP:
1553 next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_reported_length_remaining(tvb, offset), pdu_len);
1554 dissect_cmp_pdu(next_tvb, pinfo, tree, NULL);
1555 offset += tvb_reported_length_remaining(tvb, offset);
1556 break;
1557 case CMP_TYPE_ERRORMSGREP:
1558 /*XXX to be added*/
1559 break;
1562 return offset;
1565 static unsigned get_cmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
1566 int offset, void *data _U_)
1568 uint32_t plen;
1571 * Get the length of the CMP-over-TCP packet.
1573 plen = tvb_get_ntohl(tvb, offset);
1575 return plen+4;
1579 /* CMP over TCP: RFC2510 section 5.2 and "Transport Protocols for CMP" draft */
1580 static int
1581 dissect_cmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data)
1583 uint32_t pdu_len;
1584 uint8_t pdu_type;
1585 int offset=4; /* RFC2510 TCP transport header length */
1587 /* only attempt to dissect it as CMP over TCP if we have
1588 * at least 5 bytes.
1590 if (!tvb_bytes_exist(tvb, 0, 5)) {
1591 return 0;
1594 pdu_len=tvb_get_ntohl(tvb, 0);
1595 pdu_type=tvb_get_uint8(tvb, 4);
1597 if(pdu_type == 10) {
1598 /* post RFC2510 TCP transport */
1599 pdu_type = tvb_get_uint8(tvb, 7);
1600 offset = 7; /* post RFC2510 TCP transport header length */
1601 /* arbitrary limit: assume a CMP over TCP pdu is never >10000 bytes
1602 * in size.
1603 * It is definitely at least 3 byte for post RFC2510 TCP transport
1605 if((pdu_len<=2)||(pdu_len>10000)){
1606 return 0;
1608 } else {
1609 /* RFC2510 TCP transport */
1610 /* type is between 0 and 6 */
1611 if(pdu_type>6){
1612 return 0;
1614 /* arbitrary limit: assume a CMP over TCP pdu is never >10000 bytes
1615 * in size.
1616 * It is definitely at least 1 byte to accommodate the flags byte
1618 if((pdu_len<=0)||(pdu_len>10000)){
1619 return 0;
1623 /* type 0 contains a PKI message and must therefore be >= 3 bytes
1624 * long (flags + BER TAG + BER LENGTH
1626 if((pdu_type==0)&&(pdu_len<3)){
1627 return 0;
1630 tcp_dissect_pdus(tvb, pinfo, parent_tree, cmp_desegment, offset, get_cmp_pdu_len,
1631 dissect_cmp_tcp_pdu, data);
1633 return tvb_captured_length(tvb);
1637 static int
1638 dissect_cmp_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
1640 proto_item *item=NULL;
1641 proto_tree *tree=NULL;
1643 col_set_str(pinfo->cinfo, COL_PROTOCOL, "CMP");
1644 col_set_str(pinfo->cinfo, COL_INFO, "PKIXCMP");
1646 if(parent_tree){
1647 item=proto_tree_add_item(parent_tree, proto_cmp, tvb, 0, -1, ENC_NA);
1648 tree = proto_item_add_subtree(item, ett_cmp);
1651 return dissect_cmp_pdu(tvb, pinfo, tree, NULL);
1655 /*--- proto_register_cmp ----------------------------------------------*/
1656 void proto_register_cmp(void) {
1658 /* List of fields */
1659 static hf_register_info hf[] = {
1660 { &hf_cmp_type_oid,
1661 { "InfoType", "cmp.type.oid",
1662 FT_STRING, BASE_NONE, NULL, 0,
1663 "Type of InfoTypeAndValue", HFILL }},
1664 { &hf_cmp_tcptrans_len,
1665 { "Length", "cmp.tcptrans.length",
1666 FT_UINT32, BASE_DEC, NULL, 0,
1667 "TCP transport Length of PDU in bytes", HFILL }},
1668 { &hf_cmp_tcptrans_type,
1669 { "Type", "cmp.tcptrans.type",
1670 FT_UINT8, BASE_DEC, VALS(cmp_pdu_types), 0,
1671 "TCP transport PDU Type", HFILL }},
1672 { &hf_cmp_tcptrans_poll_ref,
1673 { "Polling Reference", "cmp.tcptrans.poll_ref",
1674 FT_UINT32, BASE_HEX, NULL, 0,
1675 "TCP transport Polling Reference", HFILL }},
1676 { &hf_cmp_tcptrans_next_poll_ref,
1677 { "Next Polling Reference", "cmp.tcptrans.next_poll_ref",
1678 FT_UINT32, BASE_HEX, NULL, 0,
1679 "TCP transport Next Polling Reference", HFILL }},
1680 { &hf_cmp_tcptrans_ttcb,
1681 { "Time to check Back", "cmp.tcptrans.ttcb",
1682 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
1683 "TCP transport Time to check Back", HFILL }},
1684 { &hf_cmp_tcptrans10_version,
1685 { "Version", "cmp.tcptrans10.version",
1686 FT_UINT8, BASE_DEC, NULL, 0,
1687 "TCP transport version", HFILL }},
1688 { &hf_cmp_tcptrans10_flags,
1689 { "Flags", "cmp.tcptrans10.flags",
1690 FT_UINT8, BASE_DEC, NULL, 0,
1691 "TCP transport flags", HFILL }},
1692 { &hf_cmp_PBMParameter_PDU,
1693 { "PBMParameter", "cmp.PBMParameter_element",
1694 FT_NONE, BASE_NONE, NULL, 0,
1695 NULL, HFILL }},
1696 { &hf_cmp_DHBMParameter_PDU,
1697 { "DHBMParameter", "cmp.DHBMParameter_element",
1698 FT_NONE, BASE_NONE, NULL, 0,
1699 NULL, HFILL }},
1700 { &hf_cmp_CAProtEncCertValue_PDU,
1701 { "CAProtEncCertValue", "cmp.CAProtEncCertValue",
1702 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
1703 NULL, HFILL }},
1704 { &hf_cmp_SignKeyPairTypesValue_PDU,
1705 { "SignKeyPairTypesValue", "cmp.SignKeyPairTypesValue",
1706 FT_UINT32, BASE_DEC, NULL, 0,
1707 NULL, HFILL }},
1708 { &hf_cmp_EncKeyPairTypesValue_PDU,
1709 { "EncKeyPairTypesValue", "cmp.EncKeyPairTypesValue",
1710 FT_UINT32, BASE_DEC, NULL, 0,
1711 NULL, HFILL }},
1712 { &hf_cmp_PreferredSymmAlgValue_PDU,
1713 { "PreferredSymmAlgValue", "cmp.PreferredSymmAlgValue_element",
1714 FT_NONE, BASE_NONE, NULL, 0,
1715 NULL, HFILL }},
1716 { &hf_cmp_CAKeyUpdateInfoValue_PDU,
1717 { "CAKeyUpdateInfoValue", "cmp.CAKeyUpdateInfoValue_element",
1718 FT_NONE, BASE_NONE, NULL, 0,
1719 NULL, HFILL }},
1720 { &hf_cmp_CurrentCRLValue_PDU,
1721 { "CurrentCRLValue", "cmp.CurrentCRLValue_element",
1722 FT_NONE, BASE_NONE, NULL, 0,
1723 NULL, HFILL }},
1724 { &hf_cmp_UnsupportedOIDsValue_PDU,
1725 { "UnsupportedOIDsValue", "cmp.UnsupportedOIDsValue",
1726 FT_UINT32, BASE_DEC, NULL, 0,
1727 NULL, HFILL }},
1728 { &hf_cmp_KeyPairParamReqValue_PDU,
1729 { "KeyPairParamReqValue", "cmp.KeyPairParamReqValue",
1730 FT_OID, BASE_NONE, NULL, 0,
1731 NULL, HFILL }},
1732 { &hf_cmp_KeyPairParamRepValue_PDU,
1733 { "KeyPairParamRepValue", "cmp.KeyPairParamRepValue_element",
1734 FT_NONE, BASE_NONE, NULL, 0,
1735 NULL, HFILL }},
1736 { &hf_cmp_RevPassphraseValue_PDU,
1737 { "RevPassphraseValue", "cmp.RevPassphraseValue_element",
1738 FT_NONE, BASE_NONE, NULL, 0,
1739 NULL, HFILL }},
1740 { &hf_cmp_ImplicitConfirmValue_PDU,
1741 { "ImplicitConfirmValue", "cmp.ImplicitConfirmValue_element",
1742 FT_NONE, BASE_NONE, NULL, 0,
1743 NULL, HFILL }},
1744 { &hf_cmp_ConfirmWaitTimeValue_PDU,
1745 { "ConfirmWaitTimeValue", "cmp.ConfirmWaitTimeValue",
1746 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
1747 NULL, HFILL }},
1748 { &hf_cmp_OrigPKIMessageValue_PDU,
1749 { "OrigPKIMessageValue", "cmp.OrigPKIMessageValue",
1750 FT_UINT32, BASE_DEC, NULL, 0,
1751 NULL, HFILL }},
1752 { &hf_cmp_SuppLangTagsValue_PDU,
1753 { "SuppLangTagsValue", "cmp.SuppLangTagsValue",
1754 FT_UINT32, BASE_DEC, NULL, 0,
1755 NULL, HFILL }},
1756 { &hf_cmp_x509v3PKCert,
1757 { "x509v3PKCert", "cmp.x509v3PKCert_element",
1758 FT_NONE, BASE_NONE, NULL, 0,
1759 "Certificate", HFILL }},
1760 { &hf_cmp_header,
1761 { "header", "cmp.header_element",
1762 FT_NONE, BASE_NONE, NULL, 0,
1763 "PKIHeader", HFILL }},
1764 { &hf_cmp_body,
1765 { "body", "cmp.body",
1766 FT_UINT32, BASE_DEC, VALS(cmp_PKIBody_vals), 0,
1767 "PKIBody", HFILL }},
1768 { &hf_cmp_protection,
1769 { "protection", "cmp.protection",
1770 FT_BYTES, BASE_NONE, NULL, 0,
1771 "PKIProtection", HFILL }},
1772 { &hf_cmp_extraCerts,
1773 { "extraCerts", "cmp.extraCerts",
1774 FT_UINT32, BASE_DEC, NULL, 0,
1775 "SEQUENCE_SIZE_1_MAX_OF_CMPCertificate", HFILL }},
1776 { &hf_cmp_extraCerts_item,
1777 { "CMPCertificate", "cmp.CMPCertificate",
1778 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
1779 NULL, HFILL }},
1780 { &hf_cmp_PKIMessages_item,
1781 { "PKIMessage", "cmp.PKIMessage_element",
1782 FT_NONE, BASE_NONE, NULL, 0,
1783 NULL, HFILL }},
1784 { &hf_cmp_pvno,
1785 { "pvno", "cmp.pvno",
1786 FT_INT32, BASE_DEC, VALS(cmp_T_pvno_vals), 0,
1787 NULL, HFILL }},
1788 { &hf_cmp_sender,
1789 { "sender", "cmp.sender",
1790 FT_UINT32, BASE_DEC, NULL, 0,
1791 "GeneralName", HFILL }},
1792 { &hf_cmp_recipient,
1793 { "recipient", "cmp.recipient",
1794 FT_UINT32, BASE_DEC, NULL, 0,
1795 "GeneralName", HFILL }},
1796 { &hf_cmp_messageTime,
1797 { "messageTime", "cmp.messageTime",
1798 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
1799 "GeneralizedTime", HFILL }},
1800 { &hf_cmp_protectionAlg,
1801 { "protectionAlg", "cmp.protectionAlg_element",
1802 FT_NONE, BASE_NONE, NULL, 0,
1803 "AlgorithmIdentifier", HFILL }},
1804 { &hf_cmp_senderKID,
1805 { "senderKID", "cmp.senderKID",
1806 FT_BYTES, BASE_NONE, NULL, 0,
1807 "KeyIdentifier", HFILL }},
1808 { &hf_cmp_recipKID,
1809 { "recipKID", "cmp.recipKID",
1810 FT_BYTES, BASE_NONE, NULL, 0,
1811 "KeyIdentifier", HFILL }},
1812 { &hf_cmp_transactionID,
1813 { "transactionID", "cmp.transactionID",
1814 FT_BYTES, BASE_NONE, NULL, 0,
1815 "OCTET_STRING", HFILL }},
1816 { &hf_cmp_senderNonce,
1817 { "senderNonce", "cmp.senderNonce",
1818 FT_BYTES, BASE_NONE, NULL, 0,
1819 "OCTET_STRING", HFILL }},
1820 { &hf_cmp_recipNonce,
1821 { "recipNonce", "cmp.recipNonce",
1822 FT_BYTES, BASE_NONE, NULL, 0,
1823 "OCTET_STRING", HFILL }},
1824 { &hf_cmp_freeText,
1825 { "freeText", "cmp.freeText",
1826 FT_UINT32, BASE_DEC, NULL, 0,
1827 "PKIFreeText", HFILL }},
1828 { &hf_cmp_generalInfo,
1829 { "generalInfo", "cmp.generalInfo",
1830 FT_UINT32, BASE_DEC, NULL, 0,
1831 "SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue", HFILL }},
1832 { &hf_cmp_generalInfo_item,
1833 { "InfoTypeAndValue", "cmp.InfoTypeAndValue_element",
1834 FT_NONE, BASE_NONE, NULL, 0,
1835 NULL, HFILL }},
1836 { &hf_cmp_PKIFreeText_item,
1837 { "PKIFreeText item", "cmp.PKIFreeText_item",
1838 FT_STRING, BASE_NONE, NULL, 0,
1839 "UTF8String", HFILL }},
1840 { &hf_cmp_ir,
1841 { "ir", "cmp.ir",
1842 FT_UINT32, BASE_DEC, NULL, 0,
1843 "CertReqMessages", HFILL }},
1844 { &hf_cmp_ip,
1845 { "ip", "cmp.ip_element",
1846 FT_NONE, BASE_NONE, NULL, 0,
1847 "CertRepMessage", HFILL }},
1848 { &hf_cmp_cr,
1849 { "cr", "cmp.cr",
1850 FT_UINT32, BASE_DEC, NULL, 0,
1851 "CertReqMessages", HFILL }},
1852 { &hf_cmp_cp,
1853 { "cp", "cmp.cp_element",
1854 FT_NONE, BASE_NONE, NULL, 0,
1855 "CertRepMessage", HFILL }},
1856 { &hf_cmp_p10cr,
1857 { "p10cr", "cmp.p10cr_element",
1858 FT_NONE, BASE_NONE, NULL, 0,
1859 "CertificationRequest", HFILL }},
1860 { &hf_cmp_popdecc,
1861 { "popdecc", "cmp.popdecc",
1862 FT_UINT32, BASE_DEC, NULL, 0,
1863 "POPODecKeyChallContent", HFILL }},
1864 { &hf_cmp_popdecr,
1865 { "popdecr", "cmp.popdecr",
1866 FT_UINT32, BASE_DEC, NULL, 0,
1867 "POPODecKeyRespContent", HFILL }},
1868 { &hf_cmp_kur,
1869 { "kur", "cmp.kur",
1870 FT_UINT32, BASE_DEC, NULL, 0,
1871 "CertReqMessages", HFILL }},
1872 { &hf_cmp_kup,
1873 { "kup", "cmp.kup_element",
1874 FT_NONE, BASE_NONE, NULL, 0,
1875 "CertRepMessage", HFILL }},
1876 { &hf_cmp_krr,
1877 { "krr", "cmp.krr",
1878 FT_UINT32, BASE_DEC, NULL, 0,
1879 "CertReqMessages", HFILL }},
1880 { &hf_cmp_krp,
1881 { "krp", "cmp.krp_element",
1882 FT_NONE, BASE_NONE, NULL, 0,
1883 "KeyRecRepContent", HFILL }},
1884 { &hf_cmp_rr,
1885 { "rr", "cmp.rr",
1886 FT_UINT32, BASE_DEC, NULL, 0,
1887 "RevReqContent", HFILL }},
1888 { &hf_cmp_rp,
1889 { "rp", "cmp.rp_element",
1890 FT_NONE, BASE_NONE, NULL, 0,
1891 "RevRepContent", HFILL }},
1892 { &hf_cmp_ccr,
1893 { "ccr", "cmp.ccr",
1894 FT_UINT32, BASE_DEC, NULL, 0,
1895 "CertReqMessages", HFILL }},
1896 { &hf_cmp_ccp,
1897 { "ccp", "cmp.ccp_element",
1898 FT_NONE, BASE_NONE, NULL, 0,
1899 "CertRepMessage", HFILL }},
1900 { &hf_cmp_ckuann,
1901 { "ckuann", "cmp.ckuann_element",
1902 FT_NONE, BASE_NONE, NULL, 0,
1903 "CAKeyUpdAnnContent", HFILL }},
1904 { &hf_cmp_cann,
1905 { "cann", "cmp.cann",
1906 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
1907 "CertAnnContent", HFILL }},
1908 { &hf_cmp_rann,
1909 { "rann", "cmp.rann_element",
1910 FT_NONE, BASE_NONE, NULL, 0,
1911 "RevAnnContent", HFILL }},
1912 { &hf_cmp_crlann,
1913 { "crlann", "cmp.crlann",
1914 FT_UINT32, BASE_DEC, NULL, 0,
1915 "CRLAnnContent", HFILL }},
1916 { &hf_cmp_pkiconf,
1917 { "pkiconf", "cmp.pkiconf_element",
1918 FT_NONE, BASE_NONE, NULL, 0,
1919 "PKIConfirmContent", HFILL }},
1920 { &hf_cmp_nested,
1921 { "nested", "cmp.nested",
1922 FT_UINT32, BASE_DEC, NULL, 0,
1923 "NestedMessageContent", HFILL }},
1924 { &hf_cmp_genm,
1925 { "genm", "cmp.genm",
1926 FT_UINT32, BASE_DEC, NULL, 0,
1927 "GenMsgContent", HFILL }},
1928 { &hf_cmp_genp,
1929 { "genp", "cmp.genp",
1930 FT_UINT32, BASE_DEC, NULL, 0,
1931 "GenRepContent", HFILL }},
1932 { &hf_cmp_error,
1933 { "error", "cmp.error_element",
1934 FT_NONE, BASE_NONE, NULL, 0,
1935 "ErrorMsgContent", HFILL }},
1936 { &hf_cmp_certConf,
1937 { "certConf", "cmp.certConf",
1938 FT_UINT32, BASE_DEC, NULL, 0,
1939 "CertConfirmContent", HFILL }},
1940 { &hf_cmp_pollReq,
1941 { "pollReq", "cmp.pollReq",
1942 FT_UINT32, BASE_DEC, NULL, 0,
1943 "PollReqContent", HFILL }},
1944 { &hf_cmp_pollRep,
1945 { "pollRep", "cmp.pollRep",
1946 FT_UINT32, BASE_DEC, NULL, 0,
1947 "PollRepContent", HFILL }},
1948 { &hf_cmp_salt,
1949 { "salt", "cmp.salt",
1950 FT_BYTES, BASE_NONE, NULL, 0,
1951 "OCTET_STRING", HFILL }},
1952 { &hf_cmp_owf,
1953 { "owf", "cmp.owf_element",
1954 FT_NONE, BASE_NONE, NULL, 0,
1955 "AlgorithmIdentifier", HFILL }},
1956 { &hf_cmp_iterationCount,
1957 { "iterationCount", "cmp.iterationCount",
1958 FT_INT32, BASE_DEC, NULL, 0,
1959 "INTEGER", HFILL }},
1960 { &hf_cmp_mac,
1961 { "mac", "cmp.mac_element",
1962 FT_NONE, BASE_NONE, NULL, 0,
1963 "AlgorithmIdentifier", HFILL }},
1964 { &hf_cmp_pkistatus,
1965 { "status", "cmp.pkistatus",
1966 FT_INT32, BASE_DEC, VALS(cmp_PKIStatus_vals), 0,
1967 "PKIStatus", HFILL }},
1968 { &hf_cmp_statusString,
1969 { "statusString", "cmp.statusString",
1970 FT_UINT32, BASE_DEC, NULL, 0,
1971 "PKIFreeText", HFILL }},
1972 { &hf_cmp_failInfo,
1973 { "failInfo", "cmp.failInfo",
1974 FT_BYTES, BASE_NONE, NULL, 0,
1975 "PKIFailureInfo", HFILL }},
1976 { &hf_cmp_hashAlg,
1977 { "hashAlg", "cmp.hashAlg_element",
1978 FT_NONE, BASE_NONE, NULL, 0,
1979 "AlgorithmIdentifier", HFILL }},
1980 { &hf_cmp_certId,
1981 { "certId", "cmp.certId_element",
1982 FT_NONE, BASE_NONE, NULL, 0,
1983 NULL, HFILL }},
1984 { &hf_cmp_hashVal,
1985 { "hashVal", "cmp.hashVal",
1986 FT_BYTES, BASE_NONE, NULL, 0,
1987 "BIT_STRING", HFILL }},
1988 { &hf_cmp_POPODecKeyChallContent_item,
1989 { "Challenge", "cmp.Challenge_element",
1990 FT_NONE, BASE_NONE, NULL, 0,
1991 NULL, HFILL }},
1992 { &hf_cmp_witness,
1993 { "witness", "cmp.witness",
1994 FT_BYTES, BASE_NONE, NULL, 0,
1995 "OCTET_STRING", HFILL }},
1996 { &hf_cmp_challenge,
1997 { "challenge", "cmp.challenge",
1998 FT_BYTES, BASE_NONE, NULL, 0,
1999 "OCTET_STRING", HFILL }},
2000 { &hf_cmp_POPODecKeyRespContent_item,
2001 { "POPODecKeyRespContent item", "cmp.POPODecKeyRespContent_item",
2002 FT_INT32, BASE_DEC, NULL, 0,
2003 "INTEGER", HFILL }},
2004 { &hf_cmp_caPubs,
2005 { "caPubs", "cmp.caPubs",
2006 FT_UINT32, BASE_DEC, NULL, 0,
2007 "SEQUENCE_SIZE_1_MAX_OF_CMPCertificate", HFILL }},
2008 { &hf_cmp_caPubs_item,
2009 { "CMPCertificate", "cmp.CMPCertificate",
2010 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
2011 NULL, HFILL }},
2012 { &hf_cmp_response,
2013 { "response", "cmp.response",
2014 FT_UINT32, BASE_DEC, NULL, 0,
2015 "SEQUENCE_OF_CertResponse", HFILL }},
2016 { &hf_cmp_response_item,
2017 { "CertResponse", "cmp.CertResponse_element",
2018 FT_NONE, BASE_NONE, NULL, 0,
2019 NULL, HFILL }},
2020 { &hf_cmp_certReqId,
2021 { "certReqId", "cmp.certReqId",
2022 FT_INT32, BASE_DEC, NULL, 0,
2023 "INTEGER", HFILL }},
2024 { &hf_cmp_pkistatusinf,
2025 { "status", "cmp.status_element",
2026 FT_NONE, BASE_NONE, NULL, 0,
2027 "PKIStatusInfo", HFILL }},
2028 { &hf_cmp_certifiedKeyPair,
2029 { "certifiedKeyPair", "cmp.certifiedKeyPair_element",
2030 FT_NONE, BASE_NONE, NULL, 0,
2031 NULL, HFILL }},
2032 { &hf_cmp_rspInfo,
2033 { "rspInfo", "cmp.rspInfo",
2034 FT_BYTES, BASE_NONE, NULL, 0,
2035 "OCTET_STRING", HFILL }},
2036 { &hf_cmp_certOrEncCert,
2037 { "certOrEncCert", "cmp.certOrEncCert",
2038 FT_UINT32, BASE_DEC, VALS(cmp_CertOrEncCert_vals), 0,
2039 NULL, HFILL }},
2040 { &hf_cmp_privateKey,
2041 { "privateKey", "cmp.privateKey_element",
2042 FT_NONE, BASE_NONE, NULL, 0,
2043 "EncryptedValue", HFILL }},
2044 { &hf_cmp_publicationInfo,
2045 { "publicationInfo", "cmp.publicationInfo_element",
2046 FT_NONE, BASE_NONE, NULL, 0,
2047 "PKIPublicationInfo", HFILL }},
2048 { &hf_cmp_certificate,
2049 { "certificate", "cmp.certificate",
2050 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
2051 "CMPCertificate", HFILL }},
2052 { &hf_cmp_encryptedCert,
2053 { "encryptedCert", "cmp.encryptedCert_element",
2054 FT_NONE, BASE_NONE, NULL, 0,
2055 "EncryptedValue", HFILL }},
2056 { &hf_cmp_newSigCert,
2057 { "newSigCert", "cmp.newSigCert",
2058 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
2059 "CMPCertificate", HFILL }},
2060 { &hf_cmp_caCerts,
2061 { "caCerts", "cmp.caCerts",
2062 FT_UINT32, BASE_DEC, NULL, 0,
2063 "SEQUENCE_SIZE_1_MAX_OF_CMPCertificate", HFILL }},
2064 { &hf_cmp_caCerts_item,
2065 { "CMPCertificate", "cmp.CMPCertificate",
2066 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
2067 NULL, HFILL }},
2068 { &hf_cmp_keyPairHist,
2069 { "keyPairHist", "cmp.keyPairHist",
2070 FT_UINT32, BASE_DEC, NULL, 0,
2071 "SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair", HFILL }},
2072 { &hf_cmp_keyPairHist_item,
2073 { "CertifiedKeyPair", "cmp.CertifiedKeyPair_element",
2074 FT_NONE, BASE_NONE, NULL, 0,
2075 NULL, HFILL }},
2076 { &hf_cmp_RevReqContent_item,
2077 { "RevDetails", "cmp.RevDetails_element",
2078 FT_NONE, BASE_NONE, NULL, 0,
2079 NULL, HFILL }},
2080 { &hf_cmp_certDetails,
2081 { "certDetails", "cmp.certDetails_element",
2082 FT_NONE, BASE_NONE, NULL, 0,
2083 "CertTemplate", HFILL }},
2084 { &hf_cmp_crlEntryDetails,
2085 { "crlEntryDetails", "cmp.crlEntryDetails",
2086 FT_UINT32, BASE_DEC, NULL, 0,
2087 "Extensions", HFILL }},
2088 { &hf_cmp_rvrpcnt_status,
2089 { "status", "cmp.rvrpcnt_status",
2090 FT_UINT32, BASE_DEC, NULL, 0,
2091 "SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo", HFILL }},
2092 { &hf_cmp_rvrpcnt_status_item,
2093 { "PKIStatusInfo", "cmp.PKIStatusInfo_element",
2094 FT_NONE, BASE_NONE, NULL, 0,
2095 NULL, HFILL }},
2096 { &hf_cmp_revCerts,
2097 { "revCerts", "cmp.revCerts",
2098 FT_UINT32, BASE_DEC, NULL, 0,
2099 "SEQUENCE_SIZE_1_MAX_OF_CertId", HFILL }},
2100 { &hf_cmp_revCerts_item,
2101 { "CertId", "cmp.CertId_element",
2102 FT_NONE, BASE_NONE, NULL, 0,
2103 NULL, HFILL }},
2104 { &hf_cmp_crls,
2105 { "crls", "cmp.crls",
2106 FT_UINT32, BASE_DEC, NULL, 0,
2107 "SEQUENCE_SIZE_1_MAX_OF_CertificateList", HFILL }},
2108 { &hf_cmp_crls_item,
2109 { "CertificateList", "cmp.CertificateList_element",
2110 FT_NONE, BASE_NONE, NULL, 0,
2111 NULL, HFILL }},
2112 { &hf_cmp_oldWithNew,
2113 { "oldWithNew", "cmp.oldWithNew",
2114 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
2115 "CMPCertificate", HFILL }},
2116 { &hf_cmp_newWithOld,
2117 { "newWithOld", "cmp.newWithOld",
2118 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
2119 "CMPCertificate", HFILL }},
2120 { &hf_cmp_newWithNew,
2121 { "newWithNew", "cmp.newWithNew",
2122 FT_UINT32, BASE_DEC, VALS(cmp_CMPCertificate_vals), 0,
2123 "CMPCertificate", HFILL }},
2124 { &hf_cmp_pkistatus_01,
2125 { "status", "cmp.status",
2126 FT_INT32, BASE_DEC, VALS(cmp_PKIStatus_vals), 0,
2127 "PKIStatus", HFILL }},
2128 { &hf_cmp_willBeRevokedAt,
2129 { "willBeRevokedAt", "cmp.willBeRevokedAt",
2130 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
2131 "GeneralizedTime", HFILL }},
2132 { &hf_cmp_badSinceDate,
2133 { "badSinceDate", "cmp.badSinceDate",
2134 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
2135 "GeneralizedTime", HFILL }},
2136 { &hf_cmp_crlDetails,
2137 { "crlDetails", "cmp.crlDetails",
2138 FT_UINT32, BASE_DEC, NULL, 0,
2139 "Extensions", HFILL }},
2140 { &hf_cmp_CRLAnnContent_item,
2141 { "CertificateList", "cmp.CertificateList_element",
2142 FT_NONE, BASE_NONE, NULL, 0,
2143 NULL, HFILL }},
2144 { &hf_cmp_CertConfirmContent_item,
2145 { "CertStatus", "cmp.CertStatus_element",
2146 FT_NONE, BASE_NONE, NULL, 0,
2147 NULL, HFILL }},
2148 { &hf_cmp_certHash,
2149 { "certHash", "cmp.certHash",
2150 FT_BYTES, BASE_NONE, NULL, 0,
2151 "OCTET_STRING", HFILL }},
2152 { &hf_cmp_statusInfo,
2153 { "statusInfo", "cmp.statusInfo_element",
2154 FT_NONE, BASE_NONE, NULL, 0,
2155 "PKIStatusInfo", HFILL }},
2156 { &hf_cmp_infoType,
2157 { "infoType", "cmp.infoType",
2158 FT_OID, BASE_NONE, NULL, 0,
2159 NULL, HFILL }},
2160 { &hf_cmp_infoValue,
2161 { "infoValue", "cmp.infoValue_element",
2162 FT_NONE, BASE_NONE, NULL, 0,
2163 NULL, HFILL }},
2164 { &hf_cmp_SignKeyPairTypesValue_item,
2165 { "AlgorithmIdentifier", "cmp.AlgorithmIdentifier_element",
2166 FT_NONE, BASE_NONE, NULL, 0,
2167 NULL, HFILL }},
2168 { &hf_cmp_EncKeyPairTypesValue_item,
2169 { "AlgorithmIdentifier", "cmp.AlgorithmIdentifier_element",
2170 FT_NONE, BASE_NONE, NULL, 0,
2171 NULL, HFILL }},
2172 { &hf_cmp_UnsupportedOIDsValue_item,
2173 { "UnsupportedOIDsValue item", "cmp.UnsupportedOIDsValue_item",
2174 FT_OID, BASE_NONE, NULL, 0,
2175 "OBJECT_IDENTIFIER", HFILL }},
2176 { &hf_cmp_SuppLangTagsValue_item,
2177 { "SuppLangTagsValue item", "cmp.SuppLangTagsValue_item",
2178 FT_STRING, BASE_NONE, NULL, 0,
2179 "UTF8String", HFILL }},
2180 { &hf_cmp_GenMsgContent_item,
2181 { "InfoTypeAndValue", "cmp.InfoTypeAndValue_element",
2182 FT_NONE, BASE_NONE, NULL, 0,
2183 NULL, HFILL }},
2184 { &hf_cmp_GenRepContent_item,
2185 { "InfoTypeAndValue", "cmp.InfoTypeAndValue_element",
2186 FT_NONE, BASE_NONE, NULL, 0,
2187 NULL, HFILL }},
2188 { &hf_cmp_pKIStatusInfo,
2189 { "pKIStatusInfo", "cmp.pKIStatusInfo_element",
2190 FT_NONE, BASE_NONE, NULL, 0,
2191 NULL, HFILL }},
2192 { &hf_cmp_errorCode,
2193 { "errorCode", "cmp.errorCode",
2194 FT_INT32, BASE_DEC, NULL, 0,
2195 "INTEGER", HFILL }},
2196 { &hf_cmp_errorDetails,
2197 { "errorDetails", "cmp.errorDetails",
2198 FT_UINT32, BASE_DEC, NULL, 0,
2199 "PKIFreeText", HFILL }},
2200 { &hf_cmp_PollReqContent_item,
2201 { "PollReqContent item", "cmp.PollReqContent_item_element",
2202 FT_NONE, BASE_NONE, NULL, 0,
2203 NULL, HFILL }},
2204 { &hf_cmp_PollRepContent_item,
2205 { "PollRepContent item", "cmp.PollRepContent_item_element",
2206 FT_NONE, BASE_NONE, NULL, 0,
2207 NULL, HFILL }},
2208 { &hf_cmp_checkAfter,
2209 { "checkAfter", "cmp.checkAfter",
2210 FT_INT32, BASE_DEC, NULL, 0,
2211 "INTEGER", HFILL }},
2212 { &hf_cmp_reason,
2213 { "reason", "cmp.reason",
2214 FT_UINT32, BASE_DEC, NULL, 0,
2215 "PKIFreeText", HFILL }},
2216 { &hf_cmp_PKIFailureInfo_badAlg,
2217 { "badAlg", "cmp.PKIFailureInfo.badAlg",
2218 FT_BOOLEAN, 8, NULL, 0x80,
2219 NULL, HFILL }},
2220 { &hf_cmp_PKIFailureInfo_badMessageCheck,
2221 { "badMessageCheck", "cmp.PKIFailureInfo.badMessageCheck",
2222 FT_BOOLEAN, 8, NULL, 0x40,
2223 NULL, HFILL }},
2224 { &hf_cmp_PKIFailureInfo_badRequest,
2225 { "badRequest", "cmp.PKIFailureInfo.badRequest",
2226 FT_BOOLEAN, 8, NULL, 0x20,
2227 NULL, HFILL }},
2228 { &hf_cmp_PKIFailureInfo_badTime,
2229 { "badTime", "cmp.PKIFailureInfo.badTime",
2230 FT_BOOLEAN, 8, NULL, 0x10,
2231 NULL, HFILL }},
2232 { &hf_cmp_PKIFailureInfo_badCertId,
2233 { "badCertId", "cmp.PKIFailureInfo.badCertId",
2234 FT_BOOLEAN, 8, NULL, 0x08,
2235 NULL, HFILL }},
2236 { &hf_cmp_PKIFailureInfo_badDataFormat,
2237 { "badDataFormat", "cmp.PKIFailureInfo.badDataFormat",
2238 FT_BOOLEAN, 8, NULL, 0x04,
2239 NULL, HFILL }},
2240 { &hf_cmp_PKIFailureInfo_wrongAuthority,
2241 { "wrongAuthority", "cmp.PKIFailureInfo.wrongAuthority",
2242 FT_BOOLEAN, 8, NULL, 0x02,
2243 NULL, HFILL }},
2244 { &hf_cmp_PKIFailureInfo_incorrectData,
2245 { "incorrectData", "cmp.PKIFailureInfo.incorrectData",
2246 FT_BOOLEAN, 8, NULL, 0x01,
2247 NULL, HFILL }},
2248 { &hf_cmp_PKIFailureInfo_missingTimeStamp,
2249 { "missingTimeStamp", "cmp.PKIFailureInfo.missingTimeStamp",
2250 FT_BOOLEAN, 8, NULL, 0x80,
2251 NULL, HFILL }},
2252 { &hf_cmp_PKIFailureInfo_badPOP,
2253 { "badPOP", "cmp.PKIFailureInfo.badPOP",
2254 FT_BOOLEAN, 8, NULL, 0x40,
2255 NULL, HFILL }},
2256 { &hf_cmp_PKIFailureInfo_certRevoked,
2257 { "certRevoked", "cmp.PKIFailureInfo.certRevoked",
2258 FT_BOOLEAN, 8, NULL, 0x20,
2259 NULL, HFILL }},
2260 { &hf_cmp_PKIFailureInfo_certConfirmed,
2261 { "certConfirmed", "cmp.PKIFailureInfo.certConfirmed",
2262 FT_BOOLEAN, 8, NULL, 0x10,
2263 NULL, HFILL }},
2264 { &hf_cmp_PKIFailureInfo_wrongIntegrity,
2265 { "wrongIntegrity", "cmp.PKIFailureInfo.wrongIntegrity",
2266 FT_BOOLEAN, 8, NULL, 0x08,
2267 NULL, HFILL }},
2268 { &hf_cmp_PKIFailureInfo_badRecipientNonce,
2269 { "badRecipientNonce", "cmp.PKIFailureInfo.badRecipientNonce",
2270 FT_BOOLEAN, 8, NULL, 0x04,
2271 NULL, HFILL }},
2272 { &hf_cmp_PKIFailureInfo_timeNotAvailable,
2273 { "timeNotAvailable", "cmp.PKIFailureInfo.timeNotAvailable",
2274 FT_BOOLEAN, 8, NULL, 0x02,
2275 NULL, HFILL }},
2276 { &hf_cmp_PKIFailureInfo_unacceptedPolicy,
2277 { "unacceptedPolicy", "cmp.PKIFailureInfo.unacceptedPolicy",
2278 FT_BOOLEAN, 8, NULL, 0x01,
2279 NULL, HFILL }},
2280 { &hf_cmp_PKIFailureInfo_unacceptedExtension,
2281 { "unacceptedExtension", "cmp.PKIFailureInfo.unacceptedExtension",
2282 FT_BOOLEAN, 8, NULL, 0x80,
2283 NULL, HFILL }},
2284 { &hf_cmp_PKIFailureInfo_addInfoNotAvailable,
2285 { "addInfoNotAvailable", "cmp.PKIFailureInfo.addInfoNotAvailable",
2286 FT_BOOLEAN, 8, NULL, 0x40,
2287 NULL, HFILL }},
2288 { &hf_cmp_PKIFailureInfo_badSenderNonce,
2289 { "badSenderNonce", "cmp.PKIFailureInfo.badSenderNonce",
2290 FT_BOOLEAN, 8, NULL, 0x20,
2291 NULL, HFILL }},
2292 { &hf_cmp_PKIFailureInfo_badCertTemplate,
2293 { "badCertTemplate", "cmp.PKIFailureInfo.badCertTemplate",
2294 FT_BOOLEAN, 8, NULL, 0x10,
2295 NULL, HFILL }},
2296 { &hf_cmp_PKIFailureInfo_signerNotTrusted,
2297 { "signerNotTrusted", "cmp.PKIFailureInfo.signerNotTrusted",
2298 FT_BOOLEAN, 8, NULL, 0x08,
2299 NULL, HFILL }},
2300 { &hf_cmp_PKIFailureInfo_transactionIdInUse,
2301 { "transactionIdInUse", "cmp.PKIFailureInfo.transactionIdInUse",
2302 FT_BOOLEAN, 8, NULL, 0x04,
2303 NULL, HFILL }},
2304 { &hf_cmp_PKIFailureInfo_unsupportedVersion,
2305 { "unsupportedVersion", "cmp.PKIFailureInfo.unsupportedVersion",
2306 FT_BOOLEAN, 8, NULL, 0x02,
2307 NULL, HFILL }},
2308 { &hf_cmp_PKIFailureInfo_notAuthorized,
2309 { "notAuthorized", "cmp.PKIFailureInfo.notAuthorized",
2310 FT_BOOLEAN, 8, NULL, 0x01,
2311 NULL, HFILL }},
2312 { &hf_cmp_PKIFailureInfo_systemUnavail,
2313 { "systemUnavail", "cmp.PKIFailureInfo.systemUnavail",
2314 FT_BOOLEAN, 8, NULL, 0x80,
2315 NULL, HFILL }},
2316 { &hf_cmp_PKIFailureInfo_systemFailure,
2317 { "systemFailure", "cmp.PKIFailureInfo.systemFailure",
2318 FT_BOOLEAN, 8, NULL, 0x40,
2319 NULL, HFILL }},
2320 { &hf_cmp_PKIFailureInfo_duplicateCertReq,
2321 { "duplicateCertReq", "cmp.PKIFailureInfo.duplicateCertReq",
2322 FT_BOOLEAN, 8, NULL, 0x20,
2323 NULL, HFILL }},
2326 /* List of subtrees */
2327 static int *ett[] = {
2328 &ett_cmp,
2329 &ett_cmp_CMPCertificate,
2330 &ett_cmp_PKIMessage,
2331 &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CMPCertificate,
2332 &ett_cmp_PKIMessages,
2333 &ett_cmp_PKIHeader,
2334 &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_InfoTypeAndValue,
2335 &ett_cmp_PKIFreeText,
2336 &ett_cmp_PKIBody,
2337 &ett_cmp_ProtectedPart,
2338 &ett_cmp_PBMParameter,
2339 &ett_cmp_DHBMParameter,
2340 &ett_cmp_PKIFailureInfo,
2341 &ett_cmp_PKIStatusInfo,
2342 &ett_cmp_OOBCertHash,
2343 &ett_cmp_POPODecKeyChallContent,
2344 &ett_cmp_Challenge,
2345 &ett_cmp_POPODecKeyRespContent,
2346 &ett_cmp_CertRepMessage,
2347 &ett_cmp_SEQUENCE_OF_CertResponse,
2348 &ett_cmp_CertResponse,
2349 &ett_cmp_CertifiedKeyPair,
2350 &ett_cmp_CertOrEncCert,
2351 &ett_cmp_KeyRecRepContent,
2352 &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertifiedKeyPair,
2353 &ett_cmp_RevReqContent,
2354 &ett_cmp_RevDetails,
2355 &ett_cmp_RevRepContent,
2356 &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_PKIStatusInfo,
2357 &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertId,
2358 &ett_cmp_SEQUENCE_SIZE_1_MAX_OF_CertificateList,
2359 &ett_cmp_CAKeyUpdAnnContent,
2360 &ett_cmp_RevAnnContent,
2361 &ett_cmp_CRLAnnContent,
2362 &ett_cmp_CertConfirmContent,
2363 &ett_cmp_CertStatus,
2364 &ett_cmp_InfoTypeAndValue,
2365 &ett_cmp_SignKeyPairTypesValue,
2366 &ett_cmp_EncKeyPairTypesValue,
2367 &ett_cmp_UnsupportedOIDsValue,
2368 &ett_cmp_SuppLangTagsValue,
2369 &ett_cmp_GenMsgContent,
2370 &ett_cmp_GenRepContent,
2371 &ett_cmp_ErrorMsgContent,
2372 &ett_cmp_PollReqContent,
2373 &ett_cmp_PollReqContent_item,
2374 &ett_cmp_PollRepContent,
2375 &ett_cmp_PollRepContent_item,
2377 module_t *cmp_module;
2379 /* Register protocol */
2380 proto_cmp = proto_register_protocol(PNAME, PSNAME, PFNAME);
2382 /* Register fields and subtrees */
2383 proto_register_field_array(proto_cmp, hf, array_length(hf));
2384 proto_register_subtree_array(ett, array_length(ett));
2386 /* Register preferences */
2387 cmp_module = prefs_register_protocol(proto_cmp, proto_reg_handoff_cmp);
2388 prefs_register_bool_preference(cmp_module, "desegment",
2389 "Reassemble CMP-over-TCP messages spanning multiple TCP segments",
2390 "Whether the CMP-over-TCP dissector should reassemble messages spanning multiple TCP segments. "
2391 "To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
2392 &cmp_desegment);
2394 prefs_register_uint_preference(cmp_module, "http_alternate_port",
2395 "Alternate HTTP port",
2396 "Decode this TCP port\'s traffic as CMP-over-HTTP. Set to \"0\" to disable. "
2397 "Use this if the Content-Type is not set correctly.",
2399 &cmp_alternate_http_port);
2401 prefs_register_uint_preference(cmp_module, "tcp_style_http_alternate_port",
2402 "Alternate TCP-style-HTTP port",
2403 "Decode this TCP port\'s traffic as TCP-transport-style CMP-over-HTTP. Set to \"0\" to disable. "
2404 "Use this if the Content-Type is not set correctly.",
2406 &cmp_alternate_tcp_style_http_port);
2408 /* Register dissectors */
2409 cmp_http_handle = register_dissector("cmp.http", dissect_cmp_http, proto_cmp);
2410 cmp_tcp_style_http_handle = register_dissector("cmp.tcp_pdu", dissect_cmp_tcp_pdu, proto_cmp);
2411 cmp_tcp_handle = register_dissector("cmp", dissect_cmp_tcp, proto_cmp);
2412 register_ber_syntax_dissector("PKIMessage", proto_cmp, dissect_cmp_pdu);
2416 /*--- proto_reg_handoff_cmp -------------------------------------------*/
2417 void proto_reg_handoff_cmp(void) {
2418 static bool inited = false;
2419 static unsigned cmp_alternate_http_port_prev = 0;
2420 static unsigned cmp_alternate_tcp_style_http_port_prev = 0;
2422 if (!inited) {
2423 dissector_add_string("media_type", "application/pkixcmp", cmp_http_handle);
2424 dissector_add_string("media_type", "application/x-pkixcmp", cmp_http_handle);
2426 dissector_add_string("media_type", "application/pkixcmp-poll", cmp_tcp_style_http_handle);
2427 dissector_add_string("media_type", "application/x-pkixcmp-poll", cmp_tcp_style_http_handle);
2429 dissector_add_uint_with_preference("tcp.port", TCP_PORT_CMP, cmp_tcp_handle);
2431 oid_add_from_string("Cryptlib-presence-check","1.3.6.1.4.1.3029.3.1.1");
2432 oid_add_from_string("Cryptlib-PKIBoot","1.3.6.1.4.1.3029.3.1.2");
2434 oid_add_from_string("HMAC MD5","1.3.6.1.5.5.8.1.1");
2435 oid_add_from_string("HMAC SHA-1","1.3.6.1.5.5.8.1.2");
2436 oid_add_from_string("HMAC TIGER","1.3.6.1.5.5.8.1.3");
2437 oid_add_from_string("HMAC RIPEMD-160","1.3.6.1.5.5.8.1.4");
2439 register_ber_oid_dissector("1.2.840.113533.7.66.13", dissect_PBMParameter_PDU, proto_cmp, "id-PasswordBasedMac");
2440 register_ber_oid_dissector("1.2.640.113533.7.66.30", dissect_DHBMParameter_PDU, proto_cmp, "id-DHBasedMac");
2441 register_ber_oid_dissector("1.3.6.1.5.5.7.4.1", dissect_CAProtEncCertValue_PDU, proto_cmp, "id-it-caProtEncCert");
2442 register_ber_oid_dissector("1.3.6.1.5.5.7.4.2", dissect_SignKeyPairTypesValue_PDU, proto_cmp, "id-it-signKeyPairTypes");
2443 register_ber_oid_dissector("1.3.6.1.5.5.7.4.3", dissect_EncKeyPairTypesValue_PDU, proto_cmp, "id-it-encKeyPairTypes");
2444 register_ber_oid_dissector("1.3.6.1.5.5.7.4.4", dissect_PreferredSymmAlgValue_PDU, proto_cmp, "id-it-preferredSymmAlg");
2445 register_ber_oid_dissector("1.3.6.1.5.5.7.4.5", dissect_CAKeyUpdateInfoValue_PDU, proto_cmp, "id-it-caKeyUpdateInfo");
2446 register_ber_oid_dissector("1.3.6.1.5.5.7.4.6", dissect_CurrentCRLValue_PDU, proto_cmp, "id-it-currentCRL");
2447 register_ber_oid_dissector("1.3.6.1.5.5.7.4.7", dissect_UnsupportedOIDsValue_PDU, proto_cmp, "id-it-unsupportedOIDs");
2448 register_ber_oid_dissector("1.3.6.1.5.5.7.4.10", dissect_KeyPairParamReqValue_PDU, proto_cmp, "id-it-keyPairParamReq");
2449 register_ber_oid_dissector("1.3.6.1.5.5.7.4.11", dissect_KeyPairParamRepValue_PDU, proto_cmp, "id-it-keyPairParamRep");
2450 register_ber_oid_dissector("1.3.6.1.5.5.7.4.12", dissect_RevPassphraseValue_PDU, proto_cmp, "id-it-revPassphrase");
2451 register_ber_oid_dissector("1.3.6.1.5.5.7.4.13", dissect_ImplicitConfirmValue_PDU, proto_cmp, "id-it-implicitConfirm");
2452 register_ber_oid_dissector("1.3.6.1.5.5.7.4.14", dissect_ConfirmWaitTimeValue_PDU, proto_cmp, "id-it-confirmWaitTime");
2453 register_ber_oid_dissector("1.3.6.1.5.5.7.4.15", dissect_OrigPKIMessageValue_PDU, proto_cmp, "id-it-origPKIMessage");
2454 register_ber_oid_dissector("1.3.6.1.5.5.7.4.16", dissect_SuppLangTagsValue_PDU, proto_cmp, "id-it-suppLangTags");
2456 inited = true;
2459 /* change alternate HTTP port if changed in the preferences */
2460 if (cmp_alternate_http_port != cmp_alternate_http_port_prev) {
2461 if (cmp_alternate_http_port_prev != 0) {
2462 http_tcp_dissector_delete(cmp_alternate_http_port_prev);
2464 if (cmp_alternate_http_port != 0)
2465 http_tcp_dissector_add( cmp_alternate_http_port, cmp_http_handle);
2466 cmp_alternate_http_port_prev = cmp_alternate_http_port;
2469 /* change alternate TCP-style-HTTP port if changed in the preferences */
2470 if (cmp_alternate_tcp_style_http_port != cmp_alternate_tcp_style_http_port_prev) {
2471 if (cmp_alternate_tcp_style_http_port_prev != 0) {
2472 http_tcp_dissector_delete(cmp_alternate_tcp_style_http_port_prev);
2474 if (cmp_alternate_tcp_style_http_port != 0)
2475 http_tcp_dissector_add( cmp_alternate_tcp_style_http_port, cmp_tcp_style_http_handle);
2476 cmp_alternate_tcp_style_http_port_prev = cmp_alternate_tcp_style_http_port;