aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-09-06 12:21:24 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2015-09-06 12:25:38 +0000
commit09e92f004abc040584dbb0bec4598b34ee7a900f (patch)
tree97530aa952ab910a5ff74c0e80e4efe03ea39ede /asn1
parent48c3f7a1c07de09e457a9e738c38babd8a6f11a1 (diff)
OCSP: get rid of an evil global variable
Bug: 11505 Change-Id: I87cc676426dceed05a9a95bb515c4fb2535ac9c5 Reviewed-on: https://code.wireshark.org/review/10400 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'asn1')
-rw-r--r--asn1/ocsp/ocsp.cnf9
-rw-r--r--asn1/ocsp/packet-ocsp-template.c5
2 files changed, 7 insertions, 7 deletions
diff --git a/asn1/ocsp/ocsp.cnf b/asn1/ocsp/ocsp.cnf
index 757ac53645..002f515d00 100644
--- a/asn1/ocsp/ocsp.cnf
+++ b/asn1/ocsp/ocsp.cnf
@@ -36,8 +36,9 @@ Version
#.FIELD_RENAME
-#.FN_PARS ResponseBytes/responseType
- FN_VARIANT = _str HF_INDEX = hf_ocsp_responseType_id VAL_PTR = &responseType_id
+#.FN_BODY ResponseBytes/responseType FN_VARIANT = _str HF_INDEX = hf_ocsp_responseType_id VAL_PTR = &actx->external.direct_reference
+%(DEFAULT_BODY)s
+ actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
#.FN_BODY ResponseBytes/response
gint8 appclass;
@@ -47,6 +48,8 @@ Version
/* 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(responseType_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);
+ }
#.END
diff --git a/asn1/ocsp/packet-ocsp-template.c b/asn1/ocsp/packet-ocsp-template.c
index f122dda90b..095febdf5b 100644
--- a/asn1/ocsp/packet-ocsp-template.c
+++ b/asn1/ocsp/packet-ocsp-template.c
@@ -50,9 +50,6 @@ static int hf_ocsp_responseType_id = -1;
static gint ett_ocsp = -1;
#include "packet-ocsp-ett.c"
-static const char *responseType_id;
-
-
#include "packet-ocsp-fn.c"
@@ -105,7 +102,7 @@ void proto_register_ocsp(void) {
/* List of fields */
static hf_register_info hf[] = {
{ &hf_ocsp_responseType_id,
- { "ResponseType Id", "x509af.responseType.id",
+ { "ResponseType Id", "ocsp.responseType.id",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }},
#include "packet-ocsp-hfarr.c"