forked from osmocom/wireshark
Move DigestInfo from pkcs12 to cms
This type is originally from PKCS #7, the predecessor of CMS, so it makes more sense for it to be there. Change-Id: I3a146f1d000a3bcbcd0d8f1cfe2fc27ed80cc69d Reviewed-on: https://code.wireshark.org/review/19335 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
9d47bf9939
commit
e5a39920f9
|
@ -365,6 +365,12 @@ ExtendedCertificateInfo ::= SEQUENCE {
|
|||
|
||||
Signature ::= BIT STRING
|
||||
|
||||
-- PKCS #7 type that was removed from CMS
|
||||
|
||||
DigestInfo ::= SEQUENCE {
|
||||
digestAlgorithm DigestAlgorithmIdentifier,
|
||||
digest Digest }
|
||||
|
||||
-- From S/MIME
|
||||
|
||||
SMIMECapabilities ::= SEQUENCE OF SMIMECapability
|
||||
|
|
|
@ -20,6 +20,7 @@ Countersignature
|
|||
Digest
|
||||
DigestAlgorithmIdentifier
|
||||
DigestAlgorithmIdentifiers
|
||||
DigestInfo
|
||||
EncapsulatedContentInfo
|
||||
EnvelopedData
|
||||
IssuerAndSerialNumber
|
||||
|
|
|
@ -18,7 +18,7 @@ informationFramework
|
|||
Attribute
|
||||
FROM InformationFramework informationFramework
|
||||
|
||||
ContentInfo, --DigestInfo-- Digest, DigestAlgorithmIdentifier
|
||||
ContentInfo, DigestInfo, Digest, DigestAlgorithmIdentifier
|
||||
FROM PKCS-7 {iso(1) member-body(2) us(840) rsadsi(113549)
|
||||
pkcs(1) pkcs-7(7) modules(0) pkcs-7(1)}
|
||||
|
||||
|
@ -67,12 +67,6 @@ MacData ::= SEQUENCE {
|
|||
-- deprecated. A higher value, like 1024 is recommended.
|
||||
}
|
||||
|
||||
-- Imported from PKCS#7
|
||||
DigestInfo ::= SEQUENCE {
|
||||
digestAlgorithm DigestAlgorithmIdentifier,
|
||||
digest Digest
|
||||
}
|
||||
|
||||
AuthenticatedSafe ::= SEQUENCE OF ContentInfo
|
||||
-- Data if unencrypted
|
||||
-- EncryptedData if password-encrypted
|
||||
|
|
|
@ -236,6 +236,7 @@ static gint ett_cms_Time = -1;
|
|||
static gint ett_cms_RC2CBCParameter = -1;
|
||||
static gint ett_cms_ExtendedCertificate = -1;
|
||||
static gint ett_cms_ExtendedCertificateInfo = -1;
|
||||
static gint ett_cms_DigestInfo = -1;
|
||||
static gint ett_cms_SMIMECapabilities = -1;
|
||||
static gint ett_cms_SMIMECapability = -1;
|
||||
static gint ett_cms_SMIMEEncryptionKeyPreference = -1;
|
||||
|
@ -330,7 +331,7 @@ cms_verify_msg_digest(proto_item *pi, tvbuff_t *content, const char *alg, tvbuff
|
|||
|
||||
int
|
||||
dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 88 "./asn1/cms/cms.cnf"
|
||||
#line 89 "./asn1/cms/cms.cnf"
|
||||
const char *name = NULL;
|
||||
|
||||
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
|
||||
|
@ -350,7 +351,7 @@ dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
|
|||
|
||||
static int
|
||||
dissect_cms_T_content(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 98 "./asn1/cms/cms.cnf"
|
||||
#line 99 "./asn1/cms/cms.cnf"
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
|
||||
|
||||
|
@ -368,7 +369,7 @@ static const ber_sequence_t ContentInfo_sequence[] = {
|
|||
|
||||
int
|
||||
dissect_cms_ContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 79 "./asn1/cms/cms.cnf"
|
||||
#line 80 "./asn1/cms/cms.cnf"
|
||||
top_tree = tree;
|
||||
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
||||
ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
|
||||
|
@ -427,7 +428,7 @@ dissect_cms_DigestAlgorithmIdentifiers(gboolean implicit_tag _U_, tvbuff_t *tvb
|
|||
|
||||
static int
|
||||
dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 102 "./asn1/cms/cms.cnf"
|
||||
#line 103 "./asn1/cms/cms.cnf"
|
||||
|
||||
offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &content_tvb);
|
||||
proto_item_set_text(actx->created_item, "eContent (%u bytes)", tvb_reported_length (content_tvb));
|
||||
|
@ -458,7 +459,7 @@ dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_
|
|||
|
||||
static int
|
||||
dissect_cms_T_attrType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 129 "./asn1/cms/cms.cnf"
|
||||
#line 130 "./asn1/cms/cms.cnf"
|
||||
const char *name = NULL;
|
||||
|
||||
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
|
||||
|
@ -478,7 +479,7 @@ dissect_cms_T_attrType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
|
|||
|
||||
static int
|
||||
dissect_cms_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 139 "./asn1/cms/cms.cnf"
|
||||
#line 140 "./asn1/cms/cms.cnf"
|
||||
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
|
||||
|
@ -740,7 +741,7 @@ dissect_cms_T_otherRevInfoFormat(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i
|
|||
|
||||
static int
|
||||
dissect_cms_T_otherRevInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 123 "./asn1/cms/cms.cnf"
|
||||
#line 124 "./asn1/cms/cms.cnf"
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
|
||||
|
||||
|
@ -1077,7 +1078,7 @@ dissect_cms_T_keyAttrId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
|
|||
|
||||
static int
|
||||
dissect_cms_T_keyAttr(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 118 "./asn1/cms/cms.cnf"
|
||||
#line 119 "./asn1/cms/cms.cnf"
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
|
||||
|
||||
|
@ -1265,7 +1266,7 @@ dissect_cms_T_oriType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _
|
|||
|
||||
static int
|
||||
dissect_cms_T_oriValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 112 "./asn1/cms/cms.cnf"
|
||||
#line 113 "./asn1/cms/cms.cnf"
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
|
||||
|
||||
|
@ -1342,14 +1343,14 @@ dissect_cms_ContentEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbu
|
|||
|
||||
static int
|
||||
dissect_cms_EncryptedContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 189 "./asn1/cms/cms.cnf"
|
||||
#line 190 "./asn1/cms/cms.cnf"
|
||||
tvbuff_t *encrypted_tvb;
|
||||
proto_item *item;
|
||||
|
||||
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
|
||||
&encrypted_tvb);
|
||||
|
||||
#line 194 "./asn1/cms/cms.cnf"
|
||||
#line 195 "./asn1/cms/cms.cnf"
|
||||
|
||||
item = actx->created_item;
|
||||
|
||||
|
@ -1507,7 +1508,7 @@ dissect_cms_AuthenticatedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
|
|||
|
||||
static int
|
||||
dissect_cms_MessageDigest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 143 "./asn1/cms/cms.cnf"
|
||||
#line 144 "./asn1/cms/cms.cnf"
|
||||
proto_item *pi;
|
||||
int old_offset = offset;
|
||||
|
||||
|
@ -1582,7 +1583,7 @@ dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
|
|||
|
||||
static int
|
||||
dissect_cms_RC2ParameterVersion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 179 "./asn1/cms/cms.cnf"
|
||||
#line 180 "./asn1/cms/cms.cnf"
|
||||
guint32 length = 0;
|
||||
|
||||
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
||||
|
@ -1632,10 +1633,25 @@ dissect_cms_RC2CBCParameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
|
|||
}
|
||||
|
||||
|
||||
static const ber_sequence_t DigestInfo_sequence[] = {
|
||||
{ &hf_cms_digestAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
|
||||
{ &hf_cms_digest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Digest },
|
||||
{ NULL, 0, 0, 0, NULL }
|
||||
};
|
||||
|
||||
int
|
||||
dissect_cms_DigestInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
||||
DigestInfo_sequence, hf_index, ett_cms_DigestInfo);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
dissect_cms_T_capability(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 161 "./asn1/cms/cms.cnf"
|
||||
#line 162 "./asn1/cms/cms.cnf"
|
||||
const char *name = NULL;
|
||||
|
||||
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
|
||||
|
@ -1656,7 +1672,7 @@ dissect_cms_T_capability(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
|
|||
|
||||
static int
|
||||
dissect_cms_T_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
#line 172 "./asn1/cms/cms.cnf"
|
||||
#line 173 "./asn1/cms/cms.cnf"
|
||||
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
|
||||
|
@ -2411,6 +2427,7 @@ void proto_register_cms(void) {
|
|||
&ett_cms_RC2CBCParameter,
|
||||
&ett_cms_ExtendedCertificate,
|
||||
&ett_cms_ExtendedCertificateInfo,
|
||||
&ett_cms_DigestInfo,
|
||||
&ett_cms_SMIMECapabilities,
|
||||
&ett_cms_SMIMECapability,
|
||||
&ett_cms_SMIMEEncryptionKeyPreference,
|
||||
|
|
|
@ -53,6 +53,7 @@ int dissect_cms_Digest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
|
|||
int dissect_cms_DigestAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
|
||||
int dissect_cms_IssuerAndSerialNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
|
||||
int dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
|
||||
int dissect_cms_DigestInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
|
||||
|
||||
/*--- End of included file: packet-cms-exp.h ---*/
|
||||
#line 29 "./asn1/cms/packet-cms-template.h"
|
||||
|
|
|
@ -102,8 +102,6 @@ static int hf_pkcs12_macData = -1; /* MacData */
|
|||
static int hf_pkcs12_mac = -1; /* DigestInfo */
|
||||
static int hf_pkcs12_macSalt = -1; /* OCTET_STRING */
|
||||
static int hf_pkcs12_iterations = -1; /* INTEGER */
|
||||
static int hf_pkcs12_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
|
||||
static int hf_pkcs12_digest = -1; /* Digest */
|
||||
static int hf_pkcs12_AuthenticatedSafe_item = -1; /* ContentInfo */
|
||||
static int hf_pkcs12_SafeContents_item = -1; /* SafeBag */
|
||||
static int hf_pkcs12_bagId = -1; /* T_bagId */
|
||||
|
@ -146,7 +144,6 @@ static int hf_pkcs12_messageAuthScheme = -1; /* AlgorithmIdentifier */
|
|||
#line 1 "./asn1/pkcs12/packet-pkcs12-ett.c"
|
||||
static gint ett_pkcs12_PFX = -1;
|
||||
static gint ett_pkcs12_MacData = -1;
|
||||
static gint ett_pkcs12_DigestInfo = -1;
|
||||
static gint ett_pkcs12_AuthenticatedSafe = -1;
|
||||
static gint ett_pkcs12_SafeContents = -1;
|
||||
static gint ett_pkcs12_SafeBag = -1;
|
||||
|
@ -490,21 +487,6 @@ dissect_pkcs12_T_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
|
|||
}
|
||||
|
||||
|
||||
static const ber_sequence_t DigestInfo_sequence[] = {
|
||||
{ &hf_pkcs12_digestAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
|
||||
{ &hf_pkcs12_digest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Digest },
|
||||
{ NULL, 0, 0, 0, NULL }
|
||||
};
|
||||
|
||||
static int
|
||||
dissect_pkcs12_DigestInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
||||
DigestInfo_sequence, hf_index, ett_pkcs12_DigestInfo);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
dissect_pkcs12_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
|
@ -526,7 +508,7 @@ dissect_pkcs12_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
|
|||
|
||||
|
||||
static const ber_sequence_t MacData_sequence[] = {
|
||||
{ &hf_pkcs12_mac , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs12_DigestInfo },
|
||||
{ &hf_pkcs12_mac , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestInfo },
|
||||
{ &hf_pkcs12_macSalt , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs12_OCTET_STRING },
|
||||
{ &hf_pkcs12_iterations , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs12_INTEGER },
|
||||
{ NULL, 0, 0, 0, NULL }
|
||||
|
@ -1302,14 +1284,6 @@ void proto_register_pkcs12(void) {
|
|||
{ "iterations", "pkcs12.iterations",
|
||||
FT_INT32, BASE_DEC, NULL, 0,
|
||||
"INTEGER", HFILL }},
|
||||
{ &hf_pkcs12_digestAlgorithm,
|
||||
{ "digestAlgorithm", "pkcs12.digestAlgorithm_element",
|
||||
FT_NONE, BASE_NONE, NULL, 0,
|
||||
"DigestAlgorithmIdentifier", HFILL }},
|
||||
{ &hf_pkcs12_digest,
|
||||
{ "digest", "pkcs12.digest",
|
||||
FT_BYTES, BASE_NONE, NULL, 0,
|
||||
NULL, HFILL }},
|
||||
{ &hf_pkcs12_AuthenticatedSafe_item,
|
||||
{ "ContentInfo", "pkcs12.ContentInfo_element",
|
||||
FT_NONE, BASE_NONE, NULL, 0,
|
||||
|
@ -1451,7 +1425,6 @@ void proto_register_pkcs12(void) {
|
|||
#line 1 "./asn1/pkcs12/packet-pkcs12-ettarr.c"
|
||||
&ett_pkcs12_PFX,
|
||||
&ett_pkcs12_MacData,
|
||||
&ett_pkcs12_DigestInfo,
|
||||
&ett_pkcs12_AuthenticatedSafe,
|
||||
&ett_pkcs12_SafeContents,
|
||||
&ett_pkcs12_SafeBag,
|
||||
|
|
Loading…
Reference in New Issue