Skip to content

Commit

Permalink
replace object_identifier_id with actx->external.direct_reference
Browse files Browse the repository at this point in the history
svn path=/trunk/; revision=50209
  • Loading branch information
mmann78 committed Jun 28, 2013
1 parent 9009944 commit c1ddd60
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 107 deletions.
10 changes: 5 additions & 5 deletions asn1/p22/p22.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,19 @@ RecipientSecurityRequest B "2.6.1.18.0" "id-sec-ipm-security-request"
IpnSecurityResponse B "2.6.1.18.1" "id-sec-security-common-fields"

#.FN_PARS IPMSExtension/type
FN_VARIANT = _str VAL_PTR = &object_identifier_id
FN_VARIANT = _str VAL_PTR = &actx->external.direct_reference

#.FN_BODY IPMSExtension/type
const char *name = NULL;

%(DEFAULT_BODY)s

name = oid_resolved_from_string(object_identifier_id);
proto_item_append_text(tree, " (%%s)", name ? name : object_identifier_id);
name = oid_resolved_from_string(actx->external.direct_reference);
proto_item_append_text(tree, " (%%s)", name ? name : actx->external.direct_reference);

#.FN_BODY IPMSExtension/value

offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_BODY IPM

Expand Down Expand Up @@ -273,7 +273,7 @@ IpnSecurityResponse B "2.6.1.18.1" "id-sec-security-common-fields"
/* XXX: Not implemented yet */

#.FN_BODY CompressionParameter/compression-algorithm-id
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->external.direct_reference);

#.FN_BODY CompressionParameter/compression-algorithm-param
/* XXX: Not implemented yet */
Expand Down
2 changes: 0 additions & 2 deletions asn1/p22/packet-p22-template.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
/* Initialize the protocol and registered fields */
static int proto_p22 = -1;

static const char *object_identifier_id; /* content type identifier */

static const value_string charsetreg_vals [] = {
{ 1, "C0: (ISO/IEC 6429)"},
{ 6, "G0: ASCII (ISO/IEC 646)"},
Expand Down
3 changes: 0 additions & 3 deletions asn1/x509ce/packet-x509ce-template.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ static int hf_x509ce_IPAddress = -1;

/* Initialize the subtree pointers */
#include "packet-x509ce-ett.c"

static const char *object_identifier_id;

#include "packet-x509ce-fn.c"

/* CI+ (www.ci-plus.com) defines some X.509 certificate extensions
Expand Down
8 changes: 4 additions & 4 deletions asn1/x509ce/x509ce.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,20 @@ CertificateAssertion/subjectAltName subjectAltNameType
EnhancedCertificateAssertion/pathToName enhancedPathToName

#.FN_PARS PolicyQualifierInfo/policyQualifierId
FN_VARIANT = _str HF_INDEX = hf_x509ce_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509ce_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY PolicyQualifierInfo/qualifier
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_BODY GeneralName/iPAddress
proto_tree_add_item(tree, hf_x509ce_IPAddress, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;

#.FN_PARS OtherNameType
FN_VARIANT = _str VAL_PTR = &object_identifier_id
FN_VARIANT = _str VAL_PTR = &actx->external.direct_reference

#.FN_BODY OtherNameValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_FTR GeneralName/uniformResourceIdentifier

Expand Down
2 changes: 0 additions & 2 deletions asn1/x509if/packet-x509if-template.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ static int hf_x509if_any_string = -1;
/* Initialize the subtree pointers */
#include "packet-x509if-ett.c"

static const char *object_identifier_id = NULL;
static proto_tree *top_of_dn = NULL;
static proto_tree *top_of_rdn = NULL;

Expand All @@ -74,7 +73,6 @@ static char *last_ava = NULL;
static void
x509if_frame_end(void)
{
object_identifier_id = NULL;
top_of_dn = NULL;
top_of_rdn = NULL;

Expand Down
60 changes: 30 additions & 30 deletions asn1/x509if/x509if.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -180,24 +180,24 @@ DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"


#.FN_PARS ContextAssertion/contextType
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY ContextAssertion/contextValues/_item
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_PARS AttributeTypeAndDistinguishedValue/type
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY AttributeTypeAndDistinguishedValue/type
const char *fmt;
const char *name;

%(DEFAULT_BODY)s

if(object_identifier_id) {
if(actx->external.direct_reference) {
/* see if we can find a nice name */
name = oid_resolved_from_string(object_identifier_id);
if(!name) name = object_identifier_id;
name = oid_resolved_from_string(actx->external.direct_reference);
if(!name) name = actx->external.direct_reference;

if(last_rdn) { /* append it to the RDN */
g_strlcat(last_rdn, name, MAX_RDN_STR_LEN);
Expand Down Expand Up @@ -228,13 +228,13 @@ DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"
char *value = NULL;
const char *fmt;
const char *name = NULL;
const char *orig_oid = object_identifier_id;
const char *orig_oid = actx->external.direct_reference;

offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

/* in dissecting the value we may have overridden the OID of the value - which is
a problem if there are multiple values */
object_identifier_id = orig_oid;
actx->external.direct_reference = orig_oid;

/* try and dissect as a string */
dissect_ber_octet_string(FALSE, actx, NULL, tvb, old_offset, hf_x509if_any_string, &out_tvb);
Expand All @@ -260,8 +260,8 @@ DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"
last_ava = (char *)wmem_alloc(wmem_packet_scope(), MAX_AVA_STR_LEN);
}

if(!(name = oid_resolved_from_string(object_identifier_id)))
name = object_identifier_id;
if(!(name = oid_resolved_from_string(actx->external.direct_reference)))
name = actx->external.direct_reference;
g_snprintf(last_ava, MAX_AVA_STR_LEN, "%%s %%s %%s", name, fmt, value);

proto_item_append_text(tree, " %%s", last_ava);
Expand All @@ -270,64 +270,64 @@ DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"
}

#.FN_PARS RequestAttribute/attributeType
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY RequestAttribute/selectedValues/_item
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_PARS RequestAttribute/defaultValues/_item/entryType
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY RequestAttribute/defaultValues/_item/values/_item
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_BODY Attribute/valuesWithContext/_item/value
offset=call_ber_oid_callback("unknown", tvb, offset, actx->pinfo, tree);

#.FN_PARS ResultAttribute/attributeType
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY ResultAttribute/outputValues/selectedValues/_item
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_PARS Context/contextType
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY Context/contextValues/_item
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_PARS AttributeType
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY AttributeValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_PARS AttributeValueAssertion/type
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY AttributeValueAssertion/assertion
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_PARS Attribute/type
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY Attribute/values/_item
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_PARS ContextProfile/contextType
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY ContextProfile/contextValue/_item
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_PARS MatchingUse/restrictionType
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &actx->external.direct_reference

#.FN_BODY MatchingUse/restrictionValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_BODY AttributeTypeAndDistinguishedValue/valuesWithContext/_item/distingAttrValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);

#.FN_BODY RelativeDistinguishedName
char *temp_dn;
Expand Down
26 changes: 12 additions & 14 deletions epan/dissectors/packet-p22.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
/* Initialize the protocol and registered fields */
static int proto_p22 = -1;

static const char *object_identifier_id; /* content type identifier */

static const value_string charsetreg_vals [] = {
{ 1, "C0: (ISO/IEC 6429)"},
{ 6, "G0: ASCII (ISO/IEC 646)"},
Expand Down Expand Up @@ -340,7 +338,7 @@ static const value_string charsetreg_vals [] = {
#define ub_telephone_number 32

/*--- End of included file: packet-p22-val.h ---*/
#line 84 "../../asn1/p22/packet-p22-template.c"
#line 82 "../../asn1/p22/packet-p22-template.c"


/*--- Included file: packet-p22-hf.c ---*/
Expand Down Expand Up @@ -725,7 +723,7 @@ static int hf_p22_RecipientSecurityRequest_ipn_non_repudiation = -1;
static int hf_p22_RecipientSecurityRequest_ipn_proof = -1;

/*--- End of included file: packet-p22-hf.c ---*/
#line 86 "../../asn1/p22/packet-p22-template.c"
#line 84 "../../asn1/p22/packet-p22-template.c"

/* Initialize the subtree pointers */
static gint ett_p22 = -1;
Expand Down Expand Up @@ -859,7 +857,7 @@ static gint ett_p22_T_body_part_token_choice = -1;
static gint ett_p22_T_choice = -1;

/*--- End of included file: packet-p22-ett.c ---*/
#line 90 "../../asn1/p22/packet-p22-template.c"
#line 88 "../../asn1/p22/packet-p22-template.c"


/*--- Included file: packet-p22-fn.c ---*/
Expand Down Expand Up @@ -1037,11 +1035,11 @@ dissect_p22_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
#line 221 "../../asn1/p22/p22.cnf"
const char *name = NULL;

offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->external.direct_reference);


name = oid_resolved_from_string(object_identifier_id);
proto_item_append_text(tree, " (%s)", name ? name : object_identifier_id);
name = oid_resolved_from_string(actx->external.direct_reference);
proto_item_append_text(tree, " (%s)", name ? name : actx->external.direct_reference);



Expand All @@ -1054,7 +1052,7 @@ static int
dissect_p22_T_value(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 229 "../../asn1/p22/p22.cnf"

offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree);



Expand Down Expand Up @@ -3104,7 +3102,7 @@ dissect_p22_EnvironmentParameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i
static int
dissect_p22_T_compression_algorithm_id(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 276 "../../asn1/p22/p22.cnf"
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->external.direct_reference);



Expand Down Expand Up @@ -4509,7 +4507,7 @@ static void dissect_ForwardedContentToken_PDU(tvbuff_t *tvb _U_, packet_info *pi


/*--- End of included file: packet-p22-fn.c ---*/
#line 92 "../../asn1/p22/packet-p22-template.c"
#line 90 "../../asn1/p22/packet-p22-template.c"

/*
* Dissect P22 PDUs inside a PPDU.
Expand Down Expand Up @@ -6054,7 +6052,7 @@ void proto_register_p22(void) {
NULL, HFILL }},

/*--- End of included file: packet-p22-hfarr.c ---*/
#line 124 "../../asn1/p22/packet-p22-template.c"
#line 122 "../../asn1/p22/packet-p22-template.c"
};

/* List of subtrees */
Expand Down Expand Up @@ -6190,7 +6188,7 @@ void proto_register_p22(void) {
&ett_p22_T_choice,

/*--- End of included file: packet-p22-ettarr.c ---*/
#line 130 "../../asn1/p22/packet-p22-template.c"
#line 128 "../../asn1/p22/packet-p22-template.c"
};

/* Register protocol */
Expand Down Expand Up @@ -6310,7 +6308,7 @@ void proto_reg_handoff_p22(void) {


/*--- End of included file: packet-p22-dis-tab.c ---*/
#line 146 "../../asn1/p22/packet-p22-template.c"
#line 144 "../../asn1/p22/packet-p22-template.c"

register_ber_oid_dissector("2.6.1.10.0", dissect_p22, proto_p22, "InterPersonal Message (1984)");
register_ber_oid_dissector("2.6.1.10.1", dissect_p22, proto_p22, "InterPersonal Message (1988)");
Expand Down
Loading

0 comments on commit c1ddd60

Please sign in to comment.