-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpacket-cms.c
More file actions
3412 lines (2771 loc) · 149 KB
/
packet-cms.c
File metadata and controls
3412 lines (2771 loc) · 149 KB
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
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Do not modify this file. Changes will be overwritten. */
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-cms.c */
/* asn2wrs.py -b -C -p cms -c ./cms.cnf -s ./packet-cms-template -D . -O ../.. CryptographicMessageSyntax.asn AttributeCertificateVersion1.asn CMSFirmwareWrapper.asn */
/* Input file: packet-cms-template.c */
#line 1 "./asn1/cms/packet-cms-template.c"
/* packet-cms.c
* Routines for RFC5652 Cryptographic Message Syntax packet dissection
* Ronnie Sahlberg 2004
* Stig Bjorlykke 2010
*
* 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/oids.h>
#include <epan/asn1.h>
#include <wsutil/wsgcrypt.h>
#include "packet-ber.h"
#include "packet-cms.h"
#include "packet-x509af.h"
#include "packet-x509ce.h"
#include "packet-x509if.h"
#include "packet-x509sat.h"
#include "packet-pkcs12.h"
#define PNAME "Cryptographic Message Syntax"
#define PSNAME "CMS"
#define PFNAME "cms"
void proto_register_cms(void);
void proto_reg_handoff_cms(void);
/* Initialize the protocol and registered fields */
static int proto_cms = -1;
static int hf_cms_ci_contentType = -1;
/*--- Included file: packet-cms-hf.c ---*/
#line 1 "./asn1/cms/packet-cms-hf.c"
static int hf_cms_ContentInfo_PDU = -1; /* ContentInfo */
static int hf_cms_ContentType_PDU = -1; /* ContentType */
static int hf_cms_SignedData_PDU = -1; /* SignedData */
static int hf_cms_EnvelopedData_PDU = -1; /* EnvelopedData */
static int hf_cms_DigestedData_PDU = -1; /* DigestedData */
static int hf_cms_EncryptedData_PDU = -1; /* EncryptedData */
static int hf_cms_AuthenticatedData_PDU = -1; /* AuthenticatedData */
static int hf_cms_IssuerAndSerialNumber_PDU = -1; /* IssuerAndSerialNumber */
static int hf_cms_MessageDigest_PDU = -1; /* MessageDigest */
static int hf_cms_SigningTime_PDU = -1; /* SigningTime */
static int hf_cms_Countersignature_PDU = -1; /* Countersignature */
static int hf_cms_KeyWrapAlgorithm_PDU = -1; /* KeyWrapAlgorithm */
static int hf_cms_RC2WrapParameter_PDU = -1; /* RC2WrapParameter */
static int hf_cms_IV_PDU = -1; /* IV */
static int hf_cms_SMIMECapabilities_PDU = -1; /* SMIMECapabilities */
static int hf_cms_SMIMEEncryptionKeyPreference_PDU = -1; /* SMIMEEncryptionKeyPreference */
static int hf_cms_RC2CBCParameters_PDU = -1; /* RC2CBCParameters */
static int hf_cms_FirmwarePkgData_PDU = -1; /* FirmwarePkgData */
static int hf_cms_FirmwarePackageIdentifier_PDU = -1; /* FirmwarePackageIdentifier */
static int hf_cms_TargetHardwareIdentifiers_PDU = -1; /* TargetHardwareIdentifiers */
static int hf_cms_DecryptKeyIdentifier_PDU = -1; /* DecryptKeyIdentifier */
static int hf_cms_ImplementedCryptoAlgorithms_PDU = -1; /* ImplementedCryptoAlgorithms */
static int hf_cms_ImplementedCompressAlgorithms_PDU = -1; /* ImplementedCompressAlgorithms */
static int hf_cms_CommunityIdentifiers_PDU = -1; /* CommunityIdentifiers */
static int hf_cms_FirmwarePackageInfo_PDU = -1; /* FirmwarePackageInfo */
static int hf_cms_WrappedFirmwareKey_PDU = -1; /* WrappedFirmwareKey */
static int hf_cms_FirmwarePackageLoadReceipt_PDU = -1; /* FirmwarePackageLoadReceipt */
static int hf_cms_FirmwarePackageLoadError_PDU = -1; /* FirmwarePackageLoadError */
static int hf_cms_HardwareModuleName_PDU = -1; /* HardwareModuleName */
static int hf_cms_FirmwarePackageMessageDigest_PDU = -1; /* FirmwarePackageMessageDigest */
static int hf_cms_contentType = -1; /* ContentType */
static int hf_cms_content = -1; /* T_content */
static int hf_cms_version = -1; /* CMSVersion */
static int hf_cms_digestAlgorithms = -1; /* DigestAlgorithmIdentifiers */
static int hf_cms_encapContentInfo = -1; /* EncapsulatedContentInfo */
static int hf_cms_certificates = -1; /* CertificateSet */
static int hf_cms_crls = -1; /* RevocationInfoChoices */
static int hf_cms_signerInfos = -1; /* SignerInfos */
static int hf_cms_DigestAlgorithmIdentifiers_item = -1; /* DigestAlgorithmIdentifier */
static int hf_cms_SignerInfos_item = -1; /* SignerInfo */
static int hf_cms_eContentType = -1; /* ContentType */
static int hf_cms_eContent = -1; /* T_eContent */
static int hf_cms_sid = -1; /* SignerIdentifier */
static int hf_cms_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
static int hf_cms_signedAttrs = -1; /* SignedAttributes */
static int hf_cms_signatureAlgorithm = -1; /* SignatureAlgorithmIdentifier */
static int hf_cms_signatureValue = -1; /* SignatureValue */
static int hf_cms_unsignedAttrs = -1; /* UnsignedAttributes */
static int hf_cms_issuerAndSerialNumber = -1; /* IssuerAndSerialNumber */
static int hf_cms_subjectKeyIdentifier = -1; /* SubjectKeyIdentifier */
static int hf_cms_SignedAttributes_item = -1; /* Attribute */
static int hf_cms_UnsignedAttributes_item = -1; /* Attribute */
static int hf_cms_attrType = -1; /* T_attrType */
static int hf_cms_attrValues = -1; /* SET_OF_AttributeValue */
static int hf_cms_attrValues_item = -1; /* AttributeValue */
static int hf_cms_originatorInfo = -1; /* OriginatorInfo */
static int hf_cms_recipientInfos = -1; /* RecipientInfos */
static int hf_cms_encryptedContentInfo = -1; /* EncryptedContentInfo */
static int hf_cms_unprotectedAttrs = -1; /* UnprotectedAttributes */
static int hf_cms_certs = -1; /* CertificateSet */
static int hf_cms_RecipientInfos_item = -1; /* RecipientInfo */
static int hf_cms_encryptedContentType = -1; /* ContentType */
static int hf_cms_contentEncryptionAlgorithm = -1; /* ContentEncryptionAlgorithmIdentifier */
static int hf_cms_encryptedContent = -1; /* EncryptedContent */
static int hf_cms_UnprotectedAttributes_item = -1; /* Attribute */
static int hf_cms_ktri = -1; /* KeyTransRecipientInfo */
static int hf_cms_kari = -1; /* KeyAgreeRecipientInfo */
static int hf_cms_kekri = -1; /* KEKRecipientInfo */
static int hf_cms_pwri = -1; /* PasswordRecipientInfo */
static int hf_cms_ori = -1; /* OtherRecipientInfo */
static int hf_cms_rid = -1; /* RecipientIdentifier */
static int hf_cms_keyEncryptionAlgorithm = -1; /* KeyEncryptionAlgorithmIdentifier */
static int hf_cms_encryptedKey = -1; /* EncryptedKey */
static int hf_cms_originator = -1; /* OriginatorIdentifierOrKey */
static int hf_cms_ukm = -1; /* UserKeyingMaterial */
static int hf_cms_recipientEncryptedKeys = -1; /* RecipientEncryptedKeys */
static int hf_cms_originatorKey = -1; /* OriginatorPublicKey */
static int hf_cms_algorithm = -1; /* AlgorithmIdentifier */
static int hf_cms_publicKey = -1; /* BIT_STRING */
static int hf_cms_RecipientEncryptedKeys_item = -1; /* RecipientEncryptedKey */
static int hf_cms_rekRid = -1; /* KeyAgreeRecipientIdentifier */
static int hf_cms_rKeyId = -1; /* RecipientKeyIdentifier */
static int hf_cms_date = -1; /* GeneralizedTime */
static int hf_cms_other = -1; /* OtherKeyAttribute */
static int hf_cms_kekid = -1; /* KEKIdentifier */
static int hf_cms_keyIdentifier = -1; /* OCTET_STRING */
static int hf_cms_keyDerivationAlgorithm = -1; /* KeyDerivationAlgorithmIdentifier */
static int hf_cms_oriType = -1; /* T_oriType */
static int hf_cms_oriValue = -1; /* T_oriValue */
static int hf_cms_digest = -1; /* Digest */
static int hf_cms_macAlgorithm = -1; /* MessageAuthenticationCodeAlgorithm */
static int hf_cms_authAttrs = -1; /* AuthAttributes */
static int hf_cms_mac = -1; /* MessageAuthenticationCode */
static int hf_cms_unauthAttrs = -1; /* UnauthAttributes */
static int hf_cms_AuthAttributes_item = -1; /* Attribute */
static int hf_cms_UnauthAttributes_item = -1; /* Attribute */
static int hf_cms_RevocationInfoChoices_item = -1; /* RevocationInfoChoice */
static int hf_cms_crl = -1; /* CertificateList */
static int hf_cms_otherRIC = -1; /* OtherRevocationInfoFormat */
static int hf_cms_otherRevInfoFormat = -1; /* T_otherRevInfoFormat */
static int hf_cms_otherRevInfo = -1; /* T_otherRevInfo */
static int hf_cms_certificate = -1; /* Certificate */
static int hf_cms_extendedCertificate = -1; /* ExtendedCertificate */
static int hf_cms_v1AttrCert = -1; /* AttributeCertificateV1 */
static int hf_cms_v2AttrCert = -1; /* AttributeCertificateV2 */
static int hf_cms_CertificateSet_item = -1; /* CertificateChoices */
static int hf_cms_issuer = -1; /* Name */
static int hf_cms_serialNumber = -1; /* CertificateSerialNumber */
static int hf_cms_keyAttrId = -1; /* T_keyAttrId */
static int hf_cms_keyAttr = -1; /* T_keyAttr */
static int hf_cms_utcTime = -1; /* UTCTime */
static int hf_cms_generalTime = -1; /* GeneralizedTime */
static int hf_cms_rc2ParameterVersion = -1; /* INTEGER */
static int hf_cms_iv = -1; /* OCTET_STRING */
static int hf_cms_extendedCertificateInfo = -1; /* ExtendedCertificateInfo */
static int hf_cms_signature = -1; /* Signature */
static int hf_cms_attributes = -1; /* UnauthAttributes */
static int hf_cms_SMIMECapabilities_item = -1; /* SMIMECapability */
static int hf_cms_capability = -1; /* T_capability */
static int hf_cms_parameters = -1; /* T_parameters */
static int hf_cms_recipientKeyId = -1; /* RecipientKeyIdentifier */
static int hf_cms_subjectAltKeyIdentifier = -1; /* SubjectKeyIdentifier */
static int hf_cms_rc2WrapParameter = -1; /* RC2WrapParameter */
static int hf_cms_rc2CBCParameter = -1; /* RC2CBCParameter */
static int hf_cms_acInfo = -1; /* AttributeCertificateInfoV1 */
static int hf_cms_signatureAlgorithm_v1 = -1; /* AlgorithmIdentifier */
static int hf_cms_signatureValue_v1 = -1; /* BIT_STRING */
static int hf_cms_version_v1 = -1; /* AttCertVersionV1 */
static int hf_cms_subject = -1; /* T_subject */
static int hf_cms_baseCertificateID = -1; /* IssuerSerial */
static int hf_cms_subjectName = -1; /* GeneralNames */
static int hf_cms_issuer_v1 = -1; /* GeneralNames */
static int hf_cms_signature_v1 = -1; /* AlgorithmIdentifier */
static int hf_cms_attCertValidityPeriod = -1; /* AttCertValidityPeriod */
static int hf_cms_attributes_v1 = -1; /* SEQUENCE_OF_Attribute */
static int hf_cms_attributes_v1_item = -1; /* Attribute */
static int hf_cms_issuerUniqueID = -1; /* UniqueIdentifier */
static int hf_cms_extensions = -1; /* Extensions */
static int hf_cms_name = -1; /* PreferredOrLegacyPackageIdentifier */
static int hf_cms_stale = -1; /* PreferredOrLegacyStalePackageIdentifier */
static int hf_cms_preferred = -1; /* PreferredPackageIdentifier */
static int hf_cms_legacy = -1; /* OCTET_STRING */
static int hf_cms_fwPkgID = -1; /* OBJECT_IDENTIFIER */
static int hf_cms_verNum = -1; /* INTEGER_0_MAX */
static int hf_cms_preferredStaleVerNum = -1; /* INTEGER_0_MAX */
static int hf_cms_legacyStaleVersion = -1; /* OCTET_STRING */
static int hf_cms_TargetHardwareIdentifiers_item = -1; /* OBJECT_IDENTIFIER */
static int hf_cms_ImplementedCryptoAlgorithms_item = -1; /* OBJECT_IDENTIFIER */
static int hf_cms_ImplementedCompressAlgorithms_item = -1; /* OBJECT_IDENTIFIER */
static int hf_cms_CommunityIdentifiers_item = -1; /* CommunityIdentifier */
static int hf_cms_communityOID = -1; /* OBJECT_IDENTIFIER */
static int hf_cms_hwModuleList = -1; /* HardwareModules */
static int hf_cms_hwType = -1; /* OBJECT_IDENTIFIER */
static int hf_cms_hwSerialEntries = -1; /* SEQUENCE_OF_HardwareSerialEntry */
static int hf_cms_hwSerialEntries_item = -1; /* HardwareSerialEntry */
static int hf_cms_all = -1; /* NULL */
static int hf_cms_single = -1; /* OCTET_STRING */
static int hf_cms_block = -1; /* T_block */
static int hf_cms_low = -1; /* OCTET_STRING */
static int hf_cms_high = -1; /* OCTET_STRING */
static int hf_cms_fwPkgType = -1; /* INTEGER */
static int hf_cms_dependencies = -1; /* SEQUENCE_OF_PreferredOrLegacyPackageIdentifier */
static int hf_cms_dependencies_item = -1; /* PreferredOrLegacyPackageIdentifier */
static int hf_cms_fwReceiptVersion = -1; /* FWReceiptVersion */
static int hf_cms_hwSerialNum = -1; /* OCTET_STRING */
static int hf_cms_fwPkgName = -1; /* PreferredOrLegacyPackageIdentifier */
static int hf_cms_trustAnchorKeyID = -1; /* OCTET_STRING */
static int hf_cms_decryptKeyID = -1; /* OCTET_STRING */
static int hf_cms_fwErrorVersion = -1; /* FWErrorVersion */
static int hf_cms_errorCode = -1; /* FirmwarePackageLoadErrorCode */
static int hf_cms_vendorErrorCode = -1; /* VendorLoadErrorCode */
static int hf_cms_config = -1; /* SEQUENCE_OF_CurrentFWConfig */
static int hf_cms_config_item = -1; /* CurrentFWConfig */
static int hf_cms_msgDigest = -1; /* OCTET_STRING */
/*--- End of included file: packet-cms-hf.c ---*/
#line 39 "./asn1/cms/packet-cms-template.c"
/* Initialize the subtree pointers */
/*--- Included file: packet-cms-ett.c ---*/
#line 1 "./asn1/cms/packet-cms-ett.c"
static gint ett_cms_ContentInfo = -1;
static gint ett_cms_SignedData = -1;
static gint ett_cms_DigestAlgorithmIdentifiers = -1;
static gint ett_cms_SignerInfos = -1;
static gint ett_cms_EncapsulatedContentInfo = -1;
static gint ett_cms_SignerInfo = -1;
static gint ett_cms_SignerIdentifier = -1;
static gint ett_cms_SignedAttributes = -1;
static gint ett_cms_UnsignedAttributes = -1;
static gint ett_cms_Attribute = -1;
static gint ett_cms_SET_OF_AttributeValue = -1;
static gint ett_cms_EnvelopedData = -1;
static gint ett_cms_OriginatorInfo = -1;
static gint ett_cms_RecipientInfos = -1;
static gint ett_cms_EncryptedContentInfo = -1;
static gint ett_cms_UnprotectedAttributes = -1;
static gint ett_cms_RecipientInfo = -1;
static gint ett_cms_KeyTransRecipientInfo = -1;
static gint ett_cms_RecipientIdentifier = -1;
static gint ett_cms_KeyAgreeRecipientInfo = -1;
static gint ett_cms_OriginatorIdentifierOrKey = -1;
static gint ett_cms_OriginatorPublicKey = -1;
static gint ett_cms_RecipientEncryptedKeys = -1;
static gint ett_cms_RecipientEncryptedKey = -1;
static gint ett_cms_KeyAgreeRecipientIdentifier = -1;
static gint ett_cms_RecipientKeyIdentifier = -1;
static gint ett_cms_KEKRecipientInfo = -1;
static gint ett_cms_KEKIdentifier = -1;
static gint ett_cms_PasswordRecipientInfo = -1;
static gint ett_cms_OtherRecipientInfo = -1;
static gint ett_cms_DigestedData = -1;
static gint ett_cms_EncryptedData = -1;
static gint ett_cms_AuthenticatedData = -1;
static gint ett_cms_AuthAttributes = -1;
static gint ett_cms_UnauthAttributes = -1;
static gint ett_cms_RevocationInfoChoices = -1;
static gint ett_cms_RevocationInfoChoice = -1;
static gint ett_cms_OtherRevocationInfoFormat = -1;
static gint ett_cms_CertificateChoices = -1;
static gint ett_cms_CertificateSet = -1;
static gint ett_cms_IssuerAndSerialNumber = -1;
static gint ett_cms_OtherKeyAttribute = -1;
static gint ett_cms_Time = -1;
static gint ett_cms_RC2CBCParameter = -1;
static gint ett_cms_ExtendedCertificate = -1;
static gint ett_cms_ExtendedCertificateInfo = -1;
static gint ett_cms_DigestInfo = -1;
static gint ett_cms_SMIMECapabilities = -1;
static gint ett_cms_SMIMECapability = -1;
static gint ett_cms_SMIMEEncryptionKeyPreference = -1;
static gint ett_cms_RC2CBCParameters = -1;
static gint ett_cms_AttributeCertificateV1 = -1;
static gint ett_cms_AttributeCertificateInfoV1 = -1;
static gint ett_cms_T_subject = -1;
static gint ett_cms_SEQUENCE_OF_Attribute = -1;
static gint ett_cms_FirmwarePackageIdentifier = -1;
static gint ett_cms_PreferredOrLegacyPackageIdentifier = -1;
static gint ett_cms_PreferredPackageIdentifier = -1;
static gint ett_cms_PreferredOrLegacyStalePackageIdentifier = -1;
static gint ett_cms_TargetHardwareIdentifiers = -1;
static gint ett_cms_ImplementedCryptoAlgorithms = -1;
static gint ett_cms_ImplementedCompressAlgorithms = -1;
static gint ett_cms_CommunityIdentifiers = -1;
static gint ett_cms_CommunityIdentifier = -1;
static gint ett_cms_HardwareModules = -1;
static gint ett_cms_SEQUENCE_OF_HardwareSerialEntry = -1;
static gint ett_cms_HardwareSerialEntry = -1;
static gint ett_cms_T_block = -1;
static gint ett_cms_FirmwarePackageInfo = -1;
static gint ett_cms_SEQUENCE_OF_PreferredOrLegacyPackageIdentifier = -1;
static gint ett_cms_FirmwarePackageLoadReceipt = -1;
static gint ett_cms_FirmwarePackageLoadError = -1;
static gint ett_cms_SEQUENCE_OF_CurrentFWConfig = -1;
static gint ett_cms_CurrentFWConfig = -1;
static gint ett_cms_HardwareModuleName = -1;
static gint ett_cms_FirmwarePackageMessageDigest = -1;
/*--- End of included file: packet-cms-ett.c ---*/
#line 42 "./asn1/cms/packet-cms-template.c"
static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2wrs stops generating these silly wrappers */
static const char *object_identifier_id = NULL;
static tvbuff_t *content_tvb = NULL;
static proto_tree *top_tree=NULL;
static proto_tree *cap_tree=NULL;
#define HASH_SHA1 "1.3.14.3.2.26"
#define HASH_MD5 "1.2.840.113549.2.5"
/* SHA-2 variants */
#define HASH_SHA224 "2.16.840.1.101.3.4.2.4"
#define SHA224_BUFFER_SIZE 32 /* actually 28 */
#define HASH_SHA256 "2.16.840.1.101.3.4.2.1"
#define SHA256_BUFFER_SIZE 32
unsigned char digest_buf[MAX(HASH_SHA1_LENGTH, HASH_MD5_LENGTH)];
static void
cms_verify_msg_digest(proto_item *pi, tvbuff_t *content, const char *alg, tvbuff_t *tvb, int offset)
{
int i= 0, buffer_size = 0;
/* we only support two algorithms at the moment - if we do add SHA2
we should add a registration process to use a registration process */
if(strcmp(alg, HASH_SHA1) == 0) {
gcry_md_hash_buffer(GCRY_MD_SHA1, digest_buf, tvb_get_ptr(content, 0, tvb_captured_length(content)), tvb_captured_length(content));
buffer_size = HASH_SHA1_LENGTH;
} else if(strcmp(alg, HASH_MD5) == 0) {
gcry_md_hash_buffer(GCRY_MD_MD5, digest_buf, tvb_get_ptr(content, 0, tvb_captured_length(content)), tvb_captured_length(content));
buffer_size = HASH_MD5_LENGTH;
}
if(buffer_size) {
/* compare our computed hash with what we have received */
if(tvb_bytes_exist(tvb, offset, buffer_size) &&
(tvb_memeql(tvb, offset, digest_buf, buffer_size) != 0)) {
proto_item_append_text(pi, " [incorrect, should be ");
for(i = 0; i < buffer_size; i++)
proto_item_append_text(pi, "%02X", digest_buf[i]);
proto_item_append_text(pi, "]");
}
else
proto_item_append_text(pi, " [correct]");
} else {
proto_item_append_text(pi, " [unable to verify]");
}
}
/*--- Included file: packet-cms-fn.c ---*/
#line 1 "./asn1/cms/packet-cms-fn.c"
int
dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 132 "./asn1/cms/cms.cnf"
const char *name = NULL;
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
if(object_identifier_id) {
name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
proto_item_append_text(tree, " (%s)", name ? name : object_identifier_id);
}
return offset;
}
static int
dissect_cms_T_content(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 142 "./asn1/cms/cms.cnf"
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
return offset;
}
static const ber_sequence_t ContentInfo_sequence[] = {
{ &hf_cms_contentType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
{ &hf_cms_content , BER_CLASS_CON, 0, 0, dissect_cms_T_content },
{ NULL, 0, 0, 0, NULL }
};
int
dissect_cms_ContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 122 "./asn1/cms/cms.cnf"
top_tree = tree;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
content_tvb = NULL;
object_identifier_id = NULL;
top_tree = NULL;
return offset;
}
static const value_string cms_CMSVersion_vals[] = {
{ 0, "v0" },
{ 1, "v1" },
{ 2, "v2" },
{ 3, "v3" },
{ 4, "v4" },
{ 5, "v5" },
{ 0, NULL }
};
static int
dissect_cms_CMSVersion(gboolean 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;
}
int
dissect_cms_DigestAlgorithmIdentifier(gboolean 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_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
return offset;
}
static const ber_sequence_t DigestAlgorithmIdentifiers_set_of[1] = {
{ &hf_cms_DigestAlgorithmIdentifiers_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
};
int
dissect_cms_DigestAlgorithmIdentifiers(gboolean 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,
DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers);
return offset;
}
static int
dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 146 "./asn1/cms/cms.cnf"
offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &content_tvb);
if(content_tvb) {
proto_item_set_text(actx->created_item, "eContent (%u bytes)", tvb_reported_length (content_tvb));
call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, tree, NULL);
}
return offset;
}
static const ber_sequence_t EncapsulatedContentInfo_sequence[] = {
{ &hf_cms_eContentType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
{ &hf_cms_eContent , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_cms_T_eContent },
{ NULL, 0, 0, 0, NULL }
};
int
dissect_cms_EncapsulatedContentInfo(gboolean 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,
EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
return offset;
}
static int
dissect_cms_T_attrType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 176 "./asn1/cms/cms.cnf"
const char *name = NULL;
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
if(object_identifier_id) {
name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
proto_item_append_text(tree, " (%s)", name ? name : object_identifier_id);
}
return offset;
}
static int
dissect_cms_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 186 "./asn1/cms/cms.cnf"
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
return offset;
}
static const ber_sequence_t SET_OF_AttributeValue_set_of[1] = {
{ &hf_cms_attrValues_item , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_cms_AttributeValue },
};
static int
dissect_cms_SET_OF_AttributeValue(gboolean 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_AttributeValue_set_of, hf_index, ett_cms_SET_OF_AttributeValue);
return offset;
}
static const ber_sequence_t Attribute_sequence[] = {
{ &hf_cms_attrType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_attrType },
{ &hf_cms_attrValues , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_SET_OF_AttributeValue },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_Attribute(gboolean 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,
Attribute_sequence, hf_index, ett_cms_Attribute);
return offset;
}
static const ber_sequence_t UnauthAttributes_set_of[1] = {
{ &hf_cms_UnauthAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
};
static int
dissect_cms_UnauthAttributes(gboolean 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_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1, NO_BOUND, UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes);
return offset;
}
static const ber_sequence_t ExtendedCertificateInfo_sequence[] = {
{ &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
{ &hf_cms_certificate , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_Certificate },
{ &hf_cms_attributes , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_UnauthAttributes },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_ExtendedCertificateInfo(gboolean 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,
ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo);
return offset;
}
static int
dissect_cms_SignatureAlgorithmIdentifier(gboolean 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_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
return offset;
}
static int
dissect_cms_Signature(gboolean 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 ExtendedCertificate_sequence[] = {
{ &hf_cms_extendedCertificateInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_ExtendedCertificateInfo },
{ &hf_cms_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureAlgorithmIdentifier },
{ &hf_cms_signature , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Signature },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_ExtendedCertificate(gboolean 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,
ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate);
return offset;
}
static const value_string cms_AttCertVersionV1_vals[] = {
{ 0, "v1" },
{ 0, NULL }
};
static int
dissect_cms_AttCertVersionV1(gboolean 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 const value_string cms_T_subject_vals[] = {
{ 0, "baseCertificateID" },
{ 1, "subjectName" },
{ 0, NULL }
};
static const ber_choice_t T_subject_choice[] = {
{ 0, &hf_cms_baseCertificateID, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_x509af_IssuerSerial },
{ 1, &hf_cms_subjectName , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralNames },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_T_subject(gboolean 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_subject_choice, hf_index, ett_cms_T_subject,
NULL);
return offset;
}
static const ber_sequence_t SEQUENCE_OF_Attribute_sequence_of[1] = {
{ &hf_cms_attributes_v1_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
};
static int
dissect_cms_SEQUENCE_OF_Attribute(gboolean 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,
SEQUENCE_OF_Attribute_sequence_of, hf_index, ett_cms_SEQUENCE_OF_Attribute);
return offset;
}
static const ber_sequence_t AttributeCertificateInfoV1_sequence[] = {
{ &hf_cms_version_v1 , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_AttCertVersionV1 },
{ &hf_cms_subject , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_T_subject },
{ &hf_cms_issuer_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
{ &hf_cms_signature_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
{ &hf_cms_serialNumber , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateSerialNumber },
{ &hf_cms_attCertValidityPeriod, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AttCertValidityPeriod },
{ &hf_cms_attributes_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SEQUENCE_OF_Attribute },
{ &hf_cms_issuerUniqueID , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509sat_UniqueIdentifier },
{ &hf_cms_extensions , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509af_Extensions },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_AttributeCertificateInfoV1(gboolean 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,
AttributeCertificateInfoV1_sequence, hf_index, ett_cms_AttributeCertificateInfoV1);
return offset;
}
static int
dissect_cms_BIT_STRING(gboolean 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 AttributeCertificateV1_sequence[] = {
{ &hf_cms_acInfo , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_AttributeCertificateInfoV1 },
{ &hf_cms_signatureAlgorithm_v1, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
{ &hf_cms_signatureValue_v1, BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_BIT_STRING },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_AttributeCertificateV1(gboolean 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,
AttributeCertificateV1_sequence, hf_index, ett_cms_AttributeCertificateV1);
return offset;
}
static int
dissect_cms_AttributeCertificateV2(gboolean 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_x509af_AttributeCertificate(implicit_tag, tvb, offset, actx, tree, hf_index);
return offset;
}
static const value_string cms_CertificateChoices_vals[] = {
{ 0, "certificate" },
{ 1, "extendedCertificate" },
{ 2, "v1AttrCert" },
{ 3, "v2AttrCert" },
{ 0, NULL }
};
static const ber_choice_t CertificateChoices_choice[] = {
{ 0, &hf_cms_certificate , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_Certificate },
{ 1, &hf_cms_extendedCertificate, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_ExtendedCertificate },
{ 2, &hf_cms_v1AttrCert , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_AttributeCertificateV1 },
{ 3, &hf_cms_v2AttrCert , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_cms_AttributeCertificateV2 },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_CertificateChoices(gboolean 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,
CertificateChoices_choice, hf_index, ett_cms_CertificateChoices,
NULL);
return offset;
}
static const ber_sequence_t CertificateSet_set_of[1] = {
{ &hf_cms_CertificateSet_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_CertificateChoices },
};
static int
dissect_cms_CertificateSet(gboolean 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,
CertificateSet_set_of, hf_index, ett_cms_CertificateSet);
return offset;
}
static int
dissect_cms_T_otherRevInfoFormat(gboolean 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_cms_T_otherRevInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 170 "./asn1/cms/cms.cnf"
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
return offset;
}
static const ber_sequence_t OtherRevocationInfoFormat_sequence[] = {
{ &hf_cms_otherRevInfoFormat, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_otherRevInfoFormat },
{ &hf_cms_otherRevInfo , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_cms_T_otherRevInfo },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_OtherRevocationInfoFormat(gboolean 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,
OtherRevocationInfoFormat_sequence, hf_index, ett_cms_OtherRevocationInfoFormat);
return offset;
}
static const value_string cms_RevocationInfoChoice_vals[] = {
{ 0, "crl" },
{ 1, "other" },
{ 0, NULL }
};
static const ber_choice_t RevocationInfoChoice_choice[] = {
{ 0, &hf_cms_crl , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateList },
{ 1, &hf_cms_otherRIC , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_OtherRevocationInfoFormat },
{ 0, NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_RevocationInfoChoice(gboolean 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,
RevocationInfoChoice_choice, hf_index, ett_cms_RevocationInfoChoice,
NULL);
return offset;
}
static const ber_sequence_t RevocationInfoChoices_set_of[1] = {
{ &hf_cms_RevocationInfoChoices_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_RevocationInfoChoice },
};
static int
dissect_cms_RevocationInfoChoices(gboolean 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,
RevocationInfoChoices_set_of, hf_index, ett_cms_RevocationInfoChoices);
return offset;
}
static const ber_sequence_t IssuerAndSerialNumber_sequence[] = {
{ &hf_cms_issuer , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_x509if_Name },
{ &hf_cms_serialNumber , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateSerialNumber },
{ NULL, 0, 0, 0, NULL }
};
int
dissect_cms_IssuerAndSerialNumber(gboolean 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,
IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber);
return offset;
}
static int
dissect_cms_SubjectKeyIdentifier(gboolean 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;
}
const value_string cms_SignerIdentifier_vals[] = {
{ 0, "issuerAndSerialNumber" },
{ 1, "subjectKeyIdentifier" },
{ 0, NULL }
};
static const ber_choice_t SignerIdentifier_choice[] = {
{ 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
{ 1, &hf_cms_subjectKeyIdentifier, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
{ 0, NULL, 0, 0, 0, NULL }
};
int
dissect_cms_SignerIdentifier(gboolean 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,
SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier,
NULL);
return offset;
}
static const ber_sequence_t SignedAttributes_set_of[1] = {
{ &hf_cms_SignedAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
};
int
dissect_cms_SignedAttributes(gboolean 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_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1, NO_BOUND, SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes);
return offset;
}
int
dissect_cms_SignatureValue(gboolean 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 const ber_sequence_t UnsignedAttributes_set_of[1] = {
{ &hf_cms_UnsignedAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
};
int
dissect_cms_UnsignedAttributes(gboolean 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_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1, NO_BOUND, UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes);
return offset;
}
static const ber_sequence_t SignerInfo_sequence[] = {
{ &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
{ &hf_cms_sid , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_SignerIdentifier },
{ &hf_cms_digestAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
{ &hf_cms_signedAttrs , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_SignedAttributes },
{ &hf_cms_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureAlgorithmIdentifier },
{ &hf_cms_signatureValue , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureValue },
{ &hf_cms_unsignedAttrs , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnsignedAttributes },
{ NULL, 0, 0, 0, NULL }
};
int
dissect_cms_SignerInfo(gboolean 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,
SignerInfo_sequence, hf_index, ett_cms_SignerInfo);
return offset;
}
static const ber_sequence_t SignerInfos_set_of[1] = {
{ &hf_cms_SignerInfos_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignerInfo },
};
int
dissect_cms_SignerInfos(gboolean 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,
SignerInfos_set_of, hf_index, ett_cms_SignerInfos);
return offset;
}
static const ber_sequence_t SignedData_sequence[] = {
{ &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
{ &hf_cms_digestAlgorithms, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifiers },
{ &hf_cms_encapContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncapsulatedContentInfo },
{ &hf_cms_certificates , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_CertificateSet },
{ &hf_cms_crls , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_RevocationInfoChoices },
{ &hf_cms_signerInfos , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_SignerInfos },
{ NULL, 0, 0, 0, NULL }
};
int
dissect_cms_SignedData(gboolean 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,
SignedData_sequence, hf_index, ett_cms_SignedData);
return offset;
}
static const ber_sequence_t OriginatorInfo_sequence[] = {
{ &hf_cms_certs , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_CertificateSet },
{ &hf_cms_crls , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_RevocationInfoChoices },
{ NULL, 0, 0, 0, NULL }
};
static int
dissect_cms_OriginatorInfo(gboolean 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,
OriginatorInfo_sequence, hf_index, ett_cms_OriginatorInfo);
return offset;
}
static const value_string cms_RecipientIdentifier_vals[] = {
{ 0, "issuerAndSerialNumber" },