remove functions register_ber_oid_name() and get_ber_oid_name() from packet-ber.c...
[obnox/wireshark/wip.git] / epan / dissectors / packet-x509af.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
3 /* .\packet-x509af.c                                                          */
4 /* ../../tools/asn2wrs.py -b -e -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */
5
6 /* Input file: packet-x509af-template.c */
7
8 #line 1 "packet-x509af-template.c"
9 /* packet-x509af.c
10  * Routines for X.509 Authentication Framework packet dissection
11  *  Ronnie Sahlberg 2004
12  *
13  * $Id$
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
32  */
33
34 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
37
38 #include <glib.h>
39 #include <epan/packet.h>
40 #include <epan/conversation.h>
41
42 #include <stdio.h>
43 #include <string.h>
44
45 #include "packet-ber.h"
46 #include "packet-x509af.h"
47 #include "packet-x509ce.h"
48 #include "packet-x509if.h"
49 #include "packet-x509sat.h"
50 #include "packet-ldap.h"
51
52 #define PNAME  "X.509 Authentication Framework"
53 #define PSNAME "X509AF"
54 #define PFNAME "x509af"
55
56 /* Initialize the protocol and registered fields */
57 static int proto_x509af = -1;
58 static int hf_x509af_algorithm_id = -1;
59 static int hf_x509af_extension_id = -1;
60
61 /*--- Included file: packet-x509af-hf.c ---*/
62 #line 1 "packet-x509af-hf.c"
63 static int hf_x509af_Certificate_PDU = -1;        /* Certificate */
64 static int hf_x509af_CertificatePair_PDU = -1;    /* CertificatePair */
65 static int hf_x509af_CertificateList_PDU = -1;    /* CertificateList */
66 static int hf_x509af_AttributeCertificate_PDU = -1;  /* AttributeCertificate */
67 static int hf_x509af_DSS_Params_PDU = -1;         /* DSS_Params */
68 static int hf_x509af_signedCertificate = -1;      /* T_signedCertificate */
69 static int hf_x509af_version = -1;                /* Version */
70 static int hf_x509af_serialNumber = -1;           /* CertificateSerialNumber */
71 static int hf_x509af_signature = -1;              /* AlgorithmIdentifier */
72 static int hf_x509af_issuer = -1;                 /* Name */
73 static int hf_x509af_validity = -1;               /* Validity */
74 static int hf_x509af_subject = -1;                /* SubjectName */
75 static int hf_x509af_subjectPublicKeyInfo = -1;   /* SubjectPublicKeyInfo */
76 static int hf_x509af_issuerUniqueIdentifier = -1;  /* UniqueIdentifier */
77 static int hf_x509af_subjectUniqueIdentifier = -1;  /* UniqueIdentifier */
78 static int hf_x509af_extensions = -1;             /* Extensions */
79 static int hf_x509af_algorithmIdentifier = -1;    /* AlgorithmIdentifier */
80 static int hf_x509af_encrypted = -1;              /* BIT_STRING */
81 static int hf_x509af_rdnSequence = -1;            /* RDNSequence */
82 static int hf_x509af_algorithmId = -1;            /* T_algorithmId */
83 static int hf_x509af_parameters = -1;             /* T_parameters */
84 static int hf_x509af_notBefore = -1;              /* Time */
85 static int hf_x509af_notAfter = -1;               /* Time */
86 static int hf_x509af_algorithm = -1;              /* AlgorithmIdentifier */
87 static int hf_x509af_subjectPublicKey = -1;       /* BIT_STRING */
88 static int hf_x509af_utcTime = -1;                /* UTCTime */
89 static int hf_x509af_generalizedTime = -1;        /* GeneralizedTime */
90 static int hf_x509af_Extensions_item = -1;        /* Extension */
91 static int hf_x509af_extnId = -1;                 /* T_extnId */
92 static int hf_x509af_critical = -1;               /* BOOLEAN */
93 static int hf_x509af_extnValue = -1;              /* T_extnValue */
94 static int hf_x509af_userCertificate = -1;        /* Certificate */
95 static int hf_x509af_certificationPath = -1;      /* ForwardCertificationPath */
96 static int hf_x509af_ForwardCertificationPath_item = -1;  /* CrossCertificates */
97 static int hf_x509af_CrossCertificates_item = -1;  /* Certificate */
98 static int hf_x509af_theCACertificates = -1;      /* SEQUENCE_OF_CertificatePair */
99 static int hf_x509af_theCACertificates_item = -1;  /* CertificatePair */
100 static int hf_x509af_issuedByThisCA = -1;         /* Certificate */
101 static int hf_x509af_issuedToThisCA = -1;         /* Certificate */
102 static int hf_x509af_signedCertificateList = -1;  /* T_signedCertificateList */
103 static int hf_x509af_thisUpdate = -1;             /* Time */
104 static int hf_x509af_nextUpdate = -1;             /* Time */
105 static int hf_x509af_revokedCertificates = -1;    /* T_revokedCertificates */
106 static int hf_x509af_revokedCertificates_item = -1;  /* T_revokedCertificates_item */
107 static int hf_x509af_revokedUserCertificate = -1;  /* CertificateSerialNumber */
108 static int hf_x509af_revocationDate = -1;         /* Time */
109 static int hf_x509af_crlEntryExtensions = -1;     /* Extensions */
110 static int hf_x509af_crlExtensions = -1;          /* Extensions */
111 static int hf_x509af_attributeCertificate = -1;   /* AttributeCertificate */
112 static int hf_x509af_acPath = -1;                 /* SEQUENCE_OF_ACPathData */
113 static int hf_x509af_acPath_item = -1;            /* ACPathData */
114 static int hf_x509af_certificate = -1;            /* Certificate */
115 static int hf_x509af_signedAttributeCertificateInfo = -1;  /* AttributeCertificateInfo */
116 static int hf_x509af_info_subject = -1;           /* InfoSubject */
117 static int hf_x509af_baseCertificateID = -1;      /* IssuerSerial */
118 static int hf_x509af_infoSubjectName = -1;        /* GeneralNames */
119 static int hf_x509af_issuerName = -1;             /* GeneralNames */
120 static int hf_x509af_attCertValidityPeriod = -1;  /* AttCertValidityPeriod */
121 static int hf_x509af_attributes = -1;             /* SEQUENCE_OF_Attribute */
122 static int hf_x509af_attributes_item = -1;        /* Attribute */
123 static int hf_x509af_issuerUniqueID = -1;         /* UniqueIdentifier */
124 static int hf_x509af_serial = -1;                 /* CertificateSerialNumber */
125 static int hf_x509af_issuerUID = -1;              /* UniqueIdentifier */
126 static int hf_x509af_notBeforeTime = -1;          /* GeneralizedTime */
127 static int hf_x509af_notAfterTime = -1;           /* GeneralizedTime */
128 static int hf_x509af_assertion_subject = -1;      /* AssertionSubject */
129 static int hf_x509af_assertionSubjectName = -1;   /* SubjectName */
130 static int hf_x509af_assertionIssuer = -1;        /* Name */
131 static int hf_x509af_attCertValidity = -1;        /* GeneralizedTime */
132 static int hf_x509af_attType = -1;                /* SET_OF_AttributeType */
133 static int hf_x509af_attType_item = -1;           /* AttributeType */
134 static int hf_x509af_p = -1;                      /* INTEGER */
135 static int hf_x509af_q = -1;                      /* INTEGER */
136 static int hf_x509af_g = -1;                      /* INTEGER */
137
138 /*--- End of included file: packet-x509af-hf.c ---*/
139 #line 53 "packet-x509af-template.c"
140
141 /* Initialize the subtree pointers */
142 static gint ett_pkix_crl = -1;
143
144 /*--- Included file: packet-x509af-ett.c ---*/
145 #line 1 "packet-x509af-ett.c"
146 static gint ett_x509af_Certificate = -1;
147 static gint ett_x509af_T_signedCertificate = -1;
148 static gint ett_x509af_SubjectName = -1;
149 static gint ett_x509af_AlgorithmIdentifier = -1;
150 static gint ett_x509af_Validity = -1;
151 static gint ett_x509af_SubjectPublicKeyInfo = -1;
152 static gint ett_x509af_Time = -1;
153 static gint ett_x509af_Extensions = -1;
154 static gint ett_x509af_Extension = -1;
155 static gint ett_x509af_Certificates = -1;
156 static gint ett_x509af_ForwardCertificationPath = -1;
157 static gint ett_x509af_CrossCertificates = -1;
158 static gint ett_x509af_CertificationPath = -1;
159 static gint ett_x509af_SEQUENCE_OF_CertificatePair = -1;
160 static gint ett_x509af_CertificatePair = -1;
161 static gint ett_x509af_CertificateList = -1;
162 static gint ett_x509af_T_signedCertificateList = -1;
163 static gint ett_x509af_T_revokedCertificates = -1;
164 static gint ett_x509af_T_revokedCertificates_item = -1;
165 static gint ett_x509af_AttributeCertificationPath = -1;
166 static gint ett_x509af_SEQUENCE_OF_ACPathData = -1;
167 static gint ett_x509af_ACPathData = -1;
168 static gint ett_x509af_AttributeCertificate = -1;
169 static gint ett_x509af_AttributeCertificateInfo = -1;
170 static gint ett_x509af_InfoSubject = -1;
171 static gint ett_x509af_SEQUENCE_OF_Attribute = -1;
172 static gint ett_x509af_IssuerSerial = -1;
173 static gint ett_x509af_AttCertValidityPeriod = -1;
174 static gint ett_x509af_AttributeCertificateAssertion = -1;
175 static gint ett_x509af_AssertionSubject = -1;
176 static gint ett_x509af_SET_OF_AttributeType = -1;
177 static gint ett_x509af_DSS_Params = -1;
178
179 /*--- End of included file: packet-x509af-ett.c ---*/
180 #line 57 "packet-x509af-template.c"
181
182 static const char *algorithm_id;
183 static const char *extension_id;
184
185
186 /*--- Included file: packet-x509af-fn.c ---*/
187 #line 1 "packet-x509af-fn.c"
188 /*--- Fields for imported types ---*/
189
190 static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
191   return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuer);
192 }
193 static int dissect_issuerUniqueIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
194   return dissect_x509sat_UniqueIdentifier(TRUE, tvb, offset, pinfo, tree, hf_x509af_issuerUniqueIdentifier);
195 }
196 static int dissect_subjectUniqueIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
197   return dissect_x509sat_UniqueIdentifier(TRUE, tvb, offset, pinfo, tree, hf_x509af_subjectUniqueIdentifier);
198 }
199 static int dissect_rdnSequence(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
200   return dissect_x509if_RDNSequence(FALSE, tvb, offset, pinfo, tree, hf_x509af_rdnSequence);
201 }
202 static int dissect_infoSubjectName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
203   return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_x509af_infoSubjectName);
204 }
205 static int dissect_issuerName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
206   return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuerName);
207 }
208 static int dissect_attributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
209   return dissect_x509if_Attribute(FALSE, tvb, offset, pinfo, tree, hf_x509af_attributes_item);
210 }
211 static int dissect_issuerUniqueID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
212   return dissect_x509sat_UniqueIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuerUniqueID);
213 }
214 static int dissect_issuerUID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
215   return dissect_x509sat_UniqueIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuerUID);
216 }
217 static int dissect_assertionIssuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
218   return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_x509af_assertionIssuer);
219 }
220 static int dissect_attType_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
221   return dissect_x509if_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509af_attType_item);
222 }
223
224
225 const value_string x509af_Version_vals[] = {
226   {   0, "v1" },
227   {   1, "v2" },
228   {   2, "v3" },
229   { 0, NULL }
230 };
231
232
233 int
234 dissect_x509af_Version(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
235   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
236                                   NULL);
237
238   return offset;
239 }
240 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
241   return dissect_x509af_Version(FALSE, tvb, offset, pinfo, tree, hf_x509af_version);
242 }
243
244
245
246 int
247 dissect_x509af_CertificateSerialNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
248   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
249                                   NULL);
250
251   return offset;
252 }
253 static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
254   return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_x509af_serialNumber);
255 }
256 static int dissect_revokedUserCertificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
257   return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_x509af_revokedUserCertificate);
258 }
259 static int dissect_serial(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
260   return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_x509af_serial);
261 }
262
263
264
265 static int
266 dissect_x509af_T_algorithmId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
267 #line 69 "x509af.cnf"
268   const char *name;
269
270     offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509af_algorithm_id, &algorithm_id);
271
272
273   if(algorithm_id) {
274     name = get_oid_str_name(algorithm_id);
275
276     proto_item_append_text(tree, " (%s)", name ? name : algorithm_id); 
277   }
278
279
280
281   return offset;
282 }
283 static int dissect_algorithmId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
284   return dissect_x509af_T_algorithmId(FALSE, tvb, offset, pinfo, tree, hf_x509af_algorithmId);
285 }
286
287
288
289 static int
290 dissect_x509af_T_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
291 #line 80 "x509af.cnf"
292   offset=call_ber_oid_callback(algorithm_id, tvb, offset, pinfo, tree);
293
294
295
296   return offset;
297 }
298 static int dissect_parameters(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
299   return dissect_x509af_T_parameters(FALSE, tvb, offset, pinfo, tree, hf_x509af_parameters);
300 }
301
302
303 static const ber_sequence_t AlgorithmIdentifier_sequence[] = {
304   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_algorithmId },
305   { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_parameters },
306   { 0, 0, 0, NULL }
307 };
308
309 int
310 dissect_x509af_AlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
311   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
312                                    AlgorithmIdentifier_sequence, hf_index, ett_x509af_AlgorithmIdentifier);
313
314   return offset;
315 }
316 static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
317   return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_signature);
318 }
319 static int dissect_algorithmIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
320   return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_algorithmIdentifier);
321 }
322 static int dissect_algorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
323   return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_algorithm);
324 }
325
326
327
328 static int
329 dissect_x509af_UTCTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
330   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTCTime,
331                                             pinfo, tree, tvb, offset, hf_index,
332                                             NULL);
333
334   return offset;
335 }
336 static int dissect_utcTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
337   return dissect_x509af_UTCTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_utcTime);
338 }
339
340
341
342 static int
343 dissect_x509af_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
344   offset = dissect_ber_GeneralizedTime(implicit_tag, pinfo, tree, tvb, offset, hf_index);
345
346   return offset;
347 }
348 static int dissect_generalizedTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
349   return dissect_x509af_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_generalizedTime);
350 }
351 static int dissect_notBeforeTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
352   return dissect_x509af_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_notBeforeTime);
353 }
354 static int dissect_notAfterTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
355   return dissect_x509af_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_notAfterTime);
356 }
357 static int dissect_attCertValidity(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
358   return dissect_x509af_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_attCertValidity);
359 }
360
361
362 const value_string x509af_Time_vals[] = {
363   {   0, "utcTime" },
364   {   1, "generalizedTime" },
365   { 0, NULL }
366 };
367
368 static const ber_choice_t Time_choice[] = {
369   {   0, BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_utcTime },
370   {   1, BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_generalizedTime },
371   { 0, 0, 0, 0, NULL }
372 };
373
374 int
375 dissect_x509af_Time(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
376   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
377                                  Time_choice, hf_index, ett_x509af_Time,
378                                  NULL);
379
380   return offset;
381 }
382 static int dissect_notBefore(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
383   return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_notBefore);
384 }
385 static int dissect_notAfter(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
386   return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_notAfter);
387 }
388 static int dissect_thisUpdate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
389   return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_thisUpdate);
390 }
391 static int dissect_nextUpdate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
392   return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_nextUpdate);
393 }
394 static int dissect_revocationDate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
395   return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_revocationDate);
396 }
397
398
399 static const ber_sequence_t Validity_sequence[] = {
400   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_notBefore },
401   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_notAfter },
402   { 0, 0, 0, NULL }
403 };
404
405 int
406 dissect_x509af_Validity(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
407   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
408                                    Validity_sequence, hf_index, ett_x509af_Validity);
409
410   return offset;
411 }
412 static int dissect_validity(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
413   return dissect_x509af_Validity(FALSE, tvb, offset, pinfo, tree, hf_x509af_validity);
414 }
415
416
417 static const value_string x509af_SubjectName_vals[] = {
418   {   0, "rdnSequence" },
419   { 0, NULL }
420 };
421
422 static const ber_choice_t SubjectName_choice[] = {
423   {   0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_rdnSequence },
424   { 0, 0, 0, 0, NULL }
425 };
426
427 static int
428 dissect_x509af_SubjectName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
429 #line 107 "x509af.cnf"
430
431   const char* str;
432     offset = dissect_ber_choice(pinfo, tree, tvb, offset,
433                                  SubjectName_choice, hf_index, ett_x509af_SubjectName,
434                                  NULL);
435
436
437   str = x509if_get_last_dn();
438   proto_item_append_text(proto_item_get_parent(tree), " (%s)", str?str:"");
439
440
441
442   return offset;
443 }
444 static int dissect_subject(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
445   return dissect_x509af_SubjectName(FALSE, tvb, offset, pinfo, tree, hf_x509af_subject);
446 }
447 static int dissect_assertionSubjectName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
448   return dissect_x509af_SubjectName(FALSE, tvb, offset, pinfo, tree, hf_x509af_assertionSubjectName);
449 }
450
451
452
453 static int
454 dissect_x509af_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
455   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
456                                     NULL, hf_index, -1,
457                                     NULL);
458
459   return offset;
460 }
461 static int dissect_encrypted(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
462   return dissect_x509af_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_x509af_encrypted);
463 }
464 static int dissect_subjectPublicKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
465   return dissect_x509af_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_x509af_subjectPublicKey);
466 }
467
468
469 static const ber_sequence_t SubjectPublicKeyInfo_sequence[] = {
470   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithm },
471   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_subjectPublicKey },
472   { 0, 0, 0, NULL }
473 };
474
475 int
476 dissect_x509af_SubjectPublicKeyInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
477   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
478                                    SubjectPublicKeyInfo_sequence, hf_index, ett_x509af_SubjectPublicKeyInfo);
479
480   return offset;
481 }
482 static int dissect_subjectPublicKeyInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
483   return dissect_x509af_SubjectPublicKeyInfo(FALSE, tvb, offset, pinfo, tree, hf_x509af_subjectPublicKeyInfo);
484 }
485
486
487
488 static int
489 dissect_x509af_T_extnId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
490 #line 86 "x509af.cnf"
491   const char *name;
492
493     offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509af_extension_id, &extension_id);
494
495
496   if(extension_id) {
497     name = get_oid_str_name(extension_id);
498
499     proto_item_append_text(tree, " (%s)", name ? name : extension_id);
500   }
501
502
503
504   return offset;
505 }
506 static int dissect_extnId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
507   return dissect_x509af_T_extnId(FALSE, tvb, offset, pinfo, tree, hf_x509af_extnId);
508 }
509
510
511
512 static int
513 dissect_x509af_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
514   offset = dissect_ber_boolean(implicit_tag, pinfo, tree, tvb, offset, hf_index);
515
516   return offset;
517 }
518 static int dissect_critical(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
519   return dissect_x509af_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_x509af_critical);
520 }
521
522
523
524 static int
525 dissect_x509af_T_extnValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
526 #line 97 "x509af.cnf"
527   gint8 class;
528   gboolean pc, ind;
529   gint32 tag;
530   guint32 len;
531   /* skip past the T and L  */
532   offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
533   offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind);
534   offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree);
535
536
537
538   return offset;
539 }
540 static int dissect_extnValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
541   return dissect_x509af_T_extnValue(FALSE, tvb, offset, pinfo, tree, hf_x509af_extnValue);
542 }
543
544
545 static const ber_sequence_t Extension_sequence[] = {
546   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_extnId },
547   { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_critical },
548   { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_extnValue },
549   { 0, 0, 0, NULL }
550 };
551
552 int
553 dissect_x509af_Extension(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
554   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
555                                    Extension_sequence, hf_index, ett_x509af_Extension);
556
557   return offset;
558 }
559 static int dissect_Extensions_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
560   return dissect_x509af_Extension(FALSE, tvb, offset, pinfo, tree, hf_x509af_Extensions_item);
561 }
562
563
564 static const ber_sequence_t Extensions_sequence_of[1] = {
565   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Extensions_item },
566 };
567
568 int
569 dissect_x509af_Extensions(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
570   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
571                                       Extensions_sequence_of, hf_index, ett_x509af_Extensions);
572
573   return offset;
574 }
575 static int dissect_extensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
576   return dissect_x509af_Extensions(FALSE, tvb, offset, pinfo, tree, hf_x509af_extensions);
577 }
578 static int dissect_crlEntryExtensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
579   return dissect_x509af_Extensions(FALSE, tvb, offset, pinfo, tree, hf_x509af_crlEntryExtensions);
580 }
581 static int dissect_crlExtensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
582   return dissect_x509af_Extensions(FALSE, tvb, offset, pinfo, tree, hf_x509af_crlExtensions);
583 }
584
585
586 static const ber_sequence_t T_signedCertificate_sequence[] = {
587   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_version },
588   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
589   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature },
590   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
591   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_validity },
592   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_subject },
593   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_subjectPublicKeyInfo },
594   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_issuerUniqueIdentifier_impl },
595   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_subjectUniqueIdentifier_impl },
596   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL, dissect_extensions },
597   { 0, 0, 0, NULL }
598 };
599
600 static int
601 dissect_x509af_T_signedCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
602   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
603                                    T_signedCertificate_sequence, hf_index, ett_x509af_T_signedCertificate);
604
605   return offset;
606 }
607 static int dissect_signedCertificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
608   return dissect_x509af_T_signedCertificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_signedCertificate);
609 }
610
611
612 static const ber_sequence_t Certificate_sequence[] = {
613   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signedCertificate },
614   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithmIdentifier },
615   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_encrypted },
616   { 0, 0, 0, NULL }
617 };
618
619 int
620 dissect_x509af_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
621   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
622                                    Certificate_sequence, hf_index, ett_x509af_Certificate);
623
624   return offset;
625 }
626 static int dissect_userCertificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
627   return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_userCertificate);
628 }
629 static int dissect_CrossCertificates_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
630   return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_CrossCertificates_item);
631 }
632 static int dissect_issuedByThisCA(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
633   return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuedByThisCA);
634 }
635 static int dissect_issuedToThisCA(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
636   return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuedToThisCA);
637 }
638 static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
639   return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_certificate);
640 }
641
642
643 static const ber_sequence_t CrossCertificates_set_of[1] = {
644   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_CrossCertificates_item },
645 };
646
647 int
648 dissect_x509af_CrossCertificates(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
649   offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
650                                  CrossCertificates_set_of, hf_index, ett_x509af_CrossCertificates);
651
652   return offset;
653 }
654 static int dissect_ForwardCertificationPath_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
655   return dissect_x509af_CrossCertificates(FALSE, tvb, offset, pinfo, tree, hf_x509af_ForwardCertificationPath_item);
656 }
657
658
659 static const ber_sequence_t ForwardCertificationPath_sequence_of[1] = {
660   { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ForwardCertificationPath_item },
661 };
662
663 int
664 dissect_x509af_ForwardCertificationPath(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
665   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
666                                       ForwardCertificationPath_sequence_of, hf_index, ett_x509af_ForwardCertificationPath);
667
668   return offset;
669 }
670 static int dissect_certificationPath(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
671   return dissect_x509af_ForwardCertificationPath(FALSE, tvb, offset, pinfo, tree, hf_x509af_certificationPath);
672 }
673
674
675 static const ber_sequence_t Certificates_sequence[] = {
676   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_userCertificate },
677   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_certificationPath },
678   { 0, 0, 0, NULL }
679 };
680
681 int
682 dissect_x509af_Certificates(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
683   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
684                                    Certificates_sequence, hf_index, ett_x509af_Certificates);
685
686   return offset;
687 }
688
689
690 static const ber_sequence_t CertificatePair_sequence[] = {
691   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_issuedByThisCA },
692   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_issuedToThisCA },
693   { 0, 0, 0, NULL }
694 };
695
696 int
697 dissect_x509af_CertificatePair(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
698   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
699                                    CertificatePair_sequence, hf_index, ett_x509af_CertificatePair);
700
701   return offset;
702 }
703 static int dissect_theCACertificates_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
704   return dissect_x509af_CertificatePair(FALSE, tvb, offset, pinfo, tree, hf_x509af_theCACertificates_item);
705 }
706
707
708 static const ber_sequence_t SEQUENCE_OF_CertificatePair_sequence_of[1] = {
709   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_theCACertificates_item },
710 };
711
712 static int
713 dissect_x509af_SEQUENCE_OF_CertificatePair(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
714   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
715                                       SEQUENCE_OF_CertificatePair_sequence_of, hf_index, ett_x509af_SEQUENCE_OF_CertificatePair);
716
717   return offset;
718 }
719 static int dissect_theCACertificates(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
720   return dissect_x509af_SEQUENCE_OF_CertificatePair(FALSE, tvb, offset, pinfo, tree, hf_x509af_theCACertificates);
721 }
722
723
724 static const ber_sequence_t CertificationPath_sequence[] = {
725   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_userCertificate },
726   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_theCACertificates },
727   { 0, 0, 0, NULL }
728 };
729
730 int
731 dissect_x509af_CertificationPath(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
732   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
733                                    CertificationPath_sequence, hf_index, ett_x509af_CertificationPath);
734
735   return offset;
736 }
737
738
739 static const ber_sequence_t T_revokedCertificates_item_sequence[] = {
740   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_revokedUserCertificate },
741   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_revocationDate },
742   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_crlEntryExtensions },
743   { 0, 0, 0, NULL }
744 };
745
746 static int
747 dissect_x509af_T_revokedCertificates_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
748   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
749                                    T_revokedCertificates_item_sequence, hf_index, ett_x509af_T_revokedCertificates_item);
750
751   return offset;
752 }
753 static int dissect_revokedCertificates_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
754   return dissect_x509af_T_revokedCertificates_item(FALSE, tvb, offset, pinfo, tree, hf_x509af_revokedCertificates_item);
755 }
756
757
758 static const ber_sequence_t T_revokedCertificates_sequence_of[1] = {
759   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_revokedCertificates_item },
760 };
761
762 static int
763 dissect_x509af_T_revokedCertificates(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
764   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
765                                       T_revokedCertificates_sequence_of, hf_index, ett_x509af_T_revokedCertificates);
766
767   return offset;
768 }
769 static int dissect_revokedCertificates(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
770   return dissect_x509af_T_revokedCertificates(FALSE, tvb, offset, pinfo, tree, hf_x509af_revokedCertificates);
771 }
772
773
774 static const ber_sequence_t T_signedCertificateList_sequence[] = {
775   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_version },
776   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature },
777   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
778   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_thisUpdate },
779   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_nextUpdate },
780   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_revokedCertificates },
781   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_crlExtensions },
782   { 0, 0, 0, NULL }
783 };
784
785 static int
786 dissect_x509af_T_signedCertificateList(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
787   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
788                                    T_signedCertificateList_sequence, hf_index, ett_x509af_T_signedCertificateList);
789
790   return offset;
791 }
792 static int dissect_signedCertificateList(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
793   return dissect_x509af_T_signedCertificateList(FALSE, tvb, offset, pinfo, tree, hf_x509af_signedCertificateList);
794 }
795
796
797 static const ber_sequence_t CertificateList_sequence[] = {
798   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signedCertificateList },
799   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithmIdentifier },
800   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_encrypted },
801   { 0, 0, 0, NULL }
802 };
803
804 int
805 dissect_x509af_CertificateList(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
806   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
807                                    CertificateList_sequence, hf_index, ett_x509af_CertificateList);
808
809   return offset;
810 }
811
812
813 static const ber_sequence_t IssuerSerial_sequence[] = {
814   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerName },
815   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serial },
816   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuerUID },
817   { 0, 0, 0, NULL }
818 };
819
820 int
821 dissect_x509af_IssuerSerial(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
822   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
823                                    IssuerSerial_sequence, hf_index, ett_x509af_IssuerSerial);
824
825   return offset;
826 }
827 static int dissect_baseCertificateID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
828   return dissect_x509af_IssuerSerial(FALSE, tvb, offset, pinfo, tree, hf_x509af_baseCertificateID);
829 }
830
831
832 static const value_string x509af_InfoSubject_vals[] = {
833   {   0, "baseCertificateID" },
834   {   1, "subjectName" },
835   { 0, NULL }
836 };
837
838 static const ber_choice_t InfoSubject_choice[] = {
839   {   0, BER_CLASS_CON, 0, 0, dissect_baseCertificateID },
840   {   1, BER_CLASS_CON, 1, 0, dissect_infoSubjectName },
841   { 0, 0, 0, 0, NULL }
842 };
843
844 static int
845 dissect_x509af_InfoSubject(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
846   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
847                                  InfoSubject_choice, hf_index, ett_x509af_InfoSubject,
848                                  NULL);
849
850   return offset;
851 }
852 static int dissect_info_subject(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
853   return dissect_x509af_InfoSubject(FALSE, tvb, offset, pinfo, tree, hf_x509af_info_subject);
854 }
855
856
857 static const ber_sequence_t AttCertValidityPeriod_sequence[] = {
858   { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_notBeforeTime },
859   { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_notAfterTime },
860   { 0, 0, 0, NULL }
861 };
862
863 int
864 dissect_x509af_AttCertValidityPeriod(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
865   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
866                                    AttCertValidityPeriod_sequence, hf_index, ett_x509af_AttCertValidityPeriod);
867
868   return offset;
869 }
870 static int dissect_attCertValidityPeriod(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
871   return dissect_x509af_AttCertValidityPeriod(FALSE, tvb, offset, pinfo, tree, hf_x509af_attCertValidityPeriod);
872 }
873
874
875 static const ber_sequence_t SEQUENCE_OF_Attribute_sequence_of[1] = {
876   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_attributes_item },
877 };
878
879 static int
880 dissect_x509af_SEQUENCE_OF_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
881   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
882                                       SEQUENCE_OF_Attribute_sequence_of, hf_index, ett_x509af_SEQUENCE_OF_Attribute);
883
884   return offset;
885 }
886 static int dissect_attributes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
887   return dissect_x509af_SEQUENCE_OF_Attribute(FALSE, tvb, offset, pinfo, tree, hf_x509af_attributes);
888 }
889
890
891 static const ber_sequence_t AttributeCertificateInfo_sequence[] = {
892   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_version },
893   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_info_subject },
894   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerName },
895   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature },
896   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
897   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_attCertValidityPeriod },
898   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_attributes },
899   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuerUniqueID },
900   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_extensions },
901   { 0, 0, 0, NULL }
902 };
903
904 int
905 dissect_x509af_AttributeCertificateInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
906   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
907                                    AttributeCertificateInfo_sequence, hf_index, ett_x509af_AttributeCertificateInfo);
908
909   return offset;
910 }
911 static int dissect_signedAttributeCertificateInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
912   return dissect_x509af_AttributeCertificateInfo(FALSE, tvb, offset, pinfo, tree, hf_x509af_signedAttributeCertificateInfo);
913 }
914
915
916 static const ber_sequence_t AttributeCertificate_sequence[] = {
917   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signedAttributeCertificateInfo },
918   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithmIdentifier },
919   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_encrypted },
920   { 0, 0, 0, NULL }
921 };
922
923 int
924 dissect_x509af_AttributeCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
925   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
926                                    AttributeCertificate_sequence, hf_index, ett_x509af_AttributeCertificate);
927
928   return offset;
929 }
930 static int dissect_attributeCertificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
931   return dissect_x509af_AttributeCertificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_attributeCertificate);
932 }
933
934
935 static const ber_sequence_t ACPathData_sequence[] = {
936   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_certificate },
937   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_attributeCertificate },
938   { 0, 0, 0, NULL }
939 };
940
941 int
942 dissect_x509af_ACPathData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
943   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
944                                    ACPathData_sequence, hf_index, ett_x509af_ACPathData);
945
946   return offset;
947 }
948 static int dissect_acPath_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
949   return dissect_x509af_ACPathData(FALSE, tvb, offset, pinfo, tree, hf_x509af_acPath_item);
950 }
951
952
953 static const ber_sequence_t SEQUENCE_OF_ACPathData_sequence_of[1] = {
954   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_acPath_item },
955 };
956
957 static int
958 dissect_x509af_SEQUENCE_OF_ACPathData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
959   offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
960                                       SEQUENCE_OF_ACPathData_sequence_of, hf_index, ett_x509af_SEQUENCE_OF_ACPathData);
961
962   return offset;
963 }
964 static int dissect_acPath(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
965   return dissect_x509af_SEQUENCE_OF_ACPathData(FALSE, tvb, offset, pinfo, tree, hf_x509af_acPath);
966 }
967
968
969 static const ber_sequence_t AttributeCertificationPath_sequence[] = {
970   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_attributeCertificate },
971   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_acPath },
972   { 0, 0, 0, NULL }
973 };
974
975 int
976 dissect_x509af_AttributeCertificationPath(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
977   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
978                                    AttributeCertificationPath_sequence, hf_index, ett_x509af_AttributeCertificationPath);
979
980   return offset;
981 }
982
983
984 static const value_string x509af_AssertionSubject_vals[] = {
985   {   0, "baseCertificateID" },
986   {   1, "subjectName" },
987   { 0, NULL }
988 };
989
990 static const ber_choice_t AssertionSubject_choice[] = {
991   {   0, BER_CLASS_CON, 0, 0, dissect_baseCertificateID },
992   {   1, BER_CLASS_CON, 1, 0, dissect_assertionSubjectName },
993   { 0, 0, 0, 0, NULL }
994 };
995
996 static int
997 dissect_x509af_AssertionSubject(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
998   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
999                                  AssertionSubject_choice, hf_index, ett_x509af_AssertionSubject,
1000                                  NULL);
1001
1002   return offset;
1003 }
1004 static int dissect_assertion_subject(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1005   return dissect_x509af_AssertionSubject(FALSE, tvb, offset, pinfo, tree, hf_x509af_assertion_subject);
1006 }
1007
1008
1009 static const ber_sequence_t SET_OF_AttributeType_set_of[1] = {
1010   { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_attType_item },
1011 };
1012
1013 static int
1014 dissect_x509af_SET_OF_AttributeType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1015   offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1016                                  SET_OF_AttributeType_set_of, hf_index, ett_x509af_SET_OF_AttributeType);
1017
1018   return offset;
1019 }
1020 static int dissect_attType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1021   return dissect_x509af_SET_OF_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509af_attType);
1022 }
1023
1024
1025 static const ber_sequence_t AttributeCertificateAssertion_sequence[] = {
1026   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_assertion_subject },
1027   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_assertionIssuer },
1028   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_attCertValidity },
1029   { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL, dissect_attType },
1030   { 0, 0, 0, NULL }
1031 };
1032
1033 int
1034 dissect_x509af_AttributeCertificateAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1035   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1036                                    AttributeCertificateAssertion_sequence, hf_index, ett_x509af_AttributeCertificateAssertion);
1037
1038   return offset;
1039 }
1040
1041
1042
1043 static int
1044 dissect_x509af_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1045   offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1046                                   NULL);
1047
1048   return offset;
1049 }
1050 static int dissect_p(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1051   return dissect_x509af_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_x509af_p);
1052 }
1053 static int dissect_q(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1054   return dissect_x509af_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_x509af_q);
1055 }
1056 static int dissect_g(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1057   return dissect_x509af_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_x509af_g);
1058 }
1059
1060
1061 static const ber_sequence_t DSS_Params_sequence[] = {
1062   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_p },
1063   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_q },
1064   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_g },
1065   { 0, 0, 0, NULL }
1066 };
1067
1068 static int
1069 dissect_x509af_DSS_Params(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1070   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1071                                    DSS_Params_sequence, hf_index, ett_x509af_DSS_Params);
1072
1073   return offset;
1074 }
1075
1076 /*--- PDUs ---*/
1077
1078 static void dissect_Certificate_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1079   dissect_x509af_Certificate(FALSE, tvb, 0, pinfo, tree, hf_x509af_Certificate_PDU);
1080 }
1081 static void dissect_CertificatePair_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1082   dissect_x509af_CertificatePair(FALSE, tvb, 0, pinfo, tree, hf_x509af_CertificatePair_PDU);
1083 }
1084 static void dissect_CertificateList_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1085   dissect_x509af_CertificateList(FALSE, tvb, 0, pinfo, tree, hf_x509af_CertificateList_PDU);
1086 }
1087 static void dissect_AttributeCertificate_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1088   dissect_x509af_AttributeCertificate(FALSE, tvb, 0, pinfo, tree, hf_x509af_AttributeCertificate_PDU);
1089 }
1090 static void dissect_DSS_Params_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1091   dissect_x509af_DSS_Params(FALSE, tvb, 0, pinfo, tree, hf_x509af_DSS_Params_PDU);
1092 }
1093
1094
1095 /*--- End of included file: packet-x509af-fn.c ---*/
1096 #line 62 "packet-x509af-template.c"
1097
1098 const char *x509af_get_last_algorithm_id(void) {
1099   return algorithm_id;
1100 }
1101
1102
1103 static int
1104 dissect_pkix_crl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
1105 {
1106         proto_item *item=NULL;
1107         proto_tree *tree=NULL;
1108
1109         if (check_col(pinfo->cinfo, COL_PROTOCOL)) 
1110                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIX-CRL");
1111
1112         if (check_col(pinfo->cinfo, COL_INFO)) {
1113                 col_clear(pinfo->cinfo, COL_INFO);
1114                 
1115                 col_add_fstr(pinfo->cinfo, COL_INFO, "Certificate Revocation List");
1116         }
1117
1118
1119         if(parent_tree){
1120                 item=proto_tree_add_text(parent_tree, tvb, 0, -1, "Certificate Revocation List");
1121                 tree = proto_item_add_subtree(item, ett_pkix_crl);
1122         }
1123
1124         return dissect_x509af_CertificateList(FALSE, tvb, 0, pinfo, tree, -1);
1125 }
1126
1127 /*--- proto_register_x509af ----------------------------------------------*/
1128 void proto_register_x509af(void) {
1129
1130   /* List of fields */
1131   static hf_register_info hf[] = {
1132     { &hf_x509af_algorithm_id,
1133       { "Algorithm Id", "x509af.algorithm.id",
1134         FT_OID, BASE_NONE, NULL, 0,
1135         "Algorithm Id", HFILL }},
1136     { &hf_x509af_extension_id,
1137       { "Extension Id", "x509af.extension.id",
1138         FT_OID, BASE_NONE, NULL, 0,
1139         "Extension Id", HFILL }},
1140
1141 /*--- Included file: packet-x509af-hfarr.c ---*/
1142 #line 1 "packet-x509af-hfarr.c"
1143     { &hf_x509af_Certificate_PDU,
1144       { "Certificate", "x509af.Certificate",
1145         FT_NONE, BASE_NONE, NULL, 0,
1146         "Certificate", HFILL }},
1147     { &hf_x509af_CertificatePair_PDU,
1148       { "CertificatePair", "x509af.CertificatePair",
1149         FT_NONE, BASE_NONE, NULL, 0,
1150         "CertificatePair", HFILL }},
1151     { &hf_x509af_CertificateList_PDU,
1152       { "CertificateList", "x509af.CertificateList",
1153         FT_NONE, BASE_NONE, NULL, 0,
1154         "CertificateList", HFILL }},
1155     { &hf_x509af_AttributeCertificate_PDU,
1156       { "AttributeCertificate", "x509af.AttributeCertificate",
1157         FT_NONE, BASE_NONE, NULL, 0,
1158         "AttributeCertificate", HFILL }},
1159     { &hf_x509af_DSS_Params_PDU,
1160       { "DSS-Params", "x509af.DSS_Params",
1161         FT_NONE, BASE_NONE, NULL, 0,
1162         "DSS-Params", HFILL }},
1163     { &hf_x509af_signedCertificate,
1164       { "signedCertificate", "x509af.signedCertificate",
1165         FT_NONE, BASE_NONE, NULL, 0,
1166         "Certificate/signedCertificate", HFILL }},
1167     { &hf_x509af_version,
1168       { "version", "x509af.version",
1169         FT_INT32, BASE_DEC, VALS(x509af_Version_vals), 0,
1170         "", HFILL }},
1171     { &hf_x509af_serialNumber,
1172       { "serialNumber", "x509af.serialNumber",
1173         FT_INT32, BASE_DEC, NULL, 0,
1174         "", HFILL }},
1175     { &hf_x509af_signature,
1176       { "signature", "x509af.signature",
1177         FT_NONE, BASE_NONE, NULL, 0,
1178         "", HFILL }},
1179     { &hf_x509af_issuer,
1180       { "issuer", "x509af.issuer",
1181         FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0,
1182         "", HFILL }},
1183     { &hf_x509af_validity,
1184       { "validity", "x509af.validity",
1185         FT_NONE, BASE_NONE, NULL, 0,
1186         "Certificate/signedCertificate/validity", HFILL }},
1187     { &hf_x509af_subject,
1188       { "subject", "x509af.subject",
1189         FT_UINT32, BASE_DEC, VALS(x509af_SubjectName_vals), 0,
1190         "Certificate/signedCertificate/subject", HFILL }},
1191     { &hf_x509af_subjectPublicKeyInfo,
1192       { "subjectPublicKeyInfo", "x509af.subjectPublicKeyInfo",
1193         FT_NONE, BASE_NONE, NULL, 0,
1194         "Certificate/signedCertificate/subjectPublicKeyInfo", HFILL }},
1195     { &hf_x509af_issuerUniqueIdentifier,
1196       { "issuerUniqueIdentifier", "x509af.issuerUniqueIdentifier",
1197         FT_BYTES, BASE_HEX, NULL, 0,
1198         "Certificate/signedCertificate/issuerUniqueIdentifier", HFILL }},
1199     { &hf_x509af_subjectUniqueIdentifier,
1200       { "subjectUniqueIdentifier", "x509af.subjectUniqueIdentifier",
1201         FT_BYTES, BASE_HEX, NULL, 0,
1202         "Certificate/signedCertificate/subjectUniqueIdentifier", HFILL }},
1203     { &hf_x509af_extensions,
1204       { "extensions", "x509af.extensions",
1205         FT_UINT32, BASE_DEC, NULL, 0,
1206         "", HFILL }},
1207     { &hf_x509af_algorithmIdentifier,
1208       { "algorithmIdentifier", "x509af.algorithmIdentifier",
1209         FT_NONE, BASE_NONE, NULL, 0,
1210         "", HFILL }},
1211     { &hf_x509af_encrypted,
1212       { "encrypted", "x509af.encrypted",
1213         FT_BYTES, BASE_HEX, NULL, 0,
1214         "", HFILL }},
1215     { &hf_x509af_rdnSequence,
1216       { "rdnSequence", "x509af.rdnSequence",
1217         FT_UINT32, BASE_DEC, NULL, 0,
1218         "SubjectName/rdnSequence", HFILL }},
1219     { &hf_x509af_algorithmId,
1220       { "algorithmId", "x509af.algorithmId",
1221         FT_OID, BASE_NONE, NULL, 0,
1222         "AlgorithmIdentifier/algorithmId", HFILL }},
1223     { &hf_x509af_parameters,
1224       { "parameters", "x509af.parameters",
1225         FT_NONE, BASE_NONE, NULL, 0,
1226         "AlgorithmIdentifier/parameters", HFILL }},
1227     { &hf_x509af_notBefore,
1228       { "notBefore", "x509af.notBefore",
1229         FT_UINT32, BASE_DEC, VALS(x509af_Time_vals), 0,
1230         "Validity/notBefore", HFILL }},
1231     { &hf_x509af_notAfter,
1232       { "notAfter", "x509af.notAfter",
1233         FT_UINT32, BASE_DEC, VALS(x509af_Time_vals), 0,
1234         "Validity/notAfter", HFILL }},
1235     { &hf_x509af_algorithm,
1236       { "algorithm", "x509af.algorithm",
1237         FT_NONE, BASE_NONE, NULL, 0,
1238         "SubjectPublicKeyInfo/algorithm", HFILL }},
1239     { &hf_x509af_subjectPublicKey,
1240       { "subjectPublicKey", "x509af.subjectPublicKey",
1241         FT_BYTES, BASE_HEX, NULL, 0,
1242         "SubjectPublicKeyInfo/subjectPublicKey", HFILL }},
1243     { &hf_x509af_utcTime,
1244       { "utcTime", "x509af.utcTime",
1245         FT_STRING, BASE_NONE, NULL, 0,
1246         "Time/utcTime", HFILL }},
1247     { &hf_x509af_generalizedTime,
1248       { "generalizedTime", "x509af.generalizedTime",
1249         FT_STRING, BASE_NONE, NULL, 0,
1250         "Time/generalizedTime", HFILL }},
1251     { &hf_x509af_Extensions_item,
1252       { "Item", "x509af.Extensions_item",
1253         FT_NONE, BASE_NONE, NULL, 0,
1254         "Extensions/_item", HFILL }},
1255     { &hf_x509af_extnId,
1256       { "extnId", "x509af.extnId",
1257         FT_OID, BASE_NONE, NULL, 0,
1258         "Extension/extnId", HFILL }},
1259     { &hf_x509af_critical,
1260       { "critical", "x509af.critical",
1261         FT_BOOLEAN, 8, NULL, 0,
1262         "Extension/critical", HFILL }},
1263     { &hf_x509af_extnValue,
1264       { "extnValue", "x509af.extnValue",
1265         FT_BYTES, BASE_HEX, NULL, 0,
1266         "Extension/extnValue", HFILL }},
1267     { &hf_x509af_userCertificate,
1268       { "userCertificate", "x509af.userCertificate",
1269         FT_NONE, BASE_NONE, NULL, 0,
1270         "", HFILL }},
1271     { &hf_x509af_certificationPath,
1272       { "certificationPath", "x509af.certificationPath",
1273         FT_UINT32, BASE_DEC, NULL, 0,
1274         "Certificates/certificationPath", HFILL }},
1275     { &hf_x509af_ForwardCertificationPath_item,
1276       { "Item", "x509af.ForwardCertificationPath_item",
1277         FT_UINT32, BASE_DEC, NULL, 0,
1278         "ForwardCertificationPath/_item", HFILL }},
1279     { &hf_x509af_CrossCertificates_item,
1280       { "Item", "x509af.CrossCertificates_item",
1281         FT_NONE, BASE_NONE, NULL, 0,
1282         "CrossCertificates/_item", HFILL }},
1283     { &hf_x509af_theCACertificates,
1284       { "theCACertificates", "x509af.theCACertificates",
1285         FT_UINT32, BASE_DEC, NULL, 0,
1286         "CertificationPath/theCACertificates", HFILL }},
1287     { &hf_x509af_theCACertificates_item,
1288       { "Item", "x509af.theCACertificates_item",
1289         FT_NONE, BASE_NONE, NULL, 0,
1290         "CertificationPath/theCACertificates/_item", HFILL }},
1291     { &hf_x509af_issuedByThisCA,
1292       { "issuedByThisCA", "x509af.issuedByThisCA",
1293         FT_NONE, BASE_NONE, NULL, 0,
1294         "CertificatePair/issuedByThisCA", HFILL }},
1295     { &hf_x509af_issuedToThisCA,
1296       { "issuedToThisCA", "x509af.issuedToThisCA",
1297         FT_NONE, BASE_NONE, NULL, 0,
1298         "CertificatePair/issuedToThisCA", HFILL }},
1299     { &hf_x509af_signedCertificateList,
1300       { "signedCertificateList", "x509af.signedCertificateList",
1301         FT_NONE, BASE_NONE, NULL, 0,
1302         "CertificateList/signedCertificateList", HFILL }},
1303     { &hf_x509af_thisUpdate,
1304       { "thisUpdate", "x509af.thisUpdate",
1305         FT_UINT32, BASE_DEC, VALS(x509af_Time_vals), 0,
1306         "CertificateList/signedCertificateList/thisUpdate", HFILL }},
1307     { &hf_x509af_nextUpdate,
1308       { "nextUpdate", "x509af.nextUpdate",
1309         FT_UINT32, BASE_DEC, VALS(x509af_Time_vals), 0,
1310         "CertificateList/signedCertificateList/nextUpdate", HFILL }},
1311     { &hf_x509af_revokedCertificates,
1312       { "revokedCertificates", "x509af.revokedCertificates",
1313         FT_UINT32, BASE_DEC, NULL, 0,
1314         "CertificateList/signedCertificateList/revokedCertificates", HFILL }},
1315     { &hf_x509af_revokedCertificates_item,
1316       { "Item", "x509af.revokedCertificates_item",
1317         FT_NONE, BASE_NONE, NULL, 0,
1318         "CertificateList/signedCertificateList/revokedCertificates/_item", HFILL }},
1319     { &hf_x509af_revokedUserCertificate,
1320       { "userCertificate", "x509af.userCertificate",
1321         FT_INT32, BASE_DEC, NULL, 0,
1322         "CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate", HFILL }},
1323     { &hf_x509af_revocationDate,
1324       { "revocationDate", "x509af.revocationDate",
1325         FT_UINT32, BASE_DEC, VALS(x509af_Time_vals), 0,
1326         "CertificateList/signedCertificateList/revokedCertificates/_item/revocationDate", HFILL }},
1327     { &hf_x509af_crlEntryExtensions,
1328       { "crlEntryExtensions", "x509af.crlEntryExtensions",
1329         FT_UINT32, BASE_DEC, NULL, 0,
1330         "CertificateList/signedCertificateList/revokedCertificates/_item/crlEntryExtensions", HFILL }},
1331     { &hf_x509af_crlExtensions,
1332       { "crlExtensions", "x509af.crlExtensions",
1333         FT_UINT32, BASE_DEC, NULL, 0,
1334         "CertificateList/signedCertificateList/crlExtensions", HFILL }},
1335     { &hf_x509af_attributeCertificate,
1336       { "attributeCertificate", "x509af.attributeCertificate",
1337         FT_NONE, BASE_NONE, NULL, 0,
1338         "", HFILL }},
1339     { &hf_x509af_acPath,
1340       { "acPath", "x509af.acPath",
1341         FT_UINT32, BASE_DEC, NULL, 0,
1342         "AttributeCertificationPath/acPath", HFILL }},
1343     { &hf_x509af_acPath_item,
1344       { "Item", "x509af.acPath_item",
1345         FT_NONE, BASE_NONE, NULL, 0,
1346         "AttributeCertificationPath/acPath/_item", HFILL }},
1347     { &hf_x509af_certificate,
1348       { "certificate", "x509af.certificate",
1349         FT_NONE, BASE_NONE, NULL, 0,
1350         "ACPathData/certificate", HFILL }},
1351     { &hf_x509af_signedAttributeCertificateInfo,
1352       { "signedAttributeCertificateInfo", "x509af.signedAttributeCertificateInfo",
1353         FT_NONE, BASE_NONE, NULL, 0,
1354         "AttributeCertificate/signedAttributeCertificateInfo", HFILL }},
1355     { &hf_x509af_info_subject,
1356       { "subject", "x509af.subject",
1357         FT_UINT32, BASE_DEC, VALS(x509af_InfoSubject_vals), 0,
1358         "AttributeCertificateInfo/subject", HFILL }},
1359     { &hf_x509af_baseCertificateID,
1360       { "baseCertificateID", "x509af.baseCertificateID",
1361         FT_NONE, BASE_NONE, NULL, 0,
1362         "", HFILL }},
1363     { &hf_x509af_infoSubjectName,
1364       { "subjectName", "x509af.subjectName",
1365         FT_UINT32, BASE_DEC, NULL, 0,
1366         "AttributeCertificateInfo/subject/subjectName", HFILL }},
1367     { &hf_x509af_issuerName,
1368       { "issuer", "x509af.issuer",
1369         FT_UINT32, BASE_DEC, NULL, 0,
1370         "", HFILL }},
1371     { &hf_x509af_attCertValidityPeriod,
1372       { "attCertValidityPeriod", "x509af.attCertValidityPeriod",
1373         FT_NONE, BASE_NONE, NULL, 0,
1374         "AttributeCertificateInfo/attCertValidityPeriod", HFILL }},
1375     { &hf_x509af_attributes,
1376       { "attributes", "x509af.attributes",
1377         FT_UINT32, BASE_DEC, NULL, 0,
1378         "AttributeCertificateInfo/attributes", HFILL }},
1379     { &hf_x509af_attributes_item,
1380       { "Item", "x509af.attributes_item",
1381         FT_NONE, BASE_NONE, NULL, 0,
1382         "AttributeCertificateInfo/attributes/_item", HFILL }},
1383     { &hf_x509af_issuerUniqueID,
1384       { "issuerUniqueID", "x509af.issuerUniqueID",
1385         FT_BYTES, BASE_HEX, NULL, 0,
1386         "AttributeCertificateInfo/issuerUniqueID", HFILL }},
1387     { &hf_x509af_serial,
1388       { "serial", "x509af.serial",
1389         FT_INT32, BASE_DEC, NULL, 0,
1390         "IssuerSerial/serial", HFILL }},
1391     { &hf_x509af_issuerUID,
1392       { "issuerUID", "x509af.issuerUID",
1393         FT_BYTES, BASE_HEX, NULL, 0,
1394         "IssuerSerial/issuerUID", HFILL }},
1395     { &hf_x509af_notBeforeTime,
1396       { "notBeforeTime", "x509af.notBeforeTime",
1397         FT_STRING, BASE_NONE, NULL, 0,
1398         "AttCertValidityPeriod/notBeforeTime", HFILL }},
1399     { &hf_x509af_notAfterTime,
1400       { "notAfterTime", "x509af.notAfterTime",
1401         FT_STRING, BASE_NONE, NULL, 0,
1402         "AttCertValidityPeriod/notAfterTime", HFILL }},
1403     { &hf_x509af_assertion_subject,
1404       { "subject", "x509af.subject",
1405         FT_UINT32, BASE_DEC, VALS(x509af_AssertionSubject_vals), 0,
1406         "AttributeCertificateAssertion/subject", HFILL }},
1407     { &hf_x509af_assertionSubjectName,
1408       { "subjectName", "x509af.subjectName",
1409         FT_UINT32, BASE_DEC, VALS(x509af_SubjectName_vals), 0,
1410         "AttributeCertificateAssertion/subject/subjectName", HFILL }},
1411     { &hf_x509af_assertionIssuer,
1412       { "issuer", "x509af.issuer",
1413         FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0,
1414         "AttributeCertificateAssertion/issuer", HFILL }},
1415     { &hf_x509af_attCertValidity,
1416       { "attCertValidity", "x509af.attCertValidity",
1417         FT_STRING, BASE_NONE, NULL, 0,
1418         "AttributeCertificateAssertion/attCertValidity", HFILL }},
1419     { &hf_x509af_attType,
1420       { "attType", "x509af.attType",
1421         FT_UINT32, BASE_DEC, NULL, 0,
1422         "AttributeCertificateAssertion/attType", HFILL }},
1423     { &hf_x509af_attType_item,
1424       { "Item", "x509af.attType_item",
1425         FT_OID, BASE_NONE, NULL, 0,
1426         "AttributeCertificateAssertion/attType/_item", HFILL }},
1427     { &hf_x509af_p,
1428       { "p", "x509af.p",
1429         FT_INT32, BASE_DEC, NULL, 0,
1430         "DSS-Params/p", HFILL }},
1431     { &hf_x509af_q,
1432       { "q", "x509af.q",
1433         FT_INT32, BASE_DEC, NULL, 0,
1434         "DSS-Params/q", HFILL }},
1435     { &hf_x509af_g,
1436       { "g", "x509af.g",
1437         FT_INT32, BASE_DEC, NULL, 0,
1438         "DSS-Params/g", HFILL }},
1439
1440 /*--- End of included file: packet-x509af-hfarr.c ---*/
1441 #line 106 "packet-x509af-template.c"
1442   };
1443
1444   /* List of subtrees */
1445   static gint *ett[] = {
1446     &ett_pkix_crl,
1447
1448 /*--- Included file: packet-x509af-ettarr.c ---*/
1449 #line 1 "packet-x509af-ettarr.c"
1450     &ett_x509af_Certificate,
1451     &ett_x509af_T_signedCertificate,
1452     &ett_x509af_SubjectName,
1453     &ett_x509af_AlgorithmIdentifier,
1454     &ett_x509af_Validity,
1455     &ett_x509af_SubjectPublicKeyInfo,
1456     &ett_x509af_Time,
1457     &ett_x509af_Extensions,
1458     &ett_x509af_Extension,
1459     &ett_x509af_Certificates,
1460     &ett_x509af_ForwardCertificationPath,
1461     &ett_x509af_CrossCertificates,
1462     &ett_x509af_CertificationPath,
1463     &ett_x509af_SEQUENCE_OF_CertificatePair,
1464     &ett_x509af_CertificatePair,
1465     &ett_x509af_CertificateList,
1466     &ett_x509af_T_signedCertificateList,
1467     &ett_x509af_T_revokedCertificates,
1468     &ett_x509af_T_revokedCertificates_item,
1469     &ett_x509af_AttributeCertificationPath,
1470     &ett_x509af_SEQUENCE_OF_ACPathData,
1471     &ett_x509af_ACPathData,
1472     &ett_x509af_AttributeCertificate,
1473     &ett_x509af_AttributeCertificateInfo,
1474     &ett_x509af_InfoSubject,
1475     &ett_x509af_SEQUENCE_OF_Attribute,
1476     &ett_x509af_IssuerSerial,
1477     &ett_x509af_AttCertValidityPeriod,
1478     &ett_x509af_AttributeCertificateAssertion,
1479     &ett_x509af_AssertionSubject,
1480     &ett_x509af_SET_OF_AttributeType,
1481     &ett_x509af_DSS_Params,
1482
1483 /*--- End of included file: packet-x509af-ettarr.c ---*/
1484 #line 112 "packet-x509af-template.c"
1485   };
1486
1487   /* Register protocol */
1488   proto_x509af = proto_register_protocol(PNAME, PSNAME, PFNAME);
1489
1490   /* Register fields and subtrees */
1491   proto_register_field_array(proto_x509af, hf, array_length(hf));
1492   proto_register_subtree_array(ett, array_length(ett));
1493
1494 }
1495
1496
1497 /*--- proto_reg_handoff_x509af -------------------------------------------*/
1498 void proto_reg_handoff_x509af(void) {
1499         dissector_handle_t pkix_crl_handle;
1500
1501         pkix_crl_handle = new_create_dissector_handle(dissect_pkix_crl, proto_x509af);
1502         dissector_add_string("media_type", "application/pkix-crl", pkix_crl_handle);
1503
1504
1505 /*--- Included file: packet-x509af-dis-tab.c ---*/
1506 #line 1 "packet-x509af-dis-tab.c"
1507   register_ber_oid_dissector("2.5.4.36", dissect_Certificate_PDU, proto_x509af, "id-at-userCertificate");
1508   register_ber_oid_dissector("2.5.4.37", dissect_Certificate_PDU, proto_x509af, "id-at-cAcertificate");
1509   register_ber_oid_dissector("2.5.4.38", dissect_CertificateList_PDU, proto_x509af, "id-at-authorityRevocationList");
1510   register_ber_oid_dissector("2.5.4.39", dissect_CertificateList_PDU, proto_x509af, "id-at-certificateRevocationList");
1511   register_ber_oid_dissector("2.5.4.40", dissect_CertificatePair_PDU, proto_x509af, "id-at-crossCertificatePair");
1512   register_ber_oid_dissector("2.5.4.58", dissect_AttributeCertificate_PDU, proto_x509af, "id-at-attributeCertificate");
1513   register_ber_oid_dissector("2.5.4.59", dissect_CertificateList_PDU, proto_x509af, "id-at-attributeCertificateRevocationList");
1514   register_ber_oid_dissector("1.2.840.10040.4.1", dissect_DSS_Params_PDU, proto_x509af, "id-dsa");
1515
1516
1517 /*--- End of included file: packet-x509af-dis-tab.c ---*/
1518 #line 132 "packet-x509af-template.c"
1519
1520         /*XXX these should really go to a better place but since that
1521           I have not that ITU standard, ill put it here for the time
1522           being.
1523           Only implemented those algorithms that take no parameters 
1524           for the time being,   ronnie
1525         */
1526         /* from http://www.alvestrand.no/objectid/1.3.14.3.2.html */
1527         register_ber_oid_dissector("1.3.14.3.2.2", dissect_ber_oid_NULL_callback, proto_x509af, "md4WithRSA");
1528         register_ber_oid_dissector("1.3.14.3.2.3", dissect_ber_oid_NULL_callback, proto_x509af, "md5WithRSA");
1529         register_ber_oid_dissector("1.3.14.3.2.4", dissect_ber_oid_NULL_callback, proto_x509af, "md4WithRSAEncryption");
1530         register_ber_oid_dissector("1.3.14.3.2.6", dissect_ber_oid_NULL_callback, proto_x509af, "desECB");
1531         register_ber_oid_dissector("1.3.14.3.2.11", dissect_ber_oid_NULL_callback, proto_x509af, "rsaSignature");
1532         register_ber_oid_dissector("1.3.14.3.2.14", dissect_ber_oid_NULL_callback, proto_x509af, "mdc2WithRSASignature");
1533         register_ber_oid_dissector("1.3.14.3.2.15", dissect_ber_oid_NULL_callback, proto_x509af, "shaWithRSASignature");
1534         register_ber_oid_dissector("1.3.14.3.2.16", dissect_ber_oid_NULL_callback, proto_x509af, "dhWithCommonModulus");
1535         register_ber_oid_dissector("1.3.14.3.2.17", dissect_ber_oid_NULL_callback, proto_x509af, "desEDE");
1536         register_ber_oid_dissector("1.3.14.3.2.18", dissect_ber_oid_NULL_callback, proto_x509af, "sha");
1537         register_ber_oid_dissector("1.3.14.3.2.19", dissect_ber_oid_NULL_callback, proto_x509af, "mdc-2");
1538         register_ber_oid_dissector("1.3.14.3.2.20", dissect_ber_oid_NULL_callback, proto_x509af, "dsaCommon");
1539         register_ber_oid_dissector("1.3.14.3.2.21", dissect_ber_oid_NULL_callback, proto_x509af, "dsaCommonWithSHA");
1540         register_ber_oid_dissector("1.3.14.3.2.22", dissect_ber_oid_NULL_callback, proto_x509af, "rsaKeyTransport");
1541         register_ber_oid_dissector("1.3.14.3.2.23", dissect_ber_oid_NULL_callback, proto_x509af, "keyed-hash-seal");
1542         register_ber_oid_dissector("1.3.14.3.2.24", dissect_ber_oid_NULL_callback, proto_x509af, "md2WithRSASignature");
1543         register_ber_oid_dissector("1.3.14.3.2.25", dissect_ber_oid_NULL_callback, proto_x509af, "md5WithRSASignature");
1544         register_ber_oid_dissector("1.3.14.3.2.26", dissect_ber_oid_NULL_callback, proto_x509af, "SHA-1");
1545
1546         /* these will generally be encoded as ";binary" in LDAP */
1547
1548         register_ldap_name_dissector("cACertificate", dissect_Certificate_PDU, proto_x509af);
1549         register_ldap_name_dissector("certificate", dissect_Certificate_PDU, proto_x509af);
1550         
1551         register_ldap_name_dissector("certificateRevocationList", dissect_CertificateList_PDU, proto_x509af);
1552         register_ldap_name_dissector("crl", dissect_CertificateList_PDU, proto_x509af);
1553
1554         register_ldap_name_dissector("authorityRevocationList", dissect_CertificateList_PDU, proto_x509af);
1555         register_ldap_name_dissector("arl", dissect_CertificateList_PDU, proto_x509af);
1556
1557         register_ldap_name_dissector("crossCertificatePair", dissect_CertificatePair_PDU, proto_x509af);
1558
1559 }
1560