forked from osmocom/wireshark
PKIX1Explicit: get rid of an evil global variable
Bug: 10744 Change-Id: I9fbd7c881ab6b17fa9febb55a4f33dbb229c900b Reviewed-on: https://code.wireshark.org/review/6264 Tested-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
parent
d16f114ec2
commit
d9b480dd58
|
@ -55,9 +55,6 @@ static int ett_pkix1explicit_addressFamily = -1;
|
|||
/* Initialize the subtree pointers */
|
||||
#include "packet-pkix1explicit-ett.c"
|
||||
|
||||
|
||||
static const char *object_identifier_id;
|
||||
|
||||
int
|
||||
dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
|
||||
offset = dissect_x509af_Certificate(implicit_tag, tvb, offset, actx, tree, hf_index);
|
||||
|
|
|
@ -36,19 +36,27 @@ ASIdentifiers B "1.3.6.1.5.5.7.1.8" "id-pe-autonomousSysIds"
|
|||
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
|
||||
|
||||
#.FN_PARS Attribute/values
|
||||
FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id
|
||||
FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id
|
||||
|
||||
#.FN_BODY Attribute/values/_item
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
if (actx->external.direct_ref_present) {
|
||||
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
|
||||
}
|
||||
|
||||
#.FN_PARS AttributeTypeAndValue/value
|
||||
FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id
|
||||
FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id
|
||||
|
||||
#.FN_BODY AttributeTypeAndValue/value
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
if (actx->external.direct_ref_present) {
|
||||
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
|
||||
}
|
||||
|
||||
#.FN_PARS Extension/extnId
|
||||
FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id
|
||||
FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &actx->external.direct_reference
|
||||
|
||||
#.FN_BODY Extension/extnId
|
||||
%(DEFAULT_BODY)s
|
||||
actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
|
||||
|
||||
#.FN_BODY Extension/extnValue
|
||||
gint8 appclass;
|
||||
|
@ -58,7 +66,9 @@ ASIdentifiers B "1.3.6.1.5.5.7.1.8" "id-pe-autonomousSysIds"
|
|||
/* skip past the T and L */
|
||||
offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag);
|
||||
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
if (actx->external.direct_ref_present) {
|
||||
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
|
||||
}
|
||||
|
||||
# IPAddrAndASCertExtn
|
||||
|
||||
|
|
|
@ -138,9 +138,6 @@ static gint ett_pkix1explicit_ASRange = -1;
|
|||
/*--- End of included file: packet-pkix1explicit-ett.c ---*/
|
||||
#line 57 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
|
||||
|
||||
static const char *object_identifier_id;
|
||||
|
||||
int
|
||||
dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
|
||||
offset = dissect_x509af_Certificate(implicit_tag, tvb, offset, actx, tree, hf_index);
|
||||
|
@ -265,7 +262,12 @@ dissect_pkix1explicit_Time(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
|
|||
|
||||
static int
|
||||
dissect_pkix1explicit_T_extnId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_pkix1explicit_object_identifier_id, &object_identifier_id);
|
||||
#line 58 "../../asn1/pkix1explicit/pkix1explicit.cnf"
|
||||
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_pkix1explicit_object_identifier_id, &actx->external.direct_reference);
|
||||
|
||||
actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
|
||||
|
||||
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
@ -283,7 +285,7 @@ dissect_pkix1explicit_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
|
|||
|
||||
static int
|
||||
dissect_pkix1explicit_T_extnValue(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 54 "../../asn1/pkix1explicit/pkix1explicit.cnf"
|
||||
#line 62 "../../asn1/pkix1explicit/pkix1explicit.cnf"
|
||||
gint8 appclass;
|
||||
gboolean pc, ind;
|
||||
gint32 tag;
|
||||
|
@ -291,7 +293,9 @@ dissect_pkix1explicit_T_extnValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
|
|||
/* skip past the T and L */
|
||||
offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag);
|
||||
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
if (actx->external.direct_ref_present) {
|
||||
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -396,7 +400,9 @@ dissect_pkix1explicit_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb
|
|||
static int
|
||||
dissect_pkix1explicit_T_values_item(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 42 "../../asn1/pkix1explicit/pkix1explicit.cnf"
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
if (actx->external.direct_ref_present) {
|
||||
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -435,8 +441,10 @@ dissect_pkix1explicit_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
|
|||
|
||||
static int
|
||||
dissect_pkix1explicit_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 48 "../../asn1/pkix1explicit/pkix1explicit.cnf"
|
||||
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
||||
#line 50 "../../asn1/pkix1explicit/pkix1explicit.cnf"
|
||||
if (actx->external.direct_ref_present) {
|
||||
offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -546,7 +554,7 @@ dissect_pkix1explicit_TeletexDomainDefinedAttribute(gboolean implicit_tag _U_, t
|
|||
|
||||
static int
|
||||
dissect_pkix1explicit_T_addressFamily(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 66 "../../asn1/pkix1explicit/pkix1explicit.cnf"
|
||||
#line 76 "../../asn1/pkix1explicit/pkix1explicit.cnf"
|
||||
tvbuff_t *parameter_tvb;
|
||||
proto_tree *subtree;
|
||||
|
||||
|
@ -817,7 +825,7 @@ static int dissect_ASIdentifiers_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
|
|||
|
||||
|
||||
/*--- End of included file: packet-pkix1explicit-fn.c ---*/
|
||||
#line 101 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
#line 98 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
|
||||
|
||||
/*--- proto_register_pkix1explicit ----------------------------------------------*/
|
||||
|
@ -1013,7 +1021,7 @@ void proto_register_pkix1explicit(void) {
|
|||
"ASId", HFILL }},
|
||||
|
||||
/*--- End of included file: packet-pkix1explicit-hfarr.c ---*/
|
||||
#line 120 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
#line 117 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
};
|
||||
|
||||
/* List of subtrees */
|
||||
|
@ -1046,7 +1054,7 @@ void proto_register_pkix1explicit(void) {
|
|||
&ett_pkix1explicit_ASRange,
|
||||
|
||||
/*--- End of included file: packet-pkix1explicit-ettarr.c ---*/
|
||||
#line 126 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
#line 123 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
};
|
||||
|
||||
/* Register protocol */
|
||||
|
@ -1073,6 +1081,6 @@ void proto_reg_handoff_pkix1explicit(void) {
|
|||
|
||||
|
||||
/*--- End of included file: packet-pkix1explicit-dis-tab.c ---*/
|
||||
#line 143 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
#line 140 "../../asn1/pkix1explicit/packet-pkix1explicit-template.c"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue