Update to CMD to prepare for PKINIT support

svn path=/trunk/; revision=12009
This commit is contained in:
Ronnie Sahlberg 2004-09-16 08:31:01 +00:00
parent 2d444f2c6e
commit 4cb62f797d
5 changed files with 71 additions and 3 deletions

View File

@ -26,9 +26,14 @@ IMPORTS
-- Cryptographic Message Syntax
--
-- ContentInfo ::= SEQUENCE {
--OK contentType ContentType,
-- content [0] EXPLICIT ANY DEFINED BY contentType }
-- Implemented by hand in the template
--ContentInfo ::= SEQUENCE {
-- contentType ContentType,
-- content [0] EXPLICIT ANY DEFINED BY contentType
--}
ContentType ::= OBJECT IDENTIFIER

View File

@ -13,6 +13,7 @@ InformationFramework x509if
#.EXPORTS
SignedData
Countersignature
IssuerAndSerialNumber
#.NO_EMIT
OtherKeyAttribute

19
asn1/cms/cms_exp.cnf Normal file
View File

@ -0,0 +1,19 @@
# Do not modify this file.
# It is created automatically by the ASN.1 to Ethereal dissector compiler
# ./cms-exp.cnf
# ../../tools/asn2eth.py -e -X -b -p cms -c cms.cnf CryptographicMessageSyntax.asn
#.IMPORT_TAG
ContentInfo BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
SignedData BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
IssuerAndSerialNumber BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
Countersignature BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
#.END
#.TYPE_ATTR
ContentInfo TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0
SignedData TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0
IssuerAndSerialNumber TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0
Countersignature TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0
#.END

View File

@ -45,9 +45,11 @@
/* Initialize the protocol and registered fields */
int proto_cms = -1;
static int hf_cms_keyAttr_id = -1;
static int hf_cms_ci_contentType = -1;
#include "packet-cms-hf.c"
/* Initialize the subtree pointers */
static gint ett_cms_ContentInfo = -1;
#include "packet-cms-ett.c"
static int dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index);
@ -118,11 +120,49 @@ dissect_cms_AuthenticatedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_
dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, -1);
}
/* ContentInfo can not yet be handled by the compiler */
static char ci_contentType[64]; /*64 chars should be long enough? */
static int
dissect_hf_cms_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
{
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
hf_cms_ci_contentType, ci_contentType);
return offset;
}
static int
dissect_hf_cms_contentType_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
{
offset=call_ber_oid_callback(ci_contentType, tvb, offset, pinfo, tree);
return offset;
}
static ber_sequence ContentInfo_sequence[] = {
{ BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_cms_contentType },
{ BER_CLASS_ANY, 0, 0, dissect_hf_cms_contentType_content },
{ 0, 0, 0, NULL }
};
int
dissect_cms_ContentInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
return offset;
}
/*--- proto_register_cms ----------------------------------------------*/
void proto_register_cms(void) {
/* List of fields */
static hf_register_info hf[] = {
{ &hf_cms_ci_contentType,
{ "contentType", "cms.contentInfo.contentType",
FT_STRING, BASE_NONE, NULL, 0,
"ContentType", HFILL }},
{ &hf_cms_keyAttr_id,
{ "keyAttr_id", "cms.keyAttr_id",
FT_STRING, BASE_NONE, NULL, 0,
@ -132,6 +172,7 @@ void proto_register_cms(void) {
/* List of subtrees */
static gint *ett[] = {
&ett_cms_ContentInfo,
#include "packet-cms-ettarr.c"
};

View File

@ -25,6 +25,8 @@
#ifndef PACKET_CMS_H
#define PACKET_CMS_H
int dissect_cms_ContentInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index);
#include "packet-cms-exp.h"
#endif /* PACKET_CMS_H */