1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
|
/* Do not modify this file. Changes will be overwritten. */
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-pkixac.c */
/* asn2wrs.py -b -L -p pkixac -c ./pkixac.cnf -s ./packet-pkixac-template -D . -O ../.. PKIXAttributeCertificate.asn */
/* packet-pkixac.c
*
* Routines for PKIXAttributeCertificate (RFC3281) packet dissection.
*
* Copyright 2010, Stig Bjorlykke <stig@bjorlykke.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/asn1.h>
#include "packet-ber.h"
#include "packet-pkixac.h"
#include "packet-pkix1explicit.h"
#include "packet-pkix1implicit.h"
#include "packet-x509ce.h"
#define PNAME "PKIX Attribute Certificate"
#define PSNAME "PKIXAC"
#define PFNAME "pkixac"
void proto_register_pkixac(void);
void proto_reg_handoff_pkixac(void);
/* Initialize the protocol and registered fields */
static int proto_pkixac = -1;
static int hf_pkixac_Targets_PDU = -1; /* Targets */
static int hf_pkixac_IetfAttrSyntax_PDU = -1; /* IetfAttrSyntax */
static int hf_pkixac_SvceAuthInfo_PDU = -1; /* SvceAuthInfo */
static int hf_pkixac_RoleSyntax_PDU = -1; /* RoleSyntax */
static int hf_pkixac_Clearance_PDU = -1; /* Clearance */
static int hf_pkixac_RFC3281Clearance_PDU = -1; /* RFC3281Clearance */
static int hf_pkixac_AAControls_PDU = -1; /* AAControls */
static int hf_pkixac_ProxyInfo_PDU = -1; /* ProxyInfo */
static int hf_pkixac_digestedObjectType = -1; /* T_digestedObjectType */
static int hf_pkixac_otherObjectTypeID = -1; /* OBJECT_IDENTIFIER */
static int hf_pkixac_digestAlgorithm = -1; /* AlgorithmIdentifier */
static int hf_pkixac_objectDigest = -1; /* BIT_STRING */
static int hf_pkixac_issuer = -1; /* GeneralNames */
static int hf_pkixac_serial = -1; /* CertificateSerialNumber */
static int hf_pkixac_issuerUID = -1; /* UniqueIdentifier */
static int hf_pkixac_Targets_item = -1; /* Target */
static int hf_pkixac_targetName = -1; /* GeneralName */
static int hf_pkixac_targetGroup = -1; /* GeneralName */
static int hf_pkixac_targetCert = -1; /* TargetCert */
static int hf_pkixac_targetCertificate = -1; /* IssuerSerial */
static int hf_pkixac_certDigestInfo = -1; /* ObjectDigestInfo */
static int hf_pkixac_policyAuthority = -1; /* GeneralNames */
static int hf_pkixac_values = -1; /* T_values */
static int hf_pkixac_values_item = -1; /* T_values_item */
static int hf_pkixac_octets = -1; /* OCTET_STRING */
static int hf_pkixac_oid = -1; /* OBJECT_IDENTIFIER */
static int hf_pkixac_string = -1; /* UTF8String */
static int hf_pkixac_service = -1; /* GeneralName */
static int hf_pkixac_ident = -1; /* GeneralName */
static int hf_pkixac_authInfo = -1; /* OCTET_STRING */
static int hf_pkixac_roleAuthority = -1; /* GeneralNames */
static int hf_pkixac_roleName = -1; /* GeneralName */
static int hf_pkixac_policyId = -1; /* OBJECT_IDENTIFIER */
static int hf_pkixac_classList = -1; /* ClassList */
static int hf_pkixac_securityCategories = -1; /* SET_OF_SecurityCategory */
static int hf_pkixac_securityCategories_item = -1; /* SecurityCategory */
static int hf_pkixac_type = -1; /* T_type */
static int hf_pkixac_value = -1; /* T_value */
static int hf_pkixac_pathLenConstraint = -1; /* INTEGER_0_MAX */
static int hf_pkixac_permittedAttrs = -1; /* AttrSpec */
static int hf_pkixac_excludedAttrs = -1; /* AttrSpec */
static int hf_pkixac_permitUnSpecified = -1; /* BOOLEAN */
static int hf_pkixac_AttrSpec_item = -1; /* OBJECT_IDENTIFIER */
static int hf_pkixac_ProxyInfo_item = -1; /* Targets */
/* named bits */
static int hf_pkixac_ClassList_unmarked = -1;
static int hf_pkixac_ClassList_unclassified = -1;
static int hf_pkixac_ClassList_restricted = -1;
static int hf_pkixac_ClassList_confidential = -1;
static int hf_pkixac_ClassList_secret = -1;
static int hf_pkixac_ClassList_topSecret = -1;
/* Initialize the subtree pointers */
static gint ett_pkixac = -1;
static gint ett_pkixac_ObjectDigestInfo = -1;
static gint ett_pkixac_IssuerSerial = -1;
static gint ett_pkixac_Targets = -1;
static gint ett_pkixac_Target = -1;
static gint ett_pkixac_TargetCert = -1;
static gint ett_pkixac_IetfAttrSyntax = -1;
static gint ett_pkixac_T_values = -1;
static gint ett_pkixac_T_values_item = -1;
static gint ett_pkixac_SvceAuthInfo = -1;
static gint ett_pkixac_RoleSyntax = -1;
static gint ett_pkixac_Clearance = -1;
static gint ett_pkixac_SET_OF_SecurityCategory = -1;
static gint ett_pkixac_RFC3281Clearance = -1;
static gint ett_pkixac_ClassList = -1;
static gint ett_pkixac_SecurityCategory = -1;
static gint ett_pkixac_AAControls = -1;
static gint ett_pkixac_AttrSpec = -1;
static gint ett_pkixac_ProxyInfo = -1;
static const char *object_identifier_id;
static const value_string pkixac_T_digestedObjectType_vals[] = {
{ 0, "publicKey" },
{ 1, "publicKeyCert" },
{ 2, "otherObjectTypes" },
{ 0, NULL }
};
static int
dissect_pkixac_T_digestedObjectType(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_pkixac_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_) {
offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
return offset;
}
static int
dissect_pkixac_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_) {
offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
NULL, 0, hf_index, -1,
NULL);
return offset;
}
static const ber_sequence_t ObjectDigestInfo_sequence[] = {
{ &hf_pkixac_digestedObjectType, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_pkixac_T_digestedObjectType },
{ &hf_pkixac_otherObjectTypeID, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_OBJECT_IDENTIFIER },
{ &hf_pkixac_digestAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
{ &hf_pkixac_objectDigest , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_pkixac_BIT_STRING },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_ObjectDigestInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ObjectDigestInfo_sequence, hf_index, ett_pkixac_ObjectDigestInfo);
return offset;
}
static const ber_sequence_t IssuerSerial_sequence[] = {
{ &hf_pkixac_issuer , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
{ &hf_pkixac_serial , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_CertificateSerialNumber },
{ &hf_pkixac_issuerUID , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_UniqueIdentifier },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_IssuerSerial(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
IssuerSerial_sequence, hf_index, ett_pkixac_IssuerSerial);
return offset;
}
static const ber_sequence_t TargetCert_sequence[] = {
{ &hf_pkixac_targetCertificate, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixac_IssuerSerial },
{ &hf_pkixac_targetName , BER_CLASS_CON, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralName },
{ &hf_pkixac_certDigestInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_ObjectDigestInfo },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_TargetCert(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
TargetCert_sequence, hf_index, ett_pkixac_TargetCert);
return offset;
}
static const value_string pkixac_Target_vals[] = {
{ 0, "targetName" },
{ 1, "targetGroup" },
{ 2, "targetCert" },
{ 0, NULL }
};
static const ber_choice_t Target_choice[] = {
{ 0, &hf_pkixac_targetName , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralName },
{ 1, &hf_pkixac_targetGroup , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralName },
{ 2, &hf_pkixac_targetCert , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_pkixac_TargetCert },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_Target(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
Target_choice, hf_index, ett_pkixac_Target,
NULL);
return offset;
}
static const ber_sequence_t Targets_sequence_of[1] = {
{ &hf_pkixac_Targets_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_pkixac_Target },
};
static int
dissect_pkixac_Targets(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
Targets_sequence_of, hf_index, ett_pkixac_Targets);
return offset;
}
static int
dissect_pkixac_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_) {
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static int
dissect_pkixac_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_) {
offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTF8String,
actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const value_string pkixac_T_values_item_vals[] = {
{ 0, "octets" },
{ 1, "oid" },
{ 2, "string" },
{ 0, NULL }
};
static const ber_choice_t T_values_item_choice[] = {
{ 0, &hf_pkixac_octets , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkixac_OCTET_STRING },
{ 1, &hf_pkixac_oid , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkixac_OBJECT_IDENTIFIER },
{ 2, &hf_pkixac_string , BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_pkixac_UTF8String },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_T_values_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_) {
offset = dissect_ber_choice(actx, tree, tvb, offset,
T_values_item_choice, hf_index, ett_pkixac_T_values_item,
NULL);
return offset;
}
static const ber_sequence_t T_values_sequence_of[1] = {
{ &hf_pkixac_values_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_pkixac_T_values_item },
};
static int
dissect_pkixac_T_values(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
T_values_sequence_of, hf_index, ett_pkixac_T_values);
return offset;
}
static const ber_sequence_t IetfAttrSyntax_sequence[] = {
{ &hf_pkixac_policyAuthority, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralNames },
{ &hf_pkixac_values , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixac_T_values },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_IetfAttrSyntax(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
IetfAttrSyntax_sequence, hf_index, ett_pkixac_IetfAttrSyntax);
return offset;
}
static const ber_sequence_t SvceAuthInfo_sequence[] = {
{ &hf_pkixac_service , BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralName },
{ &hf_pkixac_ident , BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralName },
{ &hf_pkixac_authInfo , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_OCTET_STRING },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_SvceAuthInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
SvceAuthInfo_sequence, hf_index, ett_pkixac_SvceAuthInfo);
return offset;
}
static const ber_sequence_t RoleSyntax_sequence[] = {
{ &hf_pkixac_roleAuthority, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralNames },
{ &hf_pkixac_roleName , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralName },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_RoleSyntax(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
RoleSyntax_sequence, hf_index, ett_pkixac_RoleSyntax);
return offset;
}
static int * const ClassList_bits[] = {
&hf_pkixac_ClassList_unmarked,
&hf_pkixac_ClassList_unclassified,
&hf_pkixac_ClassList_restricted,
&hf_pkixac_ClassList_confidential,
&hf_pkixac_ClassList_secret,
&hf_pkixac_ClassList_topSecret,
NULL
};
static int
dissect_pkixac_ClassList(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
ClassList_bits, 6, hf_index, ett_pkixac_ClassList,
NULL);
return offset;
}
static int
dissect_pkixac_T_type(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
return offset;
}
static int
dissect_pkixac_T_value(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
if (object_identifier_id)
offset = call_ber_oid_callback (object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
return offset;
}
static const ber_sequence_t SecurityCategory_sequence[] = {
{ &hf_pkixac_type , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_pkixac_T_type },
{ &hf_pkixac_value , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_pkixac_T_value },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_SecurityCategory(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
object_identifier_id = NULL;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
SecurityCategory_sequence, hf_index, ett_pkixac_SecurityCategory);
return offset;
}
static const ber_sequence_t SET_OF_SecurityCategory_set_of[1] = {
{ &hf_pkixac_securityCategories_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixac_SecurityCategory },
};
static int
dissect_pkixac_SET_OF_SecurityCategory(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
SET_OF_SecurityCategory_set_of, hf_index, ett_pkixac_SET_OF_SecurityCategory);
return offset;
}
static const ber_sequence_t Clearance_sequence[] = {
{ &hf_pkixac_policyId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkixac_OBJECT_IDENTIFIER },
{ &hf_pkixac_classList , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_ClassList },
{ &hf_pkixac_securityCategories, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_SET_OF_SecurityCategory },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_Clearance(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Clearance_sequence, hf_index, ett_pkixac_Clearance);
return offset;
}
static const ber_sequence_t RFC3281Clearance_sequence[] = {
{ &hf_pkixac_policyId , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_pkixac_OBJECT_IDENTIFIER },
{ &hf_pkixac_classList , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixac_ClassList },
{ &hf_pkixac_securityCategories, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixac_SET_OF_SecurityCategory },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_RFC3281Clearance(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
RFC3281Clearance_sequence, hf_index, ett_pkixac_RFC3281Clearance);
return offset;
}
static int
dissect_pkixac_INTEGER_0_MAX(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_integer64(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
return offset;
}
static const ber_sequence_t AttrSpec_sequence_of[1] = {
{ &hf_pkixac_AttrSpec_item, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkixac_OBJECT_IDENTIFIER },
};
static int
dissect_pkixac_AttrSpec(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
AttrSpec_sequence_of, hf_index, ett_pkixac_AttrSpec);
return offset;
}
static int
dissect_pkixac_BOOLEAN(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
return offset;
}
static const ber_sequence_t AAControls_sequence[] = {
{ &hf_pkixac_pathLenConstraint, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_INTEGER_0_MAX },
{ &hf_pkixac_permittedAttrs, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixac_AttrSpec },
{ &hf_pkixac_excludedAttrs, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixac_AttrSpec },
{ &hf_pkixac_permitUnSpecified, BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_BOOLEAN },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_pkixac_AAControls(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
AAControls_sequence, hf_index, ett_pkixac_AAControls);
return offset;
}
static const ber_sequence_t ProxyInfo_sequence_of[1] = {
{ &hf_pkixac_ProxyInfo_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixac_Targets },
};
static int
dissect_pkixac_ProxyInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
ProxyInfo_sequence_of, hf_index, ett_pkixac_ProxyInfo);
return offset;
}
/*--- PDUs ---*/
static int dissect_Targets_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixac_Targets(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixac_Targets_PDU);
return offset;
}
static int dissect_IetfAttrSyntax_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixac_IetfAttrSyntax(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixac_IetfAttrSyntax_PDU);
return offset;
}
static int dissect_SvceAuthInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixac_SvceAuthInfo(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixac_SvceAuthInfo_PDU);
return offset;
}
static int dissect_RoleSyntax_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixac_RoleSyntax(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixac_RoleSyntax_PDU);
return offset;
}
static int dissect_Clearance_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixac_Clearance(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixac_Clearance_PDU);
return offset;
}
static int dissect_RFC3281Clearance_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixac_RFC3281Clearance(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixac_RFC3281Clearance_PDU);
return offset;
}
static int dissect_AAControls_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixac_AAControls(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixac_AAControls_PDU);
return offset;
}
static int dissect_ProxyInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixac_ProxyInfo(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixac_ProxyInfo_PDU);
return offset;
}
/*--- proto_register_pkixac ----------------------------------------------*/
void proto_register_pkixac(void) {
/* List of fields */
static hf_register_info hf[] = {
{ &hf_pkixac_Targets_PDU,
{ "Targets", "pkixac.Targets",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_IetfAttrSyntax_PDU,
{ "IetfAttrSyntax", "pkixac.IetfAttrSyntax_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_SvceAuthInfo_PDU,
{ "SvceAuthInfo", "pkixac.SvceAuthInfo_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_RoleSyntax_PDU,
{ "RoleSyntax", "pkixac.RoleSyntax_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_Clearance_PDU,
{ "Clearance", "pkixac.Clearance_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_RFC3281Clearance_PDU,
{ "RFC3281Clearance", "pkixac.RFC3281Clearance_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_AAControls_PDU,
{ "AAControls", "pkixac.AAControls_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_ProxyInfo_PDU,
{ "ProxyInfo", "pkixac.ProxyInfo",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_digestedObjectType,
{ "digestedObjectType", "pkixac.digestedObjectType",
FT_UINT32, BASE_DEC, VALS(pkixac_T_digestedObjectType_vals), 0,
NULL, HFILL }},
{ &hf_pkixac_otherObjectTypeID,
{ "otherObjectTypeID", "pkixac.otherObjectTypeID",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_pkixac_digestAlgorithm,
{ "digestAlgorithm", "pkixac.digestAlgorithm_element",
FT_NONE, BASE_NONE, NULL, 0,
"AlgorithmIdentifier", HFILL }},
{ &hf_pkixac_objectDigest,
{ "objectDigest", "pkixac.objectDigest",
FT_BYTES, BASE_NONE, NULL, 0,
"BIT_STRING", HFILL }},
{ &hf_pkixac_issuer,
{ "issuer", "pkixac.issuer",
FT_UINT32, BASE_DEC, NULL, 0,
"GeneralNames", HFILL }},
{ &hf_pkixac_serial,
{ "serial", "pkixac.serial",
FT_INT32, BASE_DEC, NULL, 0,
"CertificateSerialNumber", HFILL }},
{ &hf_pkixac_issuerUID,
{ "issuerUID", "pkixac.issuerUID",
FT_BYTES, BASE_NONE, NULL, 0,
"UniqueIdentifier", HFILL }},
{ &hf_pkixac_Targets_item,
{ "Target", "pkixac.Target",
FT_UINT32, BASE_DEC, VALS(pkixac_Target_vals), 0,
NULL, HFILL }},
{ &hf_pkixac_targetName,
{ "targetName", "pkixac.targetName",
FT_UINT32, BASE_DEC, NULL, 0,
"GeneralName", HFILL }},
{ &hf_pkixac_targetGroup,
{ "targetGroup", "pkixac.targetGroup",
FT_UINT32, BASE_DEC, NULL, 0,
"GeneralName", HFILL }},
{ &hf_pkixac_targetCert,
{ "targetCert", "pkixac.targetCert_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_targetCertificate,
{ "targetCertificate", "pkixac.targetCertificate_element",
FT_NONE, BASE_NONE, NULL, 0,
"IssuerSerial", HFILL }},
{ &hf_pkixac_certDigestInfo,
{ "certDigestInfo", "pkixac.certDigestInfo_element",
FT_NONE, BASE_NONE, NULL, 0,
"ObjectDigestInfo", HFILL }},
{ &hf_pkixac_policyAuthority,
{ "policyAuthority", "pkixac.policyAuthority",
FT_UINT32, BASE_DEC, NULL, 0,
"GeneralNames", HFILL }},
{ &hf_pkixac_values,
{ "values", "pkixac.values",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_values_item,
{ "values item", "pkixac.values_item",
FT_UINT32, BASE_DEC, VALS(pkixac_T_values_item_vals), 0,
NULL, HFILL }},
{ &hf_pkixac_octets,
{ "octets", "pkixac.octets",
FT_BYTES, BASE_NONE, NULL, 0,
"OCTET_STRING", HFILL }},
{ &hf_pkixac_oid,
{ "oid", "pkixac.oid",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_pkixac_string,
{ "string", "pkixac.string",
FT_STRING, BASE_NONE, NULL, 0,
"UTF8String", HFILL }},
{ &hf_pkixac_service,
{ "service", "pkixac.service",
FT_UINT32, BASE_DEC, NULL, 0,
"GeneralName", HFILL }},
{ &hf_pkixac_ident,
{ "ident", "pkixac.ident",
FT_UINT32, BASE_DEC, NULL, 0,
"GeneralName", HFILL }},
{ &hf_pkixac_authInfo,
{ "authInfo", "pkixac.authInfo",
FT_BYTES, BASE_NONE, NULL, 0,
"OCTET_STRING", HFILL }},
{ &hf_pkixac_roleAuthority,
{ "roleAuthority", "pkixac.roleAuthority",
FT_UINT32, BASE_DEC, NULL, 0,
"GeneralNames", HFILL }},
{ &hf_pkixac_roleName,
{ "roleName", "pkixac.roleName",
FT_UINT32, BASE_DEC, NULL, 0,
"GeneralName", HFILL }},
{ &hf_pkixac_policyId,
{ "policyId", "pkixac.policyId",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_pkixac_classList,
{ "classList", "pkixac.classList",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_securityCategories,
{ "securityCategories", "pkixac.securityCategories",
FT_UINT32, BASE_DEC, NULL, 0,
"SET_OF_SecurityCategory", HFILL }},
{ &hf_pkixac_securityCategories_item,
{ "SecurityCategory", "pkixac.SecurityCategory_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_type,
{ "type", "pkixac.type",
FT_OID, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_value,
{ "value", "pkixac.value_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_pathLenConstraint,
{ "pathLenConstraint", "pkixac.pathLenConstraint",
FT_UINT64, BASE_DEC, NULL, 0,
"INTEGER_0_MAX", HFILL }},
{ &hf_pkixac_permittedAttrs,
{ "permittedAttrs", "pkixac.permittedAttrs",
FT_UINT32, BASE_DEC, NULL, 0,
"AttrSpec", HFILL }},
{ &hf_pkixac_excludedAttrs,
{ "excludedAttrs", "pkixac.excludedAttrs",
FT_UINT32, BASE_DEC, NULL, 0,
"AttrSpec", HFILL }},
{ &hf_pkixac_permitUnSpecified,
{ "permitUnSpecified", "pkixac.permitUnSpecified",
FT_BOOLEAN, BASE_NONE, NULL, 0,
"BOOLEAN", HFILL }},
{ &hf_pkixac_AttrSpec_item,
{ "AttrSpec item", "pkixac.AttrSpec_item",
FT_OID, BASE_NONE, NULL, 0,
"OBJECT_IDENTIFIER", HFILL }},
{ &hf_pkixac_ProxyInfo_item,
{ "Targets", "pkixac.Targets",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }},
{ &hf_pkixac_ClassList_unmarked,
{ "unmarked", "pkixac.ClassList.unmarked",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }},
{ &hf_pkixac_ClassList_unclassified,
{ "unclassified", "pkixac.ClassList.unclassified",
FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }},
{ &hf_pkixac_ClassList_restricted,
{ "restricted", "pkixac.ClassList.restricted",
FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }},
{ &hf_pkixac_ClassList_confidential,
{ "confidential", "pkixac.ClassList.confidential",
FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }},
{ &hf_pkixac_ClassList_secret,
{ "secret", "pkixac.ClassList.secret",
FT_BOOLEAN, 8, NULL, 0x08,
NULL, HFILL }},
{ &hf_pkixac_ClassList_topSecret,
{ "topSecret", "pkixac.ClassList.topSecret",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }},
};
/* List of subtrees */
static gint *ett[] = {
&ett_pkixac,
&ett_pkixac_ObjectDigestInfo,
&ett_pkixac_IssuerSerial,
&ett_pkixac_Targets,
&ett_pkixac_Target,
&ett_pkixac_TargetCert,
&ett_pkixac_IetfAttrSyntax,
&ett_pkixac_T_values,
&ett_pkixac_T_values_item,
&ett_pkixac_SvceAuthInfo,
&ett_pkixac_RoleSyntax,
&ett_pkixac_Clearance,
&ett_pkixac_SET_OF_SecurityCategory,
&ett_pkixac_RFC3281Clearance,
&ett_pkixac_ClassList,
&ett_pkixac_SecurityCategory,
&ett_pkixac_AAControls,
&ett_pkixac_AttrSpec,
&ett_pkixac_ProxyInfo,
};
/* Register protocol */
proto_pkixac = proto_register_protocol(PNAME, PSNAME, PFNAME);
/* Register fields and subtrees */
proto_register_field_array(proto_pkixac, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/*--- Syntax registrations ---*/
register_ber_syntax_dissector("Clearance", proto_pkixac, dissect_Clearance_PDU);
register_ber_syntax_dissector("RFC3281Clearance", proto_pkixac, dissect_RFC3281Clearance_PDU);
}
/*--- proto_reg_handoff_pkixac -------------------------------------------*/
void proto_reg_handoff_pkixac(void) {
register_ber_oid_dissector("1.3.6.1.5.5.7.1.6", dissect_AAControls_PDU, proto_pkixac, "id-pe-aaControls");
register_ber_oid_dissector("1.3.6.1.5.5.7.1.10", dissect_ProxyInfo_PDU, proto_pkixac, "id-pe-ac-proxying");
register_ber_oid_dissector("1.3.6.1.5.5.7.10.1", dissect_SvceAuthInfo_PDU, proto_pkixac, "id-aca-authenticationInfo");
register_ber_oid_dissector("1.3.6.1.5.5.7.10.2", dissect_SvceAuthInfo_PDU, proto_pkixac, "id-aca-accessIdentity");
register_ber_oid_dissector("1.3.6.1.5.5.7.10.3", dissect_IetfAttrSyntax_PDU, proto_pkixac, "id-aca-chargingIdentity");
register_ber_oid_dissector("1.3.6.1.5.5.7.10.4", dissect_IetfAttrSyntax_PDU, proto_pkixac, "id-aca-group");
register_ber_oid_dissector("2.5.1.5.55", dissect_Clearance_PDU, proto_pkixac, "id-at-clearance");
register_ber_oid_dissector("2.5.4.55", dissect_Clearance_PDU, proto_pkixac, "id-at-clearance");
register_ber_oid_dissector("2.5.4.72", dissect_RoleSyntax_PDU, proto_pkixac, "id-at-role");
register_ber_oid_dissector("2.5.29.55", dissect_Targets_PDU, proto_pkixac, "id-ce-targetInformation");
}
|