2004-07-20 09:11:40 +00:00
/* Do not modify this file. */
2006-05-24 12:24:54 +00:00
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
2007-01-12 00:33:32 +00:00
/* ./packet-cms.c */
2006-05-24 12:24:54 +00:00
/* ../../tools/asn2wrs.py -b -e -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */
2004-07-20 09:11:40 +00:00
/* Input file: packet-cms-template.c */
2005-12-05 23:00:03 +00:00
# line 1 "packet-cms-template.c"
2004-07-20 09:11:40 +00:00
/* packet-cms.c
* Routines for RFC2630 Cryptographic Message Syntax packet dissection
2004-11-22 03:36:26 +00:00
* Ronnie Sahlberg 2004
2004-07-20 09:11:40 +00:00
*
2005-07-09 02:58:07 +00:00
* $ Id $
2004-07-20 09:11:40 +00:00
*
2006-05-21 04:49:01 +00:00
* Wireshark - Network traffic analyzer
* By Gerald Combs < gerald @ wireshark . org >
2004-07-20 09:11:40 +00:00
* Copyright 1998 Gerald Combs
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
# include <glib.h>
# include <epan/packet.h>
# include <epan/conversation.h>
2006-07-01 00:11:49 +00:00
# include <epan/oid_resolv.h>
2004-07-20 09:11:40 +00:00
# include <stdio.h>
# include <string.h>
# include "packet-ber.h"
# include "packet-cms.h"
# include "packet-x509af.h"
2004-07-25 10:41:39 +00:00
# include "packet-x509if.h"
2004-07-20 09:11:40 +00:00
2007-01-12 00:33:32 +00:00
# include <epan/crypt/crypt-sha1.h>
2007-01-02 22:49:57 +00:00
# include <epan/crypt/crypt-md5.h>
2005-11-16 07:13:12 +00:00
2004-07-20 09:11:40 +00:00
# define PNAME "Cryptographic Message Syntax"
# define PSNAME "CMS"
# define PFNAME "cms"
/* Initialize the protocol and registered fields */
int proto_cms = - 1 ;
2004-09-16 09:01:20 +00:00
static int hf_cms_ci_contentType = - 1 ;
2004-07-20 09:11:40 +00:00
/*--- Included file: packet-cms-hf.c ---*/
2005-12-05 23:00:03 +00:00
# line 1 "packet-cms-hf.c"
2005-10-02 21:14:35 +00:00
static int hf_cms_ContentInfo_PDU = - 1 ; /* ContentInfo */
2005-10-03 05:17:51 +00:00
static int hf_cms_ContentType_PDU = - 1 ; /* ContentType */
2004-10-26 13:53:30 +00:00
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 */
2007-01-28 10:20:51 +00:00
static int hf_cms_IssuerAndSerialNumber_PDU = - 1 ; /* IssuerAndSerialNumber */
2005-10-03 05:17:51 +00:00
static int hf_cms_MessageDigest_PDU = - 1 ; /* MessageDigest */
static int hf_cms_SigningTime_PDU = - 1 ; /* SigningTime */
static int hf_cms_Countersignature_PDU = - 1 ; /* Countersignature */
2007-01-28 10:20:51 +00:00
static int hf_cms_RC2WrapParameter_PDU = - 1 ; /* RC2WrapParameter */
static int hf_cms_SMIMECapabilities_PDU = - 1 ; /* SMIMECapabilities */
static int hf_cms_SMIMEEncryptionKeyPreference_PDU = - 1 ; /* SMIMEEncryptionKeyPreference */
static int hf_cms_RC2CBCParameters_PDU = - 1 ; /* RC2CBCParameters */
2007-01-13 15:26:13 +00:00
static int hf_cms_contentType = - 1 ; /* ContentType */
2004-10-29 12:11:42 +00:00
static int hf_cms_content = - 1 ; /* T_content */
2004-07-20 09:11:40 +00:00
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 ; /* CertificateRevocationLists */
static int hf_cms_signerInfos = - 1 ; /* SignerInfos */
static int hf_cms_DigestAlgorithmIdentifiers_item = - 1 ; /* DigestAlgorithmIdentifier */
static int hf_cms_SignerInfos_item = - 1 ; /* SignerInfo */
2007-01-13 15:26:13 +00:00
static int hf_cms_eContentType = - 1 ; /* ContentType */
2004-10-29 12:11:42 +00:00
static int hf_cms_eContent = - 1 ; /* T_eContent */
2004-07-20 09:11:40 +00:00
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 */
2004-10-13 00:21:00 +00:00
static int hf_cms_signatureValue = - 1 ; /* SignatureValue */
2004-07-20 09:11:40 +00:00
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 */
2005-10-03 05:17:51 +00:00
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 */
2004-07-25 10:34:07 +00:00
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 */
2005-11-16 07:13:12 +00:00
static int hf_cms_encryptedContentType = - 1 ; /* ContentType */
2004-07-25 10:34:07 +00:00
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_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 */
2004-10-13 00:21:00 +00:00
static int hf_cms_rekRid = - 1 ; /* KeyAgreeRecipientIdentifier */
2004-07-25 10:34:07 +00:00
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_digest = - 1 ; /* Digest */
static int hf_cms_macAlgorithm = - 1 ; /* MessageAuthenticationCodeAlgorithm */
static int hf_cms_authenticatedAttributes = - 1 ; /* AuthAttributes */
static int hf_cms_mac = - 1 ; /* MessageAuthenticationCode */
static int hf_cms_unauthenticatedAttributes = - 1 ; /* UnauthAttributes */
2004-07-20 09:11:40 +00:00
static int hf_cms_AuthAttributes_item = - 1 ; /* Attribute */
static int hf_cms_UnauthAttributes_item = - 1 ; /* Attribute */
static int hf_cms_CertificateRevocationLists_item = - 1 ; /* CertificateList */
static int hf_cms_certificate = - 1 ; /* Certificate */
static int hf_cms_extendedCertificate = - 1 ; /* ExtendedCertificate */
static int hf_cms_attrCert = - 1 ; /* AttributeCertificate */
static int hf_cms_CertificateSet_item = - 1 ; /* CertificateChoices */
2004-07-25 10:41:39 +00:00
static int hf_cms_issuer = - 1 ; /* Name */
2004-07-20 09:11:40 +00:00
static int hf_cms_serialNumber = - 1 ; /* CertificateSerialNumber */
2004-10-29 12:11:42 +00:00
static int hf_cms_keyAttrId = - 1 ; /* T_keyAttrId */
static int hf_cms_keyAttr = - 1 ; /* T_keyAttr */
2005-10-03 05:17:51 +00:00
static int hf_cms_utcTime = - 1 ; /* UTCTime */
static int hf_cms_generalTime = - 1 ; /* GeneralizedTime */
2007-01-28 10:20:51 +00:00
static int hf_cms_rc2ParameterVersion = - 1 ; /* INTEGER */
static int hf_cms_iv = - 1 ; /* OCTET_STRING */
2004-07-20 09:11:40 +00:00
static int hf_cms_extendedCertificateInfo = - 1 ; /* ExtendedCertificateInfo */
2004-10-13 00:21:00 +00:00
static int hf_cms_signature = - 1 ; /* Signature */
2004-07-20 09:11:40 +00:00
static int hf_cms_attributes = - 1 ; /* UnauthAttributes */
2007-01-28 10:20:51 +00:00
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 */
2004-07-20 09:11:40 +00:00
/*--- End of included file: packet-cms-hf.c ---*/
2006-07-01 00:11:49 +00:00
# line 54 "packet-cms-template.c"
2004-07-20 09:11:40 +00:00
/* Initialize the subtree pointers */
/*--- Included file: packet-cms-ett.c ---*/
2005-12-05 23:00:03 +00:00
# line 1 "packet-cms-ett.c"
2004-10-29 12:11:42 +00:00
static gint ett_cms_ContentInfo = - 1 ;
2004-07-20 09:11:40 +00:00
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 ;
2005-10-03 05:17:51 +00:00
static gint ett_cms_SET_OF_AttributeValue = - 1 ;
2004-07-25 10:34:07 +00:00
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 ;
2004-07-20 09:11:40 +00:00
static gint ett_cms_RecipientIdentifier = - 1 ;
2004-07-25 10:34:07 +00:00
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_DigestedData = - 1 ;
static gint ett_cms_EncryptedData = - 1 ;
static gint ett_cms_AuthenticatedData = - 1 ;
2004-07-20 09:11:40 +00:00
static gint ett_cms_AuthAttributes = - 1 ;
static gint ett_cms_UnauthAttributes = - 1 ;
static gint ett_cms_CertificateRevocationLists = - 1 ;
static gint ett_cms_CertificateChoices = - 1 ;
static gint ett_cms_CertificateSet = - 1 ;
static gint ett_cms_IssuerAndSerialNumber = - 1 ;
2004-07-25 10:34:07 +00:00
static gint ett_cms_OtherKeyAttribute = - 1 ;
2005-10-03 05:17:51 +00:00
static gint ett_cms_Time = - 1 ;
2007-01-28 10:20:51 +00:00
static gint ett_cms_RC2CBCParameter = - 1 ;
2004-07-20 09:11:40 +00:00
static gint ett_cms_ExtendedCertificate = - 1 ;
static gint ett_cms_ExtendedCertificateInfo = - 1 ;
2007-01-28 10:20:51 +00:00
static gint ett_cms_SMIMECapabilities = - 1 ;
static gint ett_cms_SMIMECapability = - 1 ;
static gint ett_cms_SMIMEEncryptionKeyPreference = - 1 ;
static gint ett_cms_RC2CBCParameters = - 1 ;
2004-07-20 09:11:40 +00:00
/*--- End of included file: packet-cms-ett.c ---*/
2006-07-01 00:11:49 +00:00
# line 57 "packet-cms-template.c"
2004-07-20 09:11:40 +00:00
2006-05-24 12:24:54 +00:00
static int dissect_cms_OCTET_STRING ( gboolean implicit_tag _U_ , tvbuff_t * tvb , int offset , packet_info * pinfo _U_ , proto_tree * tree , int hf_index _U_ ) ; /* XXX kill a compiler warning until asn2wrs stops generating these silly wrappers */
2004-12-13 08:15:34 +00:00
2005-11-14 10:02:31 +00:00
static const char * object_identifier_id ;
2005-11-16 07:13:12 +00:00
static tvbuff_t * content_tvb = NULL ;
static proto_tree * top_tree = NULL ;
2007-01-28 10:20:51 +00:00
static proto_tree * cap_tree = NULL ;
2005-11-16 07:13:12 +00:00
# define HASH_SHA1 "1.3.14.3.2.26"
# define SHA1_BUFFER_SIZE 20
# define HASH_MD5 "1.2.840.113549.2.5"
# define MD5_BUFFER_SIZE 16
/* 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 ( SHA1_BUFFER_SIZE , MD5_BUFFER_SIZE ) ] ;
static void
2005-11-17 11:50:36 +00:00
cms_verify_msg_digest ( proto_item * pi , tvbuff_t * content , const char * alg , tvbuff_t * tvb , int offset )
2005-11-16 07:13:12 +00:00
{
sha1_context sha1_ctx ;
md5_state_t md5_ctx ;
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 ) {
sha1_starts ( & sha1_ctx ) ;
2007-01-02 22:49:57 +00:00
sha1_update ( & sha1_ctx , tvb_get_ptr ( content , 0 , tvb_length ( content ) ) ,
2005-11-16 07:13:12 +00:00
tvb_length ( content ) ) ;
sha1_finish ( & sha1_ctx , digest_buf ) ;
buffer_size = SHA1_BUFFER_SIZE ;
} else if ( strcmp ( alg , HASH_MD5 ) = = 0 ) {
md5_init ( & md5_ctx ) ;
2007-01-02 22:49:57 +00:00
md5_append ( & md5_ctx , tvb_get_ptr ( content , 0 , tvb_length ( content ) ) ,
2005-11-16 07:13:12 +00:00
tvb_length ( content ) ) ;
2007-01-02 22:49:57 +00:00
2005-11-16 07:13:12 +00:00
md5_finish ( & md5_ctx , digest_buf ) ;
buffer_size = MD5_BUFFER_SIZE ;
}
if ( buffer_size ) {
2007-01-02 22:49:57 +00:00
/* compare our computed hash with what we have received */
2005-11-16 07:13:12 +00:00
if ( tvb_bytes_exist ( tvb , offset , buffer_size ) & &
2007-01-02 22:49:57 +00:00
( memcmp ( tvb_get_ptr ( tvb , offset , buffer_size ) , digest_buf , buffer_size ) ! = 0 ) ) {
2005-11-16 07:13:12 +00:00
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] " ) ;
}
}
2004-07-25 10:34:07 +00:00
2004-07-20 09:11:40 +00:00
/*--- Included file: packet-cms-fn.c ---*/
2005-12-05 23:00:03 +00:00
# line 1 "packet-cms-fn.c"
2004-09-16 09:01:20 +00:00
/*--- Fields for imported types ---*/
2004-07-20 09:11:40 +00:00
2007-03-21 10:22:22 +00:00
static int dissect_algorithm ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_x509af_AlgorithmIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_algorithm ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_CertificateRevocationLists_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_x509af_CertificateList ( FALSE , tvb , offset , pinfo , tree , hf_cms_CertificateRevocationLists_item ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_certificate ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_x509af_Certificate ( FALSE , tvb , offset , pinfo , tree , hf_cms_certificate ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_attrCert_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_x509af_AttributeCertificate ( TRUE , tvb , offset , pinfo , tree , hf_cms_attrCert ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_issuer ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:41:39 +00:00
return dissect_x509if_Name ( FALSE , tvb , offset , pinfo , tree , hf_cms_issuer ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_serialNumber ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_x509af_CertificateSerialNumber ( FALSE , tvb , offset , pinfo , tree , hf_cms_serialNumber ) ;
}
2004-09-16 09:01:20 +00:00
2005-06-26 05:48:50 +00:00
2004-11-22 03:36:26 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_ContentType ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 73 "cms.cnf"
2007-01-13 15:26:13 +00:00
const char * name = NULL ;
2004-07-20 09:11:40 +00:00
2007-01-13 15:26:13 +00:00
offset = dissect_ber_object_identifier_str ( implicit_tag , pinfo , tree , tvb , offset , hf_index , & object_identifier_id ) ;
2004-10-29 12:11:42 +00:00
2007-01-13 15:26:13 +00:00
if ( object_identifier_id ) {
name = get_oid_str_name ( object_identifier_id ) ;
proto_item_append_text ( tree , " (%s) " , name ? name : object_identifier_id ) ;
}
2004-10-29 12:11:42 +00:00
2005-12-05 23:00:03 +00:00
2004-10-29 12:11:42 +00:00
return offset ;
2004-07-20 09:11:40 +00:00
}
2007-03-21 10:22:22 +00:00
static int dissect_contentType ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-13 15:26:13 +00:00
return dissect_cms_ContentType ( FALSE , tvb , offset , pinfo , tree , hf_cms_contentType ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_eContentType ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-13 15:26:13 +00:00
return dissect_cms_ContentType ( FALSE , tvb , offset , pinfo , tree , hf_cms_eContentType ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_encryptedContentType ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-13 15:26:13 +00:00
return dissect_cms_ContentType ( FALSE , tvb , offset , pinfo , tree , hf_cms_encryptedContentType ) ;
2004-10-29 12:11:42 +00:00
}
2004-11-06 02:06:55 +00:00
2004-10-29 12:11:42 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_T_content ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 83 "cms.cnf"
2004-10-29 12:11:42 +00:00
offset = call_ber_oid_callback ( object_identifier_id , tvb , offset , pinfo , tree ) ;
2005-12-05 23:00:03 +00:00
2007-01-13 15:26:13 +00:00
2004-10-29 12:11:42 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_content ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-29 12:11:42 +00:00
return dissect_cms_T_content ( FALSE , tvb , offset , pinfo , tree , hf_cms_content ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t ContentInfo_sequence [ ] = {
2004-10-29 12:11:42 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OID , BER_FLAGS_NOOWNTAG , dissect_contentType } ,
{ BER_CLASS_CON , 0 , 0 , dissect_content } ,
{ 0 , 0 , 0 , NULL }
} ;
int
2007-03-21 10:22:22 +00:00
dissect_cms_ContentInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 64 "cms.cnf"
2005-11-16 07:13:12 +00:00
top_tree = tree ;
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
ContentInfo_sequence , hf_index , ett_cms_ContentInfo ) ;
2004-10-29 12:11:42 +00:00
2005-11-16 07:13:12 +00:00
content_tvb = NULL ;
top_tree = NULL ;
2005-12-05 23:00:03 +00:00
2004-10-29 12:11:42 +00:00
return offset ;
2004-07-25 10:34:07 +00:00
}
2004-07-20 09:11:40 +00:00
2005-02-23 08:57:47 +00:00
static const value_string cms_CMSVersion_vals [ ] = {
2004-07-20 09:11:40 +00:00
{ 0 , " v0 " } ,
{ 1 , " v1 " } ,
{ 2 , " v2 " } ,
{ 3 , " v3 " } ,
{ 4 , " v4 " } ,
{ 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_CMSVersion ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-06-26 05:48:50 +00:00
offset = dissect_ber_integer ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_version ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_CMSVersion ( FALSE , tvb , offset , pinfo , tree , hf_cms_version ) ;
}
2005-09-02 05:43:49 +00:00
2007-01-13 15:26:13 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_DigestAlgorithmIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_x509af_AlgorithmIdentifier ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_DigestAlgorithmIdentifiers_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_DigestAlgorithmIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_DigestAlgorithmIdentifiers_item ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_digestAlgorithm ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_DigestAlgorithmIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_digestAlgorithm ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_digestAlgorithm_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-12 17:40:31 +00:00
return dissect_cms_DigestAlgorithmIdentifier ( TRUE , tvb , offset , pinfo , tree , hf_cms_digestAlgorithm ) ;
}
2004-07-20 09:11:40 +00:00
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t DigestAlgorithmIdentifiers_set_of [ 1 ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_DigestAlgorithmIdentifiers_item } ,
} ;
2004-11-22 03:36:26 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_DigestAlgorithmIdentifiers ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
DigestAlgorithmIdentifiers_set_of , hf_index , ett_cms_DigestAlgorithmIdentifiers ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_digestAlgorithms ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_DigestAlgorithmIdentifiers ( FALSE , tvb , offset , pinfo , tree , hf_cms_digestAlgorithms ) ;
}
2005-09-02 05:43:49 +00:00
2004-10-29 12:11:42 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_T_eContent ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 87 "cms.cnf"
2005-07-09 02:58:07 +00:00
gint8 class ;
2004-10-29 12:11:42 +00:00
gboolean pc , ind ;
2005-07-09 02:58:07 +00:00
gint32 tag ;
guint32 len ;
2004-10-29 12:11:42 +00:00
int pdu_offset = offset ;
2005-11-16 07:13:12 +00:00
int content_offset ;
2004-10-29 12:11:42 +00:00
/* XXX Do we care about printing out the octet string? */
2005-11-16 07:13:12 +00:00
offset = dissect_cms_OCTET_STRING ( FALSE , tvb , offset , pinfo , NULL , hf_cms_eContent ) ;
2004-10-29 12:11:42 +00:00
pdu_offset = get_ber_identifier ( tvb , pdu_offset , & class , & pc , & tag ) ;
2005-11-16 07:13:12 +00:00
content_offset = pdu_offset = get_ber_length ( tree , tvb , pdu_offset , & len , & ind ) ;
pdu_offset = call_ber_oid_callback ( object_identifier_id , tvb , pdu_offset , pinfo , top_tree ? top_tree : tree ) ;
2007-01-12 00:33:32 +00:00
2007-01-13 15:26:13 +00:00
/* save the content for checking the message digest */
2005-11-16 07:13:12 +00:00
content_tvb = tvb_new_subset ( tvb , content_offset , len , - 1 ) ;
2004-10-29 12:11:42 +00:00
2005-12-05 23:00:03 +00:00
2004-10-29 12:11:42 +00:00
return offset ;
2004-07-25 10:34:07 +00:00
}
2007-03-21 10:22:22 +00:00
static int dissect_eContent ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-29 12:11:42 +00:00
return dissect_cms_T_eContent ( FALSE , tvb , offset , pinfo , tree , hf_cms_eContent ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t EncapsulatedContentInfo_sequence [ ] = {
2004-10-29 12:11:42 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OID , BER_FLAGS_NOOWNTAG , dissect_eContentType } ,
{ BER_CLASS_CON , 0 , BER_FLAGS_OPTIONAL , dissect_eContent } ,
{ 0 , 0 , 0 , NULL }
} ;
2004-07-20 09:11:40 +00:00
2004-10-29 12:11:42 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_EncapsulatedContentInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-10-29 12:11:42 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
EncapsulatedContentInfo_sequence , hf_index , ett_cms_EncapsulatedContentInfo ) ;
2004-10-29 12:11:42 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_encapContentInfo ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_EncapsulatedContentInfo ( FALSE , tvb , offset , pinfo , tree , hf_cms_encapContentInfo ) ;
}
2005-06-26 05:48:50 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_T_attrType ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 115 "cms.cnf"
2005-12-06 22:59:30 +00:00
const char * name = NULL ;
2005-11-16 07:13:12 +00:00
offset = dissect_ber_object_identifier_str ( implicit_tag , pinfo , tree , tvb , offset , hf_cms_attrType , & object_identifier_id ) ;
if ( object_identifier_id ) {
2006-06-28 14:19:08 +00:00
name = get_oid_str_name ( object_identifier_id ) ;
2007-01-12 00:33:32 +00:00
proto_item_append_text ( tree , " (%s) " , name ? name : object_identifier_id ) ;
2005-11-16 07:13:12 +00:00
}
2004-07-20 09:11:40 +00:00
2005-12-05 23:00:03 +00:00
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_attrType ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2005-10-03 05:17:51 +00:00
return dissect_cms_T_attrType ( FALSE , tvb , offset , pinfo , tree , hf_cms_attrType ) ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_AttributeValue ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 125 "cms.cnf"
2005-10-03 05:17:51 +00:00
offset = call_ber_oid_callback ( object_identifier_id , tvb , offset , pinfo , tree ) ;
2005-12-05 23:00:03 +00:00
2005-10-03 05:17:51 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_attrValues_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2005-10-03 05:17:51 +00:00
return dissect_cms_AttributeValue ( FALSE , tvb , offset , pinfo , tree , hf_cms_attrValues_item ) ;
}
static const ber_sequence_t SET_OF_AttributeValue_set_of [ 1 ] = {
{ BER_CLASS_ANY , 0 , BER_FLAGS_NOOWNTAG , dissect_attrValues_item } ,
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_SET_OF_AttributeValue ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-10-03 05:17:51 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
SET_OF_AttributeValue_set_of , hf_index , ett_cms_SET_OF_AttributeValue ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_attrValues ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2005-10-03 05:17:51 +00:00
return dissect_cms_SET_OF_AttributeValue ( FALSE , tvb , offset , pinfo , tree , hf_cms_attrValues ) ;
2004-07-20 09:11:40 +00:00
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t Attribute_sequence [ ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OID , BER_FLAGS_NOOWNTAG , dissect_attrType } ,
2005-10-03 05:17:51 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SET , BER_FLAGS_NOOWNTAG , dissect_attrValues } ,
2004-07-20 09:11:40 +00:00
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_Attribute ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
Attribute_sequence , hf_index , ett_cms_Attribute ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_SignedAttributes_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_Attribute ( FALSE , tvb , offset , pinfo , tree , hf_cms_SignedAttributes_item ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_UnsignedAttributes_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_Attribute ( FALSE , tvb , offset , pinfo , tree , hf_cms_UnsignedAttributes_item ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_UnprotectedAttributes_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_Attribute ( FALSE , tvb , offset , pinfo , tree , hf_cms_UnprotectedAttributes_item ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_AuthAttributes_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_Attribute ( FALSE , tvb , offset , pinfo , tree , hf_cms_AuthAttributes_item ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_UnauthAttributes_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_Attribute ( FALSE , tvb , offset , pinfo , tree , hf_cms_UnauthAttributes_item ) ;
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t UnauthAttributes_set_of [ 1 ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_UnauthAttributes_item } ,
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_UnauthAttributes ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
UnauthAttributes_set_of , hf_index , ett_cms_UnauthAttributes ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_unauthenticatedAttributes_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_UnauthAttributes ( TRUE , tvb , offset , pinfo , tree , hf_cms_unauthenticatedAttributes ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_attributes ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_UnauthAttributes ( FALSE , tvb , offset , pinfo , tree , hf_cms_attributes ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t ExtendedCertificateInfo_sequence [ ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_certificate } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SET , BER_FLAGS_NOOWNTAG , dissect_attributes } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_ExtendedCertificateInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
ExtendedCertificateInfo_sequence , hf_index , ett_cms_ExtendedCertificateInfo ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_extendedCertificateInfo ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_ExtendedCertificateInfo ( FALSE , tvb , offset , pinfo , tree , hf_cms_extendedCertificateInfo ) ;
}
2005-09-02 05:43:49 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_SignatureAlgorithmIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_x509af_AlgorithmIdentifier ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_signatureAlgorithm ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_SignatureAlgorithmIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_signatureAlgorithm ) ;
}
2005-09-02 05:43:49 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_Signature ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_bitstring ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
NULL , hf_index , - 1 ,
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_signature ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-13 00:21:00 +00:00
return dissect_cms_Signature ( FALSE , tvb , offset , pinfo , tree , hf_cms_signature ) ;
2004-07-20 09:11:40 +00:00
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t ExtendedCertificate_sequence [ ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_extendedCertificateInfo } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_signatureAlgorithm } ,
2004-10-13 00:21:00 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_BITSTRING , BER_FLAGS_NOOWNTAG , dissect_signature } ,
2004-07-20 09:11:40 +00:00
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_ExtendedCertificate ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
ExtendedCertificate_sequence , hf_index , ett_cms_ExtendedCertificate ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_extendedCertificate_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_ExtendedCertificate ( TRUE , tvb , offset , pinfo , tree , hf_cms_extendedCertificate ) ;
}
2005-02-23 08:57:47 +00:00
static const value_string cms_CertificateChoices_vals [ ] = {
2004-07-20 09:11:40 +00:00
{ 0 , " certificate " } ,
{ 1 , " extendedCertificate " } ,
{ 2 , " attrCert " } ,
{ 0 , NULL }
} ;
2004-12-13 08:15:34 +00:00
static const ber_choice_t CertificateChoices_choice [ ] = {
2004-07-20 09:11:40 +00:00
{ 0 , BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_certificate } ,
{ 1 , BER_CLASS_CON , 0 , BER_FLAGS_IMPLTAG , dissect_extendedCertificate_impl } ,
{ 2 , BER_CLASS_CON , 1 , BER_FLAGS_IMPLTAG , dissect_attrCert_impl } ,
{ 0 , 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_CertificateChoices ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-07-21 21:12:09 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
CertificateChoices_choice , hf_index , ett_cms_CertificateChoices ,
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_CertificateSet_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_CertificateChoices ( FALSE , tvb , offset , pinfo , tree , hf_cms_CertificateSet_item ) ;
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t CertificateSet_set_of [ 1 ] = {
2005-09-02 05:43:49 +00:00
{ BER_CLASS_ANY /*choice*/ , - 1 /*choice*/ , BER_FLAGS_NOOWNTAG | BER_FLAGS_NOTCHKTAG , dissect_CertificateSet_item } ,
2004-07-20 09:11:40 +00:00
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_CertificateSet ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
CertificateSet_set_of , hf_index , ett_cms_CertificateSet ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_certificates_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_CertificateSet ( TRUE , tvb , offset , pinfo , tree , hf_cms_certificates ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_certs_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_CertificateSet ( TRUE , tvb , offset , pinfo , tree , hf_cms_certs ) ;
}
2004-07-20 09:11:40 +00:00
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t CertificateRevocationLists_set_of [ 1 ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_CertificateRevocationLists_item } ,
2004-07-20 09:11:40 +00:00
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_CertificateRevocationLists ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
CertificateRevocationLists_set_of , hf_index , ett_cms_CertificateRevocationLists ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_crls_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_CertificateRevocationLists ( TRUE , tvb , offset , pinfo , tree , hf_cms_crls ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t IssuerAndSerialNumber_sequence [ ] = {
2005-09-02 05:43:49 +00:00
{ BER_CLASS_ANY /*choice*/ , - 1 /*choice*/ , BER_FLAGS_NOOWNTAG , dissect_issuer } ,
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_serialNumber } ,
2004-07-20 09:11:40 +00:00
{ 0 , 0 , 0 , NULL }
} ;
2004-09-16 09:01:20 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_IssuerAndSerialNumber ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
IssuerAndSerialNumber_sequence , hf_index , ett_cms_IssuerAndSerialNumber ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_issuerAndSerialNumber ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_IssuerAndSerialNumber ( FALSE , tvb , offset , pinfo , tree , hf_cms_issuerAndSerialNumber ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_issuerAndSerialNumber_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_IssuerAndSerialNumber ( TRUE , tvb , offset , pinfo , tree , hf_cms_issuerAndSerialNumber ) ;
}
2004-07-20 09:11:40 +00:00
2005-07-09 02:58:07 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_SubjectKeyIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-07-09 02:58:07 +00:00
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_subjectKeyIdentifier ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_SubjectKeyIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_subjectKeyIdentifier ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_subjectKeyIdentifier_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-12 17:40:31 +00:00
return dissect_cms_SubjectKeyIdentifier ( TRUE , tvb , offset , pinfo , tree , hf_cms_subjectKeyIdentifier ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_subjectAltKeyIdentifier_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_SubjectKeyIdentifier ( TRUE , tvb , offset , pinfo , tree , hf_cms_subjectAltKeyIdentifier ) ;
}
2004-07-20 09:11:40 +00:00
2005-02-23 08:57:47 +00:00
const value_string cms_SignerIdentifier_vals [ ] = {
2004-07-20 09:11:40 +00:00
{ 0 , " issuerAndSerialNumber " } ,
{ 1 , " subjectKeyIdentifier " } ,
{ 0 , NULL }
} ;
2004-12-13 08:15:34 +00:00
static const ber_choice_t SignerIdentifier_choice [ ] = {
2004-07-20 09:11:40 +00:00
{ 0 , BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_issuerAndSerialNumber } ,
2006-06-28 14:19:08 +00:00
{ 1 , BER_CLASS_CON , 0 , BER_FLAGS_IMPLTAG , dissect_subjectKeyIdentifier_impl } ,
2004-07-20 09:11:40 +00:00
{ 0 , 0 , 0 , 0 , NULL }
} ;
2004-11-22 03:36:26 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_SignerIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-07-21 21:12:09 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
SignerIdentifier_choice , hf_index , ett_cms_SignerIdentifier ,
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_sid ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_SignerIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_sid ) ;
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t SignedAttributes_set_of [ 1 ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_SignedAttributes_item } ,
} ;
2004-11-22 03:36:26 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_SignedAttributes ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
SignedAttributes_set_of , hf_index , ett_cms_SignedAttributes ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_signedAttrs_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_SignedAttributes ( TRUE , tvb , offset , pinfo , tree , hf_cms_signedAttrs ) ;
}
2005-07-09 02:58:07 +00:00
2004-11-22 03:36:26 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_SignatureValue ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-07-09 02:58:07 +00:00
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_signatureValue ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-13 00:21:00 +00:00
return dissect_cms_SignatureValue ( FALSE , tvb , offset , pinfo , tree , hf_cms_signatureValue ) ;
2004-07-20 09:11:40 +00:00
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t UnsignedAttributes_set_of [ 1 ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_UnsignedAttributes_item } ,
} ;
2004-11-22 03:36:26 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_UnsignedAttributes ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
UnsignedAttributes_set_of , hf_index , ett_cms_UnsignedAttributes ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_unsignedAttrs_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_UnsignedAttributes ( TRUE , tvb , offset , pinfo , tree , hf_cms_unsignedAttrs ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t SignerInfo_sequence [ ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
2005-09-02 05:43:49 +00:00
{ BER_CLASS_ANY /*choice*/ , - 1 /*choice*/ , BER_FLAGS_NOOWNTAG | BER_FLAGS_NOTCHKTAG , dissect_sid } ,
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_digestAlgorithm } ,
{ BER_CLASS_CON , 0 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_signedAttrs_impl } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_signatureAlgorithm } ,
2004-10-13 00:21:00 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_signatureValue } ,
2004-07-20 09:11:40 +00:00
{ BER_CLASS_CON , 1 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_unsignedAttrs_impl } ,
{ 0 , 0 , 0 , NULL }
} ;
2004-11-22 03:36:26 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_SignerInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
SignerInfo_sequence , hf_index , ett_cms_SignerInfo ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_SignerInfos_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_SignerInfo ( FALSE , tvb , offset , pinfo , tree , hf_cms_SignerInfos_item ) ;
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t SignerInfos_set_of [ 1 ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_SignerInfos_item } ,
} ;
2004-11-22 03:36:26 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_SignerInfos ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
SignerInfos_set_of , hf_index , ett_cms_SignerInfos ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_signerInfos ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-20 09:11:40 +00:00
return dissect_cms_SignerInfos ( FALSE , tvb , offset , pinfo , tree , hf_cms_signerInfos ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t SignedData_sequence [ ] = {
2004-07-20 09:11:40 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SET , BER_FLAGS_NOOWNTAG , dissect_digestAlgorithms } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_encapContentInfo } ,
{ BER_CLASS_CON , 0 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_certificates_impl } ,
{ BER_CLASS_CON , 1 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_crls_impl } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SET , BER_FLAGS_NOOWNTAG , dissect_signerInfos } ,
{ 0 , 0 , 0 , NULL }
} ;
int
2007-03-21 10:22:22 +00:00
dissect_cms_SignedData ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
SignedData_sequence , hf_index , ett_cms_SignedData ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t OriginatorInfo_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_CON , 0 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_certs_impl } ,
{ BER_CLASS_CON , 1 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_crls_impl } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_OriginatorInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
OriginatorInfo_sequence , hf_index , ett_cms_OriginatorInfo ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_originatorInfo_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_OriginatorInfo ( TRUE , tvb , offset , pinfo , tree , hf_cms_originatorInfo ) ;
}
2004-07-20 09:11:40 +00:00
2005-02-23 08:57:47 +00:00
static const value_string cms_RecipientIdentifier_vals [ ] = {
2004-07-20 09:11:40 +00:00
{ 0 , " issuerAndSerialNumber " } ,
{ 1 , " subjectKeyIdentifier " } ,
{ 0 , NULL }
} ;
2004-12-13 08:15:34 +00:00
static const ber_choice_t RecipientIdentifier_choice [ ] = {
2004-07-20 09:11:40 +00:00
{ 0 , BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_issuerAndSerialNumber } ,
2006-06-28 14:19:08 +00:00
{ 1 , BER_CLASS_CON , 0 , BER_FLAGS_IMPLTAG , dissect_subjectKeyIdentifier_impl } ,
2004-07-20 09:11:40 +00:00
{ 0 , 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RecipientIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-07-21 21:12:09 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
RecipientIdentifier_choice , hf_index , ett_cms_RecipientIdentifier ,
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_rid ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_RecipientIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_rid ) ;
}
2004-07-20 09:11:40 +00:00
2005-09-02 05:43:49 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_KeyEncryptionAlgorithmIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_x509af_AlgorithmIdentifier ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_keyEncryptionAlgorithm ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_KeyEncryptionAlgorithmIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_keyEncryptionAlgorithm ) ;
}
2005-07-09 02:58:07 +00:00
2004-07-25 10:34:07 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_EncryptedKey ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-07-09 02:58:07 +00:00
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_encryptedKey ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_EncryptedKey ( FALSE , tvb , offset , pinfo , tree , hf_cms_encryptedKey ) ;
}
2004-07-20 09:11:40 +00:00
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t KeyTransRecipientInfo_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
2005-09-02 05:43:49 +00:00
{ BER_CLASS_ANY /*choice*/ , - 1 /*choice*/ , BER_FLAGS_NOOWNTAG | BER_FLAGS_NOTCHKTAG , dissect_rid } ,
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_keyEncryptionAlgorithm } ,
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_encryptedKey } ,
{ 0 , 0 , 0 , NULL }
2004-07-20 09:11:40 +00:00
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_KeyTransRecipientInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
KeyTransRecipientInfo_sequence , hf_index , ett_cms_KeyTransRecipientInfo ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_ktri ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_KeyTransRecipientInfo ( FALSE , tvb , offset , pinfo , tree , hf_cms_ktri ) ;
}
2004-07-20 09:11:40 +00:00
2005-09-02 05:43:49 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_BIT_STRING ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_bitstring ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
NULL , hf_index , - 1 ,
NULL ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_publicKey ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_BIT_STRING ( FALSE , tvb , offset , pinfo , tree , hf_cms_publicKey ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t OriginatorPublicKey_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_algorithm } ,
{ BER_CLASS_UNI , BER_UNI_TAG_BITSTRING , BER_FLAGS_NOOWNTAG , dissect_publicKey } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_OriginatorPublicKey ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
OriginatorPublicKey_sequence , hf_index , ett_cms_OriginatorPublicKey ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_originatorKey_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-12 17:40:31 +00:00
return dissect_cms_OriginatorPublicKey ( TRUE , tvb , offset , pinfo , tree , hf_cms_originatorKey ) ;
2004-07-25 10:34:07 +00:00
}
2005-02-23 08:57:47 +00:00
static const value_string cms_OriginatorIdentifierOrKey_vals [ ] = {
2004-07-25 10:34:07 +00:00
{ 0 , " issuerAndSerialNumber " } ,
{ 1 , " subjectKeyIdentifier " } ,
{ 2 , " originatorKey " } ,
{ 0 , NULL }
} ;
2004-12-13 08:15:34 +00:00
static const ber_choice_t OriginatorIdentifierOrKey_choice [ ] = {
2004-07-25 10:34:07 +00:00
{ 0 , BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_issuerAndSerialNumber } ,
2006-06-28 14:19:08 +00:00
{ 1 , BER_CLASS_CON , 0 , BER_FLAGS_IMPLTAG , dissect_subjectKeyIdentifier_impl } ,
{ 2 , BER_CLASS_CON , 1 , BER_FLAGS_IMPLTAG , dissect_originatorKey_impl } ,
2004-07-25 10:34:07 +00:00
{ 0 , 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_OriginatorIdentifierOrKey ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-07-21 21:12:09 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
OriginatorIdentifierOrKey_choice , hf_index , ett_cms_OriginatorIdentifierOrKey ,
NULL ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_originator ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_OriginatorIdentifierOrKey ( FALSE , tvb , offset , pinfo , tree , hf_cms_originator ) ;
}
2005-07-09 02:58:07 +00:00
2004-07-25 10:34:07 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_UserKeyingMaterial ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-07-09 02:58:07 +00:00
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_ukm ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_UserKeyingMaterial ( FALSE , tvb , offset , pinfo , tree , hf_cms_ukm ) ;
}
2004-07-20 09:11:40 +00:00
2005-09-02 05:43:49 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_GeneralizedTime ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-12-12 22:47:24 +00:00
offset = dissect_ber_GeneralizedTime ( implicit_tag , pinfo , tree , tvb , offset , hf_index ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_date ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_GeneralizedTime ( FALSE , tvb , offset , pinfo , tree , hf_cms_date ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_generalTime ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2005-10-03 05:17:51 +00:00
return dissect_cms_GeneralizedTime ( FALSE , tvb , offset , pinfo , tree , hf_cms_generalTime ) ;
}
2004-07-25 10:34:07 +00:00
2004-10-29 12:11:42 +00:00
2005-06-26 05:48:50 +00:00
2004-10-29 12:11:42 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_T_keyAttrId ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-11-14 10:02:31 +00:00
offset = dissect_ber_object_identifier_str ( implicit_tag , pinfo , tree , tvb , offset , hf_cms_ci_contentType , & object_identifier_id ) ;
2004-10-29 12:11:42 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_keyAttrId ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-29 12:11:42 +00:00
return dissect_cms_T_keyAttrId ( FALSE , tvb , offset , pinfo , tree , hf_cms_keyAttrId ) ;
}
2004-11-06 02:06:55 +00:00
2004-10-29 12:11:42 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_T_keyAttr ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 108 "cms.cnf"
2004-10-29 12:11:42 +00:00
offset = call_ber_oid_callback ( object_identifier_id , tvb , offset , pinfo , tree ) ;
2005-11-16 07:13:12 +00:00
2005-12-05 23:00:03 +00:00
2004-10-29 12:11:42 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_keyAttr ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-29 12:11:42 +00:00
return dissect_cms_T_keyAttr ( FALSE , tvb , offset , pinfo , tree , hf_cms_keyAttr ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t OtherKeyAttribute_sequence [ ] = {
2004-10-29 12:11:42 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OID , BER_FLAGS_NOOWNTAG , dissect_keyAttrId } ,
{ BER_CLASS_ANY , 0 , BER_FLAGS_OPTIONAL | BER_FLAGS_NOOWNTAG , dissect_keyAttr } ,
{ 0 , 0 , 0 , NULL }
} ;
2004-11-22 03:36:26 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_OtherKeyAttribute ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-10-29 12:11:42 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
OtherKeyAttribute_sequence , hf_index , ett_cms_OtherKeyAttribute ) ;
2004-10-29 12:11:42 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_other ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_OtherKeyAttribute ( FALSE , tvb , offset , pinfo , tree , hf_cms_other ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t RecipientKeyIdentifier_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_subjectKeyIdentifier } ,
{ BER_CLASS_UNI , BER_UNI_TAG_GeneralizedTime , BER_FLAGS_OPTIONAL | BER_FLAGS_NOOWNTAG , dissect_date } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_OPTIONAL | BER_FLAGS_NOOWNTAG , dissect_other } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RecipientKeyIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
RecipientKeyIdentifier_sequence , hf_index , ett_cms_RecipientKeyIdentifier ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_rKeyId_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_RecipientKeyIdentifier ( TRUE , tvb , offset , pinfo , tree , hf_cms_rKeyId ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_recipientKeyId_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_RecipientKeyIdentifier ( TRUE , tvb , offset , pinfo , tree , hf_cms_recipientKeyId ) ;
}
2004-07-25 10:34:07 +00:00
2005-02-23 08:57:47 +00:00
static const value_string cms_KeyAgreeRecipientIdentifier_vals [ ] = {
2004-07-25 10:34:07 +00:00
{ 0 , " issuerAndSerialNumber " } ,
{ 1 , " rKeyId " } ,
{ 0 , NULL }
} ;
2004-12-13 08:15:34 +00:00
static const ber_choice_t KeyAgreeRecipientIdentifier_choice [ ] = {
2004-07-25 10:34:07 +00:00
{ 0 , BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_issuerAndSerialNumber } ,
{ 1 , BER_CLASS_CON , 0 , BER_FLAGS_IMPLTAG , dissect_rKeyId_impl } ,
{ 0 , 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_KeyAgreeRecipientIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-07-21 21:12:09 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
KeyAgreeRecipientIdentifier_choice , hf_index , ett_cms_KeyAgreeRecipientIdentifier ,
NULL ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_rekRid ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-13 00:21:00 +00:00
return dissect_cms_KeyAgreeRecipientIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_rekRid ) ;
2004-07-25 10:34:07 +00:00
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t RecipientEncryptedKey_sequence [ ] = {
2005-09-02 05:43:49 +00:00
{ BER_CLASS_ANY /*choice*/ , - 1 /*choice*/ , BER_FLAGS_NOOWNTAG | BER_FLAGS_NOTCHKTAG , dissect_rekRid } ,
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_encryptedKey } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RecipientEncryptedKey ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
RecipientEncryptedKey_sequence , hf_index , ett_cms_RecipientEncryptedKey ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_RecipientEncryptedKeys_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_RecipientEncryptedKey ( FALSE , tvb , offset , pinfo , tree , hf_cms_RecipientEncryptedKeys_item ) ;
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t RecipientEncryptedKeys_sequence_of [ 1 ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_RecipientEncryptedKeys_item } ,
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RecipientEncryptedKeys ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
RecipientEncryptedKeys_sequence_of , hf_index , ett_cms_RecipientEncryptedKeys ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_recipientEncryptedKeys ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_RecipientEncryptedKeys ( FALSE , tvb , offset , pinfo , tree , hf_cms_recipientEncryptedKeys ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t KeyAgreeRecipientInfo_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
{ BER_CLASS_CON , 0 , BER_FLAGS_NOTCHKTAG , dissect_originator } ,
{ BER_CLASS_CON , 1 , BER_FLAGS_OPTIONAL , dissect_ukm } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_keyEncryptionAlgorithm } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_recipientEncryptedKeys } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_KeyAgreeRecipientInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
KeyAgreeRecipientInfo_sequence , hf_index , ett_cms_KeyAgreeRecipientInfo ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_kari_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-12 17:40:31 +00:00
return dissect_cms_KeyAgreeRecipientInfo ( TRUE , tvb , offset , pinfo , tree , hf_cms_kari ) ;
2004-07-25 10:34:07 +00:00
}
2004-10-29 12:11:42 +00:00
2005-07-09 02:58:07 +00:00
2004-10-29 12:11:42 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_OCTET_STRING ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-10-29 12:11:42 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-07-09 02:58:07 +00:00
NULL ) ;
2004-10-29 12:11:42 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_keyIdentifier ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-29 12:11:42 +00:00
return dissect_cms_OCTET_STRING ( FALSE , tvb , offset , pinfo , tree , hf_cms_keyIdentifier ) ;
}
2007-03-21 10:22:22 +00:00
static int dissect_iv ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_OCTET_STRING ( FALSE , tvb , offset , pinfo , tree , hf_cms_iv ) ;
}
2004-10-29 12:11:42 +00:00
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t KEKIdentifier_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_keyIdentifier } ,
{ BER_CLASS_UNI , BER_UNI_TAG_GeneralizedTime , BER_FLAGS_OPTIONAL | BER_FLAGS_NOOWNTAG , dissect_date } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_OPTIONAL | BER_FLAGS_NOOWNTAG , dissect_other } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_KEKIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
KEKIdentifier_sequence , hf_index , ett_cms_KEKIdentifier ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_kekid ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_KEKIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_kekid ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t KEKRecipientInfo_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_kekid } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_keyEncryptionAlgorithm } ,
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_encryptedKey } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_KEKRecipientInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
KEKRecipientInfo_sequence , hf_index , ett_cms_KEKRecipientInfo ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_kekri_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-10-12 17:40:31 +00:00
return dissect_cms_KEKRecipientInfo ( TRUE , tvb , offset , pinfo , tree , hf_cms_kekri ) ;
2004-07-25 10:34:07 +00:00
}
2005-02-23 08:57:47 +00:00
static const value_string cms_RecipientInfo_vals [ ] = {
2004-07-25 10:34:07 +00:00
{ 0 , " ktri " } ,
{ 1 , " kari " } ,
{ 2 , " kekri " } ,
{ 0 , NULL }
} ;
2004-12-13 08:15:34 +00:00
static const ber_choice_t RecipientInfo_choice [ ] = {
2004-07-25 10:34:07 +00:00
{ 0 , BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_ktri } ,
2006-06-28 14:19:08 +00:00
{ 1 , BER_CLASS_CON , 1 , BER_FLAGS_IMPLTAG , dissect_kari_impl } ,
{ 2 , BER_CLASS_CON , 2 , BER_FLAGS_IMPLTAG , dissect_kekri_impl } ,
2004-07-25 10:34:07 +00:00
{ 0 , 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RecipientInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-07-21 21:12:09 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
RecipientInfo_choice , hf_index , ett_cms_RecipientInfo ,
NULL ) ;
2004-07-20 09:11:40 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_RecipientInfos_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_RecipientInfo ( FALSE , tvb , offset , pinfo , tree , hf_cms_RecipientInfos_item ) ;
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t RecipientInfos_set_of [ 1 ] = {
2005-09-02 05:43:49 +00:00
{ BER_CLASS_ANY /*choice*/ , - 1 /*choice*/ , BER_FLAGS_NOOWNTAG | BER_FLAGS_NOTCHKTAG , dissect_RecipientInfos_item } ,
2004-07-25 10:34:07 +00:00
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RecipientInfos ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
RecipientInfos_set_of , hf_index , ett_cms_RecipientInfos ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_recipientInfos ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_RecipientInfos ( FALSE , tvb , offset , pinfo , tree , hf_cms_recipientInfos ) ;
}
2004-07-20 09:11:40 +00:00
2005-09-02 05:43:49 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_ContentEncryptionAlgorithmIdentifier ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_x509af_AlgorithmIdentifier ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_contentEncryptionAlgorithm ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_ContentEncryptionAlgorithmIdentifier ( FALSE , tvb , offset , pinfo , tree , hf_cms_contentEncryptionAlgorithm ) ;
}
2005-07-09 02:58:07 +00:00
2004-07-25 10:34:07 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_EncryptedContent ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-07-09 02:58:07 +00:00
NULL ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_encryptedContent_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_EncryptedContent ( TRUE , tvb , offset , pinfo , tree , hf_cms_encryptedContent ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t EncryptedContentInfo_sequence [ ] = {
2005-11-16 07:13:12 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_OID , BER_FLAGS_NOOWNTAG , dissect_encryptedContentType } ,
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_contentEncryptionAlgorithm } ,
{ BER_CLASS_CON , 0 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_encryptedContent_impl } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_EncryptedContentInfo ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
EncryptedContentInfo_sequence , hf_index , ett_cms_EncryptedContentInfo ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_encryptedContentInfo ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_EncryptedContentInfo ( FALSE , tvb , offset , pinfo , tree , hf_cms_encryptedContentInfo ) ;
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t UnprotectedAttributes_set_of [ 1 ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_UnprotectedAttributes_item } ,
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_UnprotectedAttributes ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
UnprotectedAttributes_set_of , hf_index , ett_cms_UnprotectedAttributes ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_unprotectedAttrs_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_UnprotectedAttributes ( TRUE , tvb , offset , pinfo , tree , hf_cms_unprotectedAttrs ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t EnvelopedData_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
{ BER_CLASS_CON , 0 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_originatorInfo_impl } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SET , BER_FLAGS_NOOWNTAG , dissect_recipientInfos } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_encryptedContentInfo } ,
{ BER_CLASS_CON , 1 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_unprotectedAttrs_impl } ,
{ 0 , 0 , 0 , NULL }
} ;
2004-12-24 11:24:35 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_EnvelopedData ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
EnvelopedData_sequence , hf_index , ett_cms_EnvelopedData ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2005-07-09 02:58:07 +00:00
2007-01-13 15:26:13 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_Digest ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-07-09 02:58:07 +00:00
NULL ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_digest ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_Digest ( FALSE , tvb , offset , pinfo , tree , hf_cms_digest ) ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t DigestedData_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_digestAlgorithm } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_encapContentInfo } ,
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_digest } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_DigestedData ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
DigestedData_sequence , hf_index , ett_cms_DigestedData ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t EncryptedData_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_encryptedContentInfo } ,
{ BER_CLASS_CON , 1 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_unprotectedAttrs_impl } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_EncryptedData ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
EncryptedData_sequence , hf_index , ett_cms_EncryptedData ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2004-07-20 09:11:40 +00:00
2005-09-02 05:43:49 +00:00
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_MessageAuthenticationCodeAlgorithm ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_x509af_AlgorithmIdentifier ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_macAlgorithm ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_MessageAuthenticationCodeAlgorithm ( FALSE , tvb , offset , pinfo , tree , hf_cms_macAlgorithm ) ;
}
2005-07-21 21:12:09 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t AuthAttributes_set_of [ 1 ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_AuthAttributes_item } ,
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_AuthAttributes ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_set_of ( implicit_tag , pinfo , tree , tvb , offset ,
2005-07-21 21:12:09 +00:00
AuthAttributes_set_of , hf_index , ett_cms_AuthAttributes ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_authenticatedAttributes_impl ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_AuthAttributes ( TRUE , tvb , offset , pinfo , tree , hf_cms_authenticatedAttributes ) ;
}
2005-07-09 02:58:07 +00:00
2004-07-25 10:34:07 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_MessageAuthenticationCode ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-07-09 02:58:07 +00:00
NULL ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_mac ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2004-07-25 10:34:07 +00:00
return dissect_cms_MessageAuthenticationCode ( FALSE , tvb , offset , pinfo , tree , hf_cms_mac ) ;
}
2004-07-20 09:11:40 +00:00
2005-09-02 05:43:49 +00:00
2004-12-13 08:15:34 +00:00
static const ber_sequence_t AuthenticatedData_sequence [ ] = {
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_version } ,
{ BER_CLASS_CON , 0 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_originatorInfo_impl } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SET , BER_FLAGS_NOOWNTAG , dissect_recipientInfos } ,
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_macAlgorithm } ,
2004-10-12 17:40:31 +00:00
{ BER_CLASS_CON , 1 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_digestAlgorithm_impl } ,
2004-07-25 10:34:07 +00:00
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_encapContentInfo } ,
{ BER_CLASS_CON , 2 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_authenticatedAttributes_impl } ,
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_mac } ,
{ BER_CLASS_CON , 3 , BER_FLAGS_OPTIONAL | BER_FLAGS_IMPLTAG , dissect_unauthenticatedAttributes_impl } ,
{ 0 , 0 , 0 , NULL }
} ;
2004-07-20 09:11:40 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_AuthenticatedData ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-25 10:34:07 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
2005-09-02 05:43:49 +00:00
AuthenticatedData_sequence , hf_index , ett_cms_AuthenticatedData ) ;
2004-07-25 10:34:07 +00:00
return offset ;
}
2005-09-02 05:43:49 +00:00
2005-10-03 05:17:51 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_MessageDigest ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 129 "cms.cnf"
2005-11-16 07:13:12 +00:00
proto_item * pi ;
int old_offset = offset ;
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
2005-10-03 05:17:51 +00:00
NULL ) ;
2007-01-12 00:33:32 +00:00
2005-11-16 07:13:12 +00:00
pi = get_ber_last_created_item ( ) ;
/* move past TLV */
old_offset = get_ber_identifier ( tvb , old_offset , NULL , NULL , NULL ) ;
old_offset = get_ber_length ( tree , tvb , old_offset , NULL , NULL ) ;
2007-01-12 00:33:32 +00:00
if ( content_tvb )
2005-11-16 07:13:12 +00:00
cms_verify_msg_digest ( pi , content_tvb , x509af_get_last_algorithm_id ( ) , tvb , old_offset ) ;
2005-12-05 23:00:03 +00:00
2005-10-03 05:17:51 +00:00
return offset ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_UTCTime ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-10-03 05:17:51 +00:00
offset = dissect_ber_restricted_string ( implicit_tag , BER_UNI_TAG_UTCTime ,
pinfo , tree , tvb , offset , hf_index ,
NULL ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_utcTime ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2005-10-03 05:17:51 +00:00
return dissect_cms_UTCTime ( FALSE , tvb , offset , pinfo , tree , hf_cms_utcTime ) ;
}
static const value_string cms_Time_vals [ ] = {
{ 0 , " utcTime " } ,
{ 1 , " generalTime " } ,
{ 0 , NULL }
} ;
static const ber_choice_t Time_choice [ ] = {
{ 0 , BER_CLASS_UNI , BER_UNI_TAG_UTCTime , BER_FLAGS_NOOWNTAG , dissect_utcTime } ,
{ 1 , BER_CLASS_UNI , BER_UNI_TAG_GeneralizedTime , BER_FLAGS_NOOWNTAG , dissect_generalTime } ,
{ 0 , 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_Time ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-10-03 05:17:51 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
Time_choice , hf_index , ett_cms_Time ,
NULL ) ;
return offset ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_SigningTime ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2005-10-03 05:17:51 +00:00
offset = dissect_cms_Time ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
2004-12-13 08:15:34 +00:00
int
2007-03-21 10:22:22 +00:00
dissect_cms_Countersignature ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2004-07-20 09:11:40 +00:00
offset = dissect_cms_SignerInfo ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
2007-01-28 10:20:51 +00:00
static int
2007-03-21 10:22:22 +00:00
dissect_cms_KeyWrapAlgorithm ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_x509af_AlgorithmIdentifier ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RC2ParameterVersion ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 166 "cms.cnf"
2007-01-28 10:20:51 +00:00
guint32 length = 0 ;
offset = dissect_ber_integer ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
& length ) ;
if ( cap_tree ! = NULL )
proto_item_append_text ( cap_tree , " (%d bits) " , length ) ;
return offset ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RC2WrapParameter ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_cms_RC2ParameterVersion ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_rc2WrapParameter ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_RC2WrapParameter ( FALSE , tvb , offset , pinfo , tree , hf_cms_rc2WrapParameter ) ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_IV ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_ber_octet_string ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
NULL ) ;
return offset ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_CBCParameter ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_cms_IV ( implicit_tag , tvb , offset , pinfo , tree , hf_index ) ;
return offset ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_INTEGER ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_ber_integer ( implicit_tag , pinfo , tree , tvb , offset , hf_index ,
NULL ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_rc2ParameterVersion ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_INTEGER ( FALSE , tvb , offset , pinfo , tree , hf_cms_rc2ParameterVersion ) ;
}
static const ber_sequence_t RC2CBCParameter_sequence [ ] = {
{ BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_rc2ParameterVersion } ,
{ BER_CLASS_UNI , BER_UNI_TAG_OCTETSTRING , BER_FLAGS_NOOWNTAG , dissect_iv } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RC2CBCParameter ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
RC2CBCParameter_sequence , hf_index , ett_cms_RC2CBCParameter ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_rc2CBCParameter ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_RC2CBCParameter ( FALSE , tvb , offset , pinfo , tree , hf_cms_rc2CBCParameter ) ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_T_capability ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 147 "cms.cnf"
2007-01-28 10:20:51 +00:00
const char * name = NULL ;
offset = dissect_ber_object_identifier_str ( implicit_tag , pinfo , tree , tvb , offset , hf_cms_attrType , & object_identifier_id ) ;
if ( object_identifier_id ) {
name = get_oid_str_name ( object_identifier_id ) ;
proto_item_append_text ( tree , " %s " , name ? name : object_identifier_id ) ;
cap_tree = tree ;
}
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_capability ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_T_capability ( FALSE , tvb , offset , pinfo , tree , hf_cms_capability ) ;
}
static int
2007-03-21 10:22:22 +00:00
dissect_cms_T_parameters ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-03-23 16:45:49 +00:00
# line 158 "cms.cnf"
2007-01-28 10:20:51 +00:00
offset = call_ber_oid_callback ( object_identifier_id , tvb , offset , pinfo , tree ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_parameters ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_T_parameters ( FALSE , tvb , offset , pinfo , tree , hf_cms_parameters ) ;
}
static const ber_sequence_t SMIMECapability_sequence [ ] = {
{ BER_CLASS_UNI , BER_UNI_TAG_OID , BER_FLAGS_NOOWNTAG , dissect_capability } ,
{ BER_CLASS_ANY , 0 , BER_FLAGS_OPTIONAL | BER_FLAGS_NOOWNTAG , dissect_parameters } ,
{ 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_SMIMECapability ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_ber_sequence ( implicit_tag , pinfo , tree , tvb , offset ,
SMIMECapability_sequence , hf_index , ett_cms_SMIMECapability ) ;
return offset ;
}
2007-03-21 10:22:22 +00:00
static int dissect_SMIMECapabilities_item ( packet_info * pinfo _U_ , proto_tree * tree _U_ , tvbuff_t * tvb _U_ , int offset _U_ ) {
2007-01-28 10:20:51 +00:00
return dissect_cms_SMIMECapability ( FALSE , tvb , offset , pinfo , tree , hf_cms_SMIMECapabilities_item ) ;
}
static const ber_sequence_t SMIMECapabilities_sequence_of [ 1 ] = {
{ BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_SMIMECapabilities_item } ,
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_SMIMECapabilities ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_ber_sequence_of ( implicit_tag , pinfo , tree , tvb , offset ,
SMIMECapabilities_sequence_of , hf_index , ett_cms_SMIMECapabilities ) ;
return offset ;
}
static const value_string cms_SMIMEEncryptionKeyPreference_vals [ ] = {
{ 0 , " issuerAndSerialNumber " } ,
{ 1 , " recipientKeyId " } ,
{ 2 , " subjectAltKeyIdentifier " } ,
{ 0 , NULL }
} ;
static const ber_choice_t SMIMEEncryptionKeyPreference_choice [ ] = {
{ 0 , BER_CLASS_CON , 0 , BER_FLAGS_IMPLTAG , dissect_issuerAndSerialNumber_impl } ,
{ 1 , BER_CLASS_CON , 1 , BER_FLAGS_IMPLTAG , dissect_recipientKeyId_impl } ,
{ 2 , BER_CLASS_CON , 2 , BER_FLAGS_IMPLTAG , dissect_subjectAltKeyIdentifier_impl } ,
{ 0 , 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_SMIMEEncryptionKeyPreference ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
SMIMEEncryptionKeyPreference_choice , hf_index , ett_cms_SMIMEEncryptionKeyPreference ,
NULL ) ;
return offset ;
}
static const value_string cms_RC2CBCParameters_vals [ ] = {
{ 0 , " rc2WrapParameter " } ,
{ 1 , " rc2CBCParameter " } ,
{ 0 , NULL }
} ;
static const ber_choice_t RC2CBCParameters_choice [ ] = {
{ 0 , BER_CLASS_UNI , BER_UNI_TAG_INTEGER , BER_FLAGS_NOOWNTAG , dissect_rc2WrapParameter } ,
{ 1 , BER_CLASS_UNI , BER_UNI_TAG_SEQUENCE , BER_FLAGS_NOOWNTAG , dissect_rc2CBCParameter } ,
{ 0 , 0 , 0 , 0 , NULL }
} ;
static int
2007-03-21 10:22:22 +00:00
dissect_cms_RC2CBCParameters ( gboolean implicit_tag _U_ , tvbuff_t * tvb _U_ , int offset _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2007-01-28 10:20:51 +00:00
offset = dissect_ber_choice ( pinfo , tree , tvb , offset ,
RC2CBCParameters_choice , hf_index , ett_cms_RC2CBCParameters ,
NULL ) ;
return offset ;
}
2004-10-26 13:53:30 +00:00
/*--- PDUs ---*/
2007-03-21 10:22:22 +00:00
static void dissect_ContentInfo_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2005-10-02 21:14:35 +00:00
dissect_cms_ContentInfo ( FALSE , tvb , 0 , pinfo , tree , hf_cms_ContentInfo_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_ContentType_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2005-10-03 05:17:51 +00:00
dissect_cms_ContentType ( FALSE , tvb , 0 , pinfo , tree , hf_cms_ContentType_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_SignedData_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2004-10-26 13:53:30 +00:00
dissect_cms_SignedData ( FALSE , tvb , 0 , pinfo , tree , hf_cms_SignedData_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_EnvelopedData_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2004-10-26 13:53:30 +00:00
dissect_cms_EnvelopedData ( FALSE , tvb , 0 , pinfo , tree , hf_cms_EnvelopedData_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_DigestedData_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2004-10-26 13:53:30 +00:00
dissect_cms_DigestedData ( FALSE , tvb , 0 , pinfo , tree , hf_cms_DigestedData_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_EncryptedData_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2004-10-26 13:53:30 +00:00
dissect_cms_EncryptedData ( FALSE , tvb , 0 , pinfo , tree , hf_cms_EncryptedData_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_AuthenticatedData_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2004-10-26 13:53:30 +00:00
dissect_cms_AuthenticatedData ( FALSE , tvb , 0 , pinfo , tree , hf_cms_AuthenticatedData_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_IssuerAndSerialNumber_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2007-01-28 10:20:51 +00:00
dissect_cms_IssuerAndSerialNumber ( FALSE , tvb , 0 , pinfo , tree , hf_cms_IssuerAndSerialNumber_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_MessageDigest_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2005-10-03 05:17:51 +00:00
dissect_cms_MessageDigest ( FALSE , tvb , 0 , pinfo , tree , hf_cms_MessageDigest_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_SigningTime_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2005-10-03 05:17:51 +00:00
dissect_cms_SigningTime ( FALSE , tvb , 0 , pinfo , tree , hf_cms_SigningTime_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_Countersignature_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2005-10-03 05:17:51 +00:00
dissect_cms_Countersignature ( FALSE , tvb , 0 , pinfo , tree , hf_cms_Countersignature_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_RC2WrapParameter_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2007-01-28 10:20:51 +00:00
dissect_cms_RC2WrapParameter ( FALSE , tvb , 0 , pinfo , tree , hf_cms_RC2WrapParameter_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_SMIMECapabilities_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2007-01-28 10:20:51 +00:00
dissect_cms_SMIMECapabilities ( FALSE , tvb , 0 , pinfo , tree , hf_cms_SMIMECapabilities_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_SMIMEEncryptionKeyPreference_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2007-01-28 10:20:51 +00:00
dissect_cms_SMIMEEncryptionKeyPreference ( FALSE , tvb , 0 , pinfo , tree , hf_cms_SMIMEEncryptionKeyPreference_PDU ) ;
}
2007-03-21 10:22:22 +00:00
static void dissect_RC2CBCParameters_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
2007-01-28 10:20:51 +00:00
dissect_cms_RC2CBCParameters ( FALSE , tvb , 0 , pinfo , tree , hf_cms_RC2CBCParameters_PDU ) ;
}
2004-10-26 13:53:30 +00:00
2004-07-20 09:11:40 +00:00
/*--- End of included file: packet-cms-fn.c ---*/
2007-01-28 10:20:51 +00:00
# line 135 "packet-cms-template.c"
2004-07-20 09:11:40 +00:00
/*--- proto_register_cms ----------------------------------------------*/
void proto_register_cms ( void ) {
/* List of fields */
static hf_register_info hf [ ] = {
2004-09-16 09:01:20 +00:00
{ & hf_cms_ci_contentType ,
{ " contentType " , " cms.contentInfo.contentType " ,
2006-05-10 19:50:54 +00:00
FT_OID , BASE_NONE , NULL , 0 ,
2004-09-16 09:01:20 +00:00
" ContentType " , HFILL } } ,
2004-07-20 09:11:40 +00:00
/*--- Included file: packet-cms-hfarr.c ---*/
2005-12-05 23:00:03 +00:00
# line 1 "packet-cms-hfarr.c"
2005-10-02 21:14:35 +00:00
{ & hf_cms_ContentInfo_PDU ,
{ " ContentInfo " , " cms.ContentInfo " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.ContentInfo " , HFILL } } ,
2005-10-03 05:17:51 +00:00
{ & hf_cms_ContentType_PDU ,
{ " ContentType " , " cms.ContentType " ,
2005-12-05 23:00:03 +00:00
FT_OID , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.ContentType " , HFILL } } ,
2004-10-26 13:53:30 +00:00
{ & hf_cms_SignedData_PDU ,
{ " SignedData " , " cms.SignedData " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SignedData " , HFILL } } ,
2004-10-26 13:53:30 +00:00
{ & hf_cms_EnvelopedData_PDU ,
{ " EnvelopedData " , " cms.EnvelopedData " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.EnvelopedData " , HFILL } } ,
2004-10-26 13:53:30 +00:00
{ & hf_cms_DigestedData_PDU ,
{ " DigestedData " , " cms.DigestedData " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.DigestedData " , HFILL } } ,
2004-10-26 13:53:30 +00:00
{ & hf_cms_EncryptedData_PDU ,
{ " EncryptedData " , " cms.EncryptedData " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.EncryptedData " , HFILL } } ,
2004-10-26 13:53:30 +00:00
{ & hf_cms_AuthenticatedData_PDU ,
{ " AuthenticatedData " , " cms.AuthenticatedData " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.AuthenticatedData " , HFILL } } ,
2007-01-28 10:20:51 +00:00
{ & hf_cms_IssuerAndSerialNumber_PDU ,
{ " IssuerAndSerialNumber " , " cms.IssuerAndSerialNumber " ,
FT_NONE , BASE_NONE , NULL , 0 ,
" cms.IssuerAndSerialNumber " , HFILL } } ,
2005-10-03 05:17:51 +00:00
{ & hf_cms_MessageDigest_PDU ,
{ " MessageDigest " , " cms.MessageDigest " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.MessageDigest " , HFILL } } ,
2005-10-03 05:17:51 +00:00
{ & hf_cms_SigningTime_PDU ,
{ " SigningTime " , " cms.SigningTime " ,
FT_UINT32 , BASE_DEC , VALS ( x509af_Time_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SigningTime " , HFILL } } ,
2005-10-03 05:17:51 +00:00
{ & hf_cms_Countersignature_PDU ,
{ " Countersignature " , " cms.Countersignature " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.Countersignature " , HFILL } } ,
2007-01-28 10:20:51 +00:00
{ & hf_cms_RC2WrapParameter_PDU ,
{ " RC2WrapParameter " , " cms.RC2WrapParameter " ,
FT_INT32 , BASE_DEC , NULL , 0 ,
" cms.RC2WrapParameter " , HFILL } } ,
{ & hf_cms_SMIMECapabilities_PDU ,
{ " SMIMECapabilities " , " cms.SMIMECapabilities " ,
FT_UINT32 , BASE_DEC , NULL , 0 ,
" cms.SMIMECapabilities " , HFILL } } ,
{ & hf_cms_SMIMEEncryptionKeyPreference_PDU ,
{ " SMIMEEncryptionKeyPreference " , " cms.SMIMEEncryptionKeyPreference " ,
FT_UINT32 , BASE_DEC , VALS ( cms_SMIMEEncryptionKeyPreference_vals ) , 0 ,
" cms.SMIMEEncryptionKeyPreference " , HFILL } } ,
{ & hf_cms_RC2CBCParameters_PDU ,
{ " RC2CBCParameters " , " cms.RC2CBCParameters " ,
FT_UINT32 , BASE_DEC , VALS ( cms_RC2CBCParameters_vals ) , 0 ,
" cms.RC2CBCParameters " , HFILL } } ,
2004-10-29 12:11:42 +00:00
{ & hf_cms_contentType ,
{ " contentType " , " cms.contentType " ,
2005-12-05 23:00:03 +00:00
FT_OID , BASE_NONE , NULL , 0 ,
2007-01-13 15:26:13 +00:00
" cms.ContentType " , HFILL } } ,
2004-10-29 12:11:42 +00:00
{ & hf_cms_content ,
{ " content " , " cms.content " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.T_content " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_version ,
{ " version " , " cms.version " ,
2005-02-23 08:57:47 +00:00
FT_INT32 , BASE_DEC , VALS ( cms_CMSVersion_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" cms.CMSVersion " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_digestAlgorithms ,
{ " digestAlgorithms " , " cms.digestAlgorithms " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.DigestAlgorithmIdentifiers " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_encapContentInfo ,
{ " encapContentInfo " , " cms.encapContentInfo " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.EncapsulatedContentInfo " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_certificates ,
{ " certificates " , " cms.certificates " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.CertificateSet " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_crls ,
{ " crls " , " cms.crls " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.CertificateRevocationLists " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_signerInfos ,
{ " signerInfos " , " cms.signerInfos " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SignerInfos " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_DigestAlgorithmIdentifiers_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.DigestAlgorithmIdentifiers_item " ,
2004-07-20 09:11:40 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.DigestAlgorithmIdentifier " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_SignerInfos_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.SignerInfos_item " ,
2004-07-20 09:11:40 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SignerInfo " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_eContentType ,
{ " eContentType " , " cms.eContentType " ,
2005-12-05 23:00:03 +00:00
FT_OID , BASE_NONE , NULL , 0 ,
2007-01-13 15:26:13 +00:00
" cms.ContentType " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_eContent ,
{ " eContent " , " cms.eContent " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.T_eContent " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_sid ,
{ " sid " , " cms.sid " ,
2005-02-23 08:57:47 +00:00
FT_UINT32 , BASE_DEC , VALS ( cms_SignerIdentifier_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SignerIdentifier " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_digestAlgorithm ,
{ " digestAlgorithm " , " cms.digestAlgorithm " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.DigestAlgorithmIdentifier " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_signedAttrs ,
{ " signedAttrs " , " cms.signedAttrs " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SignedAttributes " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_signatureAlgorithm ,
{ " signatureAlgorithm " , " cms.signatureAlgorithm " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SignatureAlgorithmIdentifier " , HFILL } } ,
2004-10-13 00:21:00 +00:00
{ & hf_cms_signatureValue ,
2004-07-20 09:11:40 +00:00
{ " signature " , " cms.signature " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SignatureValue " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_unsignedAttrs ,
{ " unsignedAttrs " , " cms.unsignedAttrs " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.UnsignedAttributes " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_issuerAndSerialNumber ,
{ " issuerAndSerialNumber " , " cms.issuerAndSerialNumber " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.IssuerAndSerialNumber " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_subjectKeyIdentifier ,
{ " subjectKeyIdentifier " , " cms.subjectKeyIdentifier " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SubjectKeyIdentifier " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_SignedAttributes_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.SignedAttributes_item " ,
2004-07-20 09:11:40 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.Attribute " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_UnsignedAttributes_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.UnsignedAttributes_item " ,
2004-07-20 09:11:40 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.Attribute " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_attrType ,
{ " attrType " , " cms.attrType " ,
2005-12-05 23:00:03 +00:00
FT_OID , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.T_attrType " , HFILL } } ,
2005-10-03 05:17:51 +00:00
{ & hf_cms_attrValues ,
{ " attrValues " , " cms.attrValues " ,
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.SET_OF_AttributeValue " , HFILL } } ,
2005-10-03 05:17:51 +00:00
{ & hf_cms_attrValues_item ,
{ " Item " , " cms.attrValues_item " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.AttributeValue " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_originatorInfo ,
{ " originatorInfo " , " cms.originatorInfo " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.OriginatorInfo " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_recipientInfos ,
{ " recipientInfos " , " cms.recipientInfos " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.RecipientInfos " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_encryptedContentInfo ,
{ " encryptedContentInfo " , " cms.encryptedContentInfo " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.EncryptedContentInfo " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_unprotectedAttrs ,
{ " unprotectedAttrs " , " cms.unprotectedAttrs " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.UnprotectedAttributes " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_certs ,
{ " certs " , " cms.certs " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.CertificateSet " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_RecipientInfos_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.RecipientInfos_item " ,
2005-02-23 08:57:47 +00:00
FT_UINT32 , BASE_DEC , VALS ( cms_RecipientInfo_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" cms.RecipientInfo " , HFILL } } ,
2005-11-16 07:13:12 +00:00
{ & hf_cms_encryptedContentType ,
2004-07-25 10:34:07 +00:00
{ " contentType " , " cms.contentType " ,
2005-12-05 23:00:03 +00:00
FT_OID , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.ContentType " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_contentEncryptionAlgorithm ,
{ " contentEncryptionAlgorithm " , " cms.contentEncryptionAlgorithm " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.ContentEncryptionAlgorithmIdentifier " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_encryptedContent ,
{ " encryptedContent " , " cms.encryptedContent " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.EncryptedContent " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_UnprotectedAttributes_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.UnprotectedAttributes_item " ,
2004-07-25 10:34:07 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.Attribute " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_ktri ,
{ " ktri " , " cms.ktri " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.KeyTransRecipientInfo " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_kari ,
{ " kari " , " cms.kari " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.KeyAgreeRecipientInfo " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_kekri ,
{ " kekri " , " cms.kekri " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.KEKRecipientInfo " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_rid ,
{ " rid " , " cms.rid " ,
2005-02-23 08:57:47 +00:00
FT_UINT32 , BASE_DEC , VALS ( cms_RecipientIdentifier_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" cms.RecipientIdentifier " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_keyEncryptionAlgorithm ,
{ " keyEncryptionAlgorithm " , " cms.keyEncryptionAlgorithm " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.KeyEncryptionAlgorithmIdentifier " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_encryptedKey ,
{ " encryptedKey " , " cms.encryptedKey " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.EncryptedKey " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_originator ,
{ " originator " , " cms.originator " ,
2005-02-23 08:57:47 +00:00
FT_UINT32 , BASE_DEC , VALS ( cms_OriginatorIdentifierOrKey_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" cms.OriginatorIdentifierOrKey " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_ukm ,
{ " ukm " , " cms.ukm " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.UserKeyingMaterial " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_recipientEncryptedKeys ,
{ " recipientEncryptedKeys " , " cms.recipientEncryptedKeys " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.RecipientEncryptedKeys " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_originatorKey ,
{ " originatorKey " , " cms.originatorKey " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.OriginatorPublicKey " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_algorithm ,
{ " algorithm " , " cms.algorithm " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" x509af.AlgorithmIdentifier " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_publicKey ,
{ " publicKey " , " cms.publicKey " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.BIT_STRING " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_RecipientEncryptedKeys_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.RecipientEncryptedKeys_item " ,
2004-07-25 10:34:07 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.RecipientEncryptedKey " , HFILL } } ,
2004-10-13 00:21:00 +00:00
{ & hf_cms_rekRid ,
2004-07-25 10:34:07 +00:00
{ " rid " , " cms.rid " ,
2005-02-23 08:57:47 +00:00
FT_UINT32 , BASE_DEC , VALS ( cms_KeyAgreeRecipientIdentifier_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" cms.KeyAgreeRecipientIdentifier " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_rKeyId ,
{ " rKeyId " , " cms.rKeyId " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.RecipientKeyIdentifier " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_date ,
{ " date " , " cms.date " ,
FT_STRING , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.GeneralizedTime " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_other ,
{ " other " , " cms.other " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.OtherKeyAttribute " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_kekid ,
{ " kekid " , " cms.kekid " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.KEKIdentifier " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_keyIdentifier ,
{ " keyIdentifier " , " cms.keyIdentifier " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.OCTET_STRING " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_digest ,
{ " digest " , " cms.digest " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.Digest " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_macAlgorithm ,
{ " macAlgorithm " , " cms.macAlgorithm " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.MessageAuthenticationCodeAlgorithm " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_authenticatedAttributes ,
{ " authenticatedAttributes " , " cms.authenticatedAttributes " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.AuthAttributes " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_mac ,
{ " mac " , " cms.mac " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.MessageAuthenticationCode " , HFILL } } ,
2004-07-25 10:34:07 +00:00
{ & hf_cms_unauthenticatedAttributes ,
{ " unauthenticatedAttributes " , " cms.unauthenticatedAttributes " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.UnauthAttributes " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_AuthAttributes_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.AuthAttributes_item " ,
2004-07-20 09:11:40 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.Attribute " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_UnauthAttributes_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.UnauthAttributes_item " ,
2004-07-20 09:11:40 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.Attribute " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_CertificateRevocationLists_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.CertificateRevocationLists_item " ,
2004-07-20 09:11:40 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" x509af.CertificateList " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_certificate ,
{ " certificate " , " cms.certificate " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" x509af.Certificate " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_extendedCertificate ,
{ " extendedCertificate " , " cms.extendedCertificate " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.ExtendedCertificate " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_attrCert ,
{ " attrCert " , " cms.attrCert " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" x509af.AttributeCertificate " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_CertificateSet_item ,
2004-10-12 17:40:31 +00:00
{ " Item " , " cms.CertificateSet_item " ,
2005-02-23 08:57:47 +00:00
FT_UINT32 , BASE_DEC , VALS ( cms_CertificateChoices_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" cms.CertificateChoices " , HFILL } } ,
2004-07-25 10:41:39 +00:00
{ & hf_cms_issuer ,
{ " issuer " , " cms.issuer " ,
2005-02-23 08:57:47 +00:00
FT_UINT32 , BASE_DEC , VALS ( x509if_Name_vals ) , 0 ,
2006-08-16 05:58:39 +00:00
" x509if.Name " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_serialNumber ,
{ " serialNumber " , " cms.serialNumber " ,
2004-07-25 10:34:07 +00:00
FT_INT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" x509af.CertificateSerialNumber " , HFILL } } ,
2004-10-29 12:11:42 +00:00
{ & hf_cms_keyAttrId ,
{ " keyAttrId " , " cms.keyAttrId " ,
2005-12-05 23:00:03 +00:00
FT_OID , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.T_keyAttrId " , HFILL } } ,
2004-10-29 12:11:42 +00:00
{ & hf_cms_keyAttr ,
{ " keyAttr " , " cms.keyAttr " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.T_keyAttr " , HFILL } } ,
2005-10-03 05:17:51 +00:00
{ & hf_cms_utcTime ,
{ " utcTime " , " cms.utcTime " ,
FT_STRING , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.UTCTime " , HFILL } } ,
2005-10-03 05:17:51 +00:00
{ & hf_cms_generalTime ,
{ " generalTime " , " cms.generalTime " ,
FT_STRING , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.GeneralizedTime " , HFILL } } ,
2007-01-28 10:20:51 +00:00
{ & hf_cms_rc2ParameterVersion ,
{ " rc2ParameterVersion " , " cms.rc2ParameterVersion " ,
FT_INT32 , BASE_DEC , NULL , 0 ,
" cms.INTEGER " , HFILL } } ,
{ & hf_cms_iv ,
{ " iv " , " cms.iv " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
" cms.OCTET_STRING " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_extendedCertificateInfo ,
{ " extendedCertificateInfo " , " cms.extendedCertificateInfo " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.ExtendedCertificateInfo " , HFILL } } ,
2004-10-13 00:21:00 +00:00
{ & hf_cms_signature ,
2004-07-20 09:11:40 +00:00
{ " signature " , " cms.signature " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.Signature " , HFILL } } ,
2004-07-20 09:11:40 +00:00
{ & hf_cms_attributes ,
{ " attributes " , " cms.attributes " ,
2005-07-21 21:12:09 +00:00
FT_UINT32 , BASE_DEC , NULL , 0 ,
2006-08-16 05:58:39 +00:00
" cms.UnauthAttributes " , HFILL } } ,
2007-01-28 10:20:51 +00:00
{ & hf_cms_SMIMECapabilities_item ,
{ " Item " , " cms.SMIMECapabilities_item " ,
FT_NONE , BASE_NONE , NULL , 0 ,
" cms.SMIMECapability " , HFILL } } ,
{ & hf_cms_capability ,
{ " capability " , " cms.capability " ,
FT_OID , BASE_NONE , NULL , 0 ,
" cms.T_capability " , HFILL } } ,
{ & hf_cms_parameters ,
{ " parameters " , " cms.parameters " ,
FT_NONE , BASE_NONE , NULL , 0 ,
" cms.T_parameters " , HFILL } } ,
{ & hf_cms_recipientKeyId ,
{ " recipientKeyId " , " cms.recipientKeyId " ,
FT_NONE , BASE_NONE , NULL , 0 ,
" cms.RecipientKeyIdentifier " , HFILL } } ,
{ & hf_cms_subjectAltKeyIdentifier ,
{ " subjectAltKeyIdentifier " , " cms.subjectAltKeyIdentifier " ,
FT_BYTES , BASE_HEX , NULL , 0 ,
" cms.SubjectKeyIdentifier " , HFILL } } ,
{ & hf_cms_rc2WrapParameter ,
{ " rc2WrapParameter " , " cms.rc2WrapParameter " ,
FT_INT32 , BASE_DEC , NULL , 0 ,
" cms.RC2WrapParameter " , HFILL } } ,
{ & hf_cms_rc2CBCParameter ,
{ " rc2CBCParameter " , " cms.rc2CBCParameter " ,
FT_NONE , BASE_NONE , NULL , 0 ,
" cms.RC2CBCParameter " , HFILL } } ,
2004-07-20 09:11:40 +00:00
/*--- End of included file: packet-cms-hfarr.c ---*/
2007-01-28 10:20:51 +00:00
# line 146 "packet-cms-template.c"
2004-07-20 09:11:40 +00:00
} ;
/* List of subtrees */
static gint * ett [ ] = {
/*--- Included file: packet-cms-ettarr.c ---*/
2005-12-05 23:00:03 +00:00
# line 1 "packet-cms-ettarr.c"
2004-10-29 12:11:42 +00:00
& ett_cms_ContentInfo ,
2004-07-20 09:11:40 +00:00
& ett_cms_SignedData ,
& ett_cms_DigestAlgorithmIdentifiers ,
& ett_cms_SignerInfos ,
& ett_cms_EncapsulatedContentInfo ,
& ett_cms_SignerInfo ,
& ett_cms_SignerIdentifier ,
& ett_cms_SignedAttributes ,
& ett_cms_UnsignedAttributes ,
& ett_cms_Attribute ,
2005-10-03 05:17:51 +00:00
& ett_cms_SET_OF_AttributeValue ,
2004-07-25 10:34:07 +00:00
& ett_cms_EnvelopedData ,
& ett_cms_OriginatorInfo ,
& ett_cms_RecipientInfos ,
& ett_cms_EncryptedContentInfo ,
& ett_cms_UnprotectedAttributes ,
& ett_cms_RecipientInfo ,
& ett_cms_KeyTransRecipientInfo ,
2004-07-20 09:11:40 +00:00
& ett_cms_RecipientIdentifier ,
2004-07-25 10:34:07 +00:00
& ett_cms_KeyAgreeRecipientInfo ,
& ett_cms_OriginatorIdentifierOrKey ,
& ett_cms_OriginatorPublicKey ,
& ett_cms_RecipientEncryptedKeys ,
& ett_cms_RecipientEncryptedKey ,
& ett_cms_KeyAgreeRecipientIdentifier ,
& ett_cms_RecipientKeyIdentifier ,
& ett_cms_KEKRecipientInfo ,
& ett_cms_KEKIdentifier ,
& ett_cms_DigestedData ,
& ett_cms_EncryptedData ,
& ett_cms_AuthenticatedData ,
2004-07-20 09:11:40 +00:00
& ett_cms_AuthAttributes ,
& ett_cms_UnauthAttributes ,
& ett_cms_CertificateRevocationLists ,
& ett_cms_CertificateChoices ,
& ett_cms_CertificateSet ,
& ett_cms_IssuerAndSerialNumber ,
2004-07-25 10:34:07 +00:00
& ett_cms_OtherKeyAttribute ,
2005-10-03 05:17:51 +00:00
& ett_cms_Time ,
2007-01-28 10:20:51 +00:00
& ett_cms_RC2CBCParameter ,
2004-07-20 09:11:40 +00:00
& ett_cms_ExtendedCertificate ,
& ett_cms_ExtendedCertificateInfo ,
2007-01-28 10:20:51 +00:00
& ett_cms_SMIMECapabilities ,
& ett_cms_SMIMECapability ,
& ett_cms_SMIMEEncryptionKeyPreference ,
& ett_cms_RC2CBCParameters ,
2004-07-20 09:11:40 +00:00
/*--- End of included file: packet-cms-ettarr.c ---*/
2007-01-28 10:20:51 +00:00
# line 151 "packet-cms-template.c"
2004-07-20 09:11:40 +00:00
} ;
/* Register protocol */
proto_cms = proto_register_protocol ( PNAME , PSNAME , PFNAME ) ;
/* Register fields and subtrees */
proto_register_field_array ( proto_cms , hf , array_length ( hf ) ) ;
proto_register_subtree_array ( ett , array_length ( ett ) ) ;
2007-01-28 10:20:51 +00:00
register_ber_syntax_dissector ( " ContentInfo " , proto_cms , dissect_ContentInfo_PDU ) ;
register_ber_oid_syntax ( " .p7s " , NULL , " ContentInfo " ) ;
register_ber_oid_syntax ( " .p7m " , NULL , " ContentInfo " ) ;
register_ber_oid_syntax ( " .p7c " , NULL , " ContentInfo " ) ;
2004-07-20 09:11:40 +00:00
}
/*--- proto_reg_handoff_cms -------------------------------------------*/
void proto_reg_handoff_cms ( void ) {
2004-10-26 13:53:30 +00:00
/*--- Included file: packet-cms-dis-tab.c ---*/
2005-12-05 23:00:03 +00:00
# line 1 "packet-cms-dis-tab.c"
2005-10-02 21:14:35 +00:00
register_ber_oid_dissector ( " 1.2.840.113549.1.9.16.1.6 " , dissect_ContentInfo_PDU , proto_cms , " id-ct-contentInfo " ) ;
2005-07-09 02:58:07 +00:00
register_ber_oid_dissector ( " 1.2.840.113549.1.7.2 " , dissect_SignedData_PDU , proto_cms , " id-signedData " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.7.3 " , dissect_EnvelopedData_PDU , proto_cms , " id-envelopedData " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.7.5 " , dissect_DigestedData_PDU , proto_cms , " id-digestedData " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.7.6 " , dissect_EncryptedData_PDU , proto_cms , " id-encryptedData " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.9.16.1.2 " , dissect_AuthenticatedData_PDU , proto_cms , " id-ct-authenticatedData " ) ;
2005-10-03 05:17:51 +00:00
register_ber_oid_dissector ( " 1.2.840.113549.1.9.3 " , dissect_ContentType_PDU , proto_cms , " id-contentType " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.9.4 " , dissect_MessageDigest_PDU , proto_cms , " id-messageDigest " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.9.5 " , dissect_SigningTime_PDU , proto_cms , " id-signingTime " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.9.6 " , dissect_Countersignature_PDU , proto_cms , " id-counterSignature " ) ;
2005-12-05 23:00:03 +00:00
register_ber_oid_dissector ( " 2.6.1.4.18 " , dissect_ContentInfo_PDU , proto_cms , " id-et-pkcs7 " ) ;
2007-01-28 10:20:51 +00:00
register_ber_oid_dissector ( " 1.3.6.1.4.1.311.16.4 " , dissect_IssuerAndSerialNumber_PDU , proto_cms , " ms-oe-encryption-key-preference " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.9.15 " , dissect_SMIMECapabilities_PDU , proto_cms , " id-smime-capabilities " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.1.9.16.2.11 " , dissect_SMIMEEncryptionKeyPreference_PDU , proto_cms , " id-encryption-key-preference " ) ;
register_ber_oid_dissector ( " 1.2.840.113549.3.2 " , dissect_RC2CBCParameters_PDU , proto_cms , " id-alg-rc2-cbc " ) ;
2007-03-23 16:45:49 +00:00
register_ber_oid_dissector ( " 1.2.840.113549.3.4 " , dissect_RC2CBCParameters_PDU , proto_cms , " id-alg-rc4 " ) ;
2007-01-28 10:20:51 +00:00
register_ber_oid_dissector ( " 1.2.840.113549.1.9.16.3.7 " , dissect_RC2WrapParameter_PDU , proto_cms , " id-alg-cmsrc2-wrap " ) ;
2004-10-26 13:53:30 +00:00
/*--- End of included file: packet-cms-dis-tab.c ---*/
2007-01-28 10:20:51 +00:00
# line 172 "packet-cms-template.c"
2007-01-13 15:26:13 +00:00
add_oid_str_name ( " 1.2.840.113549.1.7.1 " , " id-data " ) ;
2007-01-28 10:20:51 +00:00
add_oid_str_name ( " 1.2.840.113549.3.7 " , " id-alg-des-ede3-cbc " ) ;
add_oid_str_name ( " 1.3.14.3.2.7 " , " id-alg-des-cbc " ) ;
2007-01-13 15:26:13 +00:00
2004-07-20 09:11:40 +00:00
}