aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asn1/acse/acse.cnf34
-rw-r--r--asn1/acse/packet-acse-template.c2
-rw-r--r--asn1/cmip/cmip.cnf85
-rw-r--r--asn1/cmip/packet-cmip-template.c8
-rw-r--r--asn1/cms/cms.cnf19
-rw-r--r--asn1/cms/packet-cms-template.c2
-rw-r--r--asn1/ess/ess.cnf5
-rw-r--r--asn1/ess/packet-ess-template.c2
-rw-r--r--asn1/ftam/ftam.cnf11
-rw-r--r--asn1/ftam/packet-ftam-template.c2
-rw-r--r--asn1/ocsp/ocsp.cnf5
-rw-r--r--asn1/ocsp/packet-ocsp-template.c2
-rw-r--r--asn1/pkix1explicit/packet-pkix1explicit-template.c2
-rw-r--r--asn1/pkix1explicit/pkix1explicit.cnf10
-rw-r--r--asn1/pkixcmp/cmp.cnf5
-rw-r--r--asn1/pkixcmp/packet-cmp-template.c2
-rw-r--r--asn1/pkixcrmf/crmf.cnf5
-rw-r--r--asn1/pkixcrmf/packet-crmf-template.c2
-rw-r--r--asn1/pkixqualified/packet-pkixqualified-template.c2
-rw-r--r--asn1/pkixqualified/pkixqualified.cnf5
-rw-r--r--asn1/pres/packet-pres-template.c4
-rw-r--r--asn1/pres/pres.cnf2
-rw-r--r--asn1/spnego/packet-spnego-template.c6
-rw-r--r--asn1/spnego/spnego.cnf2
-rw-r--r--asn1/tcap/packet-tcap-template.c4
-rw-r--r--asn1/tcap/tcap.cnf20
-rw-r--r--asn1/x411/packet-x411-template.c3
-rw-r--r--asn1/x411/x411.cnf6
-rw-r--r--asn1/x420/packet-x420-template.c2
-rw-r--r--asn1/x420/x420.cnf2
-rw-r--r--asn1/x509af/packet-x509af-template.c4
-rw-r--r--asn1/x509af/x509af.cnf11
-rw-r--r--asn1/x509ce/packet-x509ce-template.c2
-rw-r--r--asn1/x509ce/x509ce.cnf5
-rw-r--r--asn1/x509if/packet-x509if-template.c2
-rw-r--r--asn1/x509if/x509if.cnf15
-rw-r--r--epan/dissectors/packet-acse.c29
-rw-r--r--epan/dissectors/packet-ber.c64
-rw-r--r--epan/dissectors/packet-ber.h7
-rw-r--r--epan/dissectors/packet-cmip.c75
-rw-r--r--epan/dissectors/packet-cmp.c12
-rw-r--r--epan/dissectors/packet-cms.c19
-rw-r--r--epan/dissectors/packet-crmf.c8
-rw-r--r--epan/dissectors/packet-ess.c6
-rw-r--r--epan/dissectors/packet-ftam.c10
-rw-r--r--epan/dissectors/packet-gssapi.c6
-rw-r--r--epan/dissectors/packet-ocsp.c11
-rw-r--r--epan/dissectors/packet-pkix1explicit.c14
-rw-r--r--epan/dissectors/packet-pkixqualified.c13
-rw-r--r--epan/dissectors/packet-pres.c6
-rw-r--r--epan/dissectors/packet-spnego.c10
-rw-r--r--epan/dissectors/packet-tcap.c26
-rw-r--r--epan/dissectors/packet-x411.c9
-rw-r--r--epan/dissectors/packet-x420.c4
-rw-r--r--epan/dissectors/packet-x509af.c20
-rw-r--r--epan/dissectors/packet-x509ce.c30
-rw-r--r--epan/dissectors/packet-x509if.c19
57 files changed, 295 insertions, 403 deletions
diff --git a/asn1/acse/acse.cnf b/asn1/acse/acse.cnf
index c80e625366..5a72fa3690 100644
--- a/asn1/acse/acse.cnf
+++ b/asn1/acse/acse.cnf
@@ -1,3 +1,8 @@
+# asce.cnf
+# ACSE conformation file
+
+# $Id$
+
#.MODULE_IMPORT
InformationFramework x509if
@@ -52,9 +57,8 @@ ACRQ-apdu/aSO-context-name aCRQ_aSO_context_name
offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset,
EXTERNAL_sequence, hf_index, ett_acse_EXTERNAL);
-#.FN_BODY Authentication-value-other/other-mechanism-name
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+#.FN_PARS Authentication-value-other/other-mechanism-name
+ FN_VARIANT = _str VAL_PTR = &object_identifier_id
#.FN_BODY Authentication-value-other/other-mechanism-value
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree);
@@ -63,20 +67,20 @@ ACRQ-apdu/aSO-context-name aCRQ_aSO_context_name
/*XXX not implemented yet */
#.FN_BODY AARQ-apdu/aSO-context-name
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_index, &object_identifier_id);
#.FN_BODY AARE-apdu/aSO-context-name
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_index, &object_identifier_id);
#.FN_BODY ACRQ-apdu/aSO-context-name
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_index, &object_identifier_id);
#.FN_BODY ACRP-apdu/aSO-context-name
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_index, &object_identifier_id);
#.FN_BODY EXTERNAL/indirect-reference
char *oid;
@@ -86,16 +90,14 @@ ACRQ-apdu/aSO-context-name aCRQ_aSO_context_name
/* look up the indirect reference */
if((oid = find_oid_by_pres_ctx_id(pinfo, indir_ref)) != NULL) {
- g_snprintf(object_identifier_id, MAX_OID_STR_LEN, "%%s", oid);
+ object_identifier_id = ep_strdup(oid);
}
if(session)
session->pres_ctx_id = indir_ref;
-#.FN_BODY EXTERNAL/direct-reference
-
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
-
+#.FN_PARS EXTERNAL/direct-reference
+ FN_VARIANT = _str VAL_PTR = &object_identifier_id
#.FN_BODY EXTERNAL/encoding/single-ASN1-type
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree ? top_tree : tree);
diff --git a/asn1/acse/packet-acse-template.c b/asn1/acse/packet-acse-template.c
index 67d86ed5f3..0e32bcaa57 100644
--- a/asn1/acse/packet-acse-template.c
+++ b/asn1/acse/packet-acse-template.c
@@ -68,7 +68,7 @@ static gint ett_acse = -1;
static struct SESSION_DATA_STRUCTURE* session = NULL;
-static char object_identifier_id[MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/* indirect_reference, used to pick up the signalling so we know what
kind of data is transferred in SES_DATA_TRANSFER_PDUs */
static guint32 indir_ref=0;
diff --git a/asn1/cmip/cmip.cnf b/asn1/cmip/cmip.cnf
index f601cd77b8..c1c0a6a000 100644
--- a/asn1/cmip/cmip.cnf
+++ b/asn1/cmip/cmip.cnf
@@ -38,11 +38,7 @@ RDNSequence
}
#.END
-#.FN_PARS CMIPAbortSource
-
-VAL_PTR = &value
-
-#.FN_BODY CMIPAbortSource
+#.FN_BODY CMIPAbortSource VAL_PTR = &value
guint32 value;
%(DEFAULT_BODY)s
@@ -50,10 +46,8 @@ VAL_PTR = &value
col_append_fstr(pinfo->cinfo, COL_INFO, " AbortSource:%%s", val_to_str(value, cmip_CMIPAbortSource_vals, " Unknown AbortSource:%%d"));
}
#.END
-#.FN_PARS Opcode
- VAL_PTR = &opcode
-#.FN_BODY Opcode
+#.FN_BODY Opcode VAL_PTR = &opcode
%(DEFAULT_BODY)s
if(check_col(pinfo->cinfo, COL_INFO)){
col_prepend_fstr(pinfo->cinfo, COL_INFO, "%%s", val_to_str(opcode, cmip_Opcode_vals, " Unknown Opcode:%%d"));
@@ -88,10 +82,7 @@ VAL_PTR = &value
}
#.END
-#.FN_PARS AttributeId/globalForm
- VAL_PTR = attribute_identifier_id
-
-#.FN_BODY AttributeId/globalForm
+#.FN_BODY AttributeId/globalForm FN_VARIANT = _str VAL_PTR = &attribute_identifier_id
attributeform = ATTRIBUTE_GLOBAL_FORM;
%(DEFAULT_BODY)s
@@ -105,7 +96,7 @@ VAL_PTR = &value
offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, pinfo, tree);
}
#.FN_PARS AttributeValueAssertion/id
- VAL_PTR = attributevalueassertion_id
+ FN_VARIANT = _str VAL_PTR = &attributevalueassertion_id
#.FN_BODY AttributeValueAssertion/value
offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, pinfo, tree);
@@ -184,87 +175,71 @@ VAL_PTR = &value
/*XXX add more types here */
}
-#.FN_BODY ObjectClass/ocglobalForm
+#.FN_HDR ObjectClass/ocglobalForm
objectclassform = OBJECTCLASS_GLOBAL_FORM;
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
- hf_cmip_ocglobalForm, objectclass_identifier_id);
+#.FN_PARS ObjectClass/ocglobalForm
+ FN_VARIANT = _str VAL_PTR = &objectclass_identifier_id
-#.FN_BODY ObjectClass/oclocalForm
+#.FN_HDR ObjectClass/oclocalForm
objectclassform = OBJECTCLASS_LOCAL_FORM;
- offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_oclocalForm, NULL);
-#.FN_BODY ActionInfo/actionType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_actionType_OID, object_identifier_id);
+#.FN_PARS ActionInfo/actionType
+ FN_VARIANT = _str HF_INDEX = hf_cmip_actionType_OID VAL_PTR = &object_identifier_id
#.FN_BODY ActionInfo/actionInfoArg
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-#.FN_BODY ActionReply/actionType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_actionType_OID, object_identifier_id);
+#.FN_PARS ActionReply/actionType
+ FN_VARIANT = _str HF_INDEX = hf_cmip_actionType_OID VAL_PTR = &object_identifier_id
#.FN_BODY ActionReply/actionReplyInfo
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-#.FN_BODY EventReportArgument/eventType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_eventType_OID, object_identifier_id);
+#.FN_PARS EventReportArgument/eventType
+ FN_VARIANT = _str HF_INDEX = hf_cmip_eventType_OID VAL_PTR = &object_identifier_id
#.FN_BODY EventReportArgument/eventInfo
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-
-#.FN_BODY EventReply/eventType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_eventType_OID, object_identifier_id);
+#.FN_PARS EventReply/eventType
+ FN_VARIANT = _str HF_INDEX = hf_cmip_eventType_OID VAL_PTR = &object_identifier_id
#.FN_BODY EventReply/eventReplyInfo
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-#.FN_BODY ModificationItem/attributeId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_attributeId_OID, object_identifier_id);
+#.FN_PARS ModificationItem/attributeId
+ FN_VARIANT = _str HF_INDEX = hf_cmip_attributeId_OID VAL_PTR = &object_identifier_id
#.FN_BODY ModificationItem/attributeValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-
-#.FN_BODY SpecificErrorInfo/errorId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_errorId_OID, object_identifier_id);
+#.FN_PARS SpecificErrorInfo/errorId
+ FN_VARIANT = _str HF_INDEX = hf_cmip_errorId_OID VAL_PTR = &object_identifier_id
#.FN_BODY SpecificErrorInfo/errorInfo
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-#.FN_BODY AttributeError/attributeId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_attributeId_OID, object_identifier_id);
+#.FN_PARS AttributeError/attributeId
+ FN_VARIANT = _str HF_INDEX = hf_cmip_attributeId_OID VAL_PTR = &object_identifier_id
#.FN_BODY AttributeError/attributeValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
+#.FN_PARS ErrorInfo/actionType
+ FN_VARIANT = _str HF_INDEX = hf_cmip_actionType_OID VAL_PTR = &object_identifier_id
-#.FN_BODY ErrorInfo/actionType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_actionType_OID, object_identifier_id);
-
-#.FN_BODY NoSuchArgumentAction/actionType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_actionType_OID, object_identifier_id);
+#.FN_PARS NoSuchArgumentAction/actionType
+ FN_VARIANT = _str HF_INDEX = hf_cmip_actionType_OID VAL_PTR = &object_identifier_id
-#.FN_BODY NoSuchArgumentEvent/eventType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_eventType_OID, object_identifier_id);
+#.FN_PARS NoSuchArgumentEvent/eventType
+ FN_VARIANT = _str HF_INDEX = hf_cmip_eventType_OID VAL_PTR = &object_identifier_id
-#.FN_BODY InvalidArgumentValueEventValue/eventType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_eventType_OID, object_identifier_id);
+#.FN_PARS InvalidArgumentValueEventValue/eventType
+ FN_VARIANT = _str HF_INDEX = hf_cmip_eventType_OID VAL_PTR = &object_identifier_id
#.FN_BODY InvalidArgumentValueEventValue/eventInfo
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-
#.END
diff --git a/asn1/cmip/packet-cmip-template.c b/asn1/cmip/packet-cmip-template.c
index 20453fb28b..4799c55980 100644
--- a/asn1/cmip/packet-cmip-template.c
+++ b/asn1/cmip/packet-cmip-template.c
@@ -75,16 +75,16 @@ static int opcode_type;
static int attributeform;
#define ATTRIBUTE_LOCAL_FORM 0
#define ATTRIBUTE_GLOBAL_FORM 1
-static char attribute_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *attribute_identifier_id;
-static char attributevalueassertion_id[BER_MAX_OID_STR_LEN];
+static const char *attributevalueassertion_id;
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
static int objectclassform;
#define OBJECTCLASS_LOCAL_FORM 0
#define OBJECTCLASS_GLOBAL_FORM 1
-static char objectclass_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *objectclass_identifier_id;
#include "packet-cmip-fn.c"
diff --git a/asn1/cms/cms.cnf b/asn1/cms/cms.cnf
index b2c8252850..2c09a38d58 100644
--- a/asn1/cms/cms.cnf
+++ b/asn1/cms/cms.cnf
@@ -48,15 +48,15 @@ SignerInfo/signature signatureValue
RecipientEncryptedKey/rid rekRid
#.FN_BODY ContentInfo/contentType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cms_ci_contentType, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_cms_ci_contentType, &object_identifier_id);
#.FN_BODY ContentInfo/content
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
#.FN_BODY EncapsulatedContentInfo/eContentType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cms_ci_contentType, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_cms_ci_contentType, &object_identifier_id);
#.FN_BODY EncapsulatedContentInfo/eContent
gint8 class;
@@ -72,17 +72,14 @@ RecipientEncryptedKey/rid rekRid
pdu_offset = get_ber_length(tree, tvb, pdu_offset, &len, &ind);
pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, pinfo, tree);
-#.FN_BODY OtherKeyAttribute/keyAttrId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cms_ci_contentType, object_identifier_id);
+#.FN_PARS OtherKeyAttribute/keyAttrId
+ FN_VARIANT = _str HF_INDEX = hf_cms_ci_contentType VAL_PTR = &object_identifier_id
#.FN_BODY OtherKeyAttribute/keyAttr
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-#.FN_BODY Attribute/attrType
-
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cms_attrType, object_identifier_id);
+#.FN_PARS Attribute/attrType
+ FN_VARIANT = _str HF_INDEX = hf_cms_attrType VAL_PTR = &object_identifier_id
#.FN_BODY AttributeValue
diff --git a/asn1/cms/packet-cms-template.c b/asn1/cms/packet-cms-template.c
index 644ea2b82d..c52c79da72 100644
--- a/asn1/cms/packet-cms-template.c
+++ b/asn1/cms/packet-cms-template.c
@@ -54,7 +54,7 @@ static int hf_cms_ci_contentType = -1;
static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2eth stops generating these silly wrappers */
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
#include "packet-cms-fn.c"
diff --git a/asn1/ess/ess.cnf b/asn1/ess/ess.cnf
index d4fe6fb510..10c2caa3ae 100644
--- a/asn1/ess/ess.cnf
+++ b/asn1/ess/ess.cnf
@@ -35,9 +35,8 @@ SigningCertificate B "1.2.840.113549.1.9.16.2.12" "id-aa-signingCertificate"
#.FIELD_RENAME
-#.FN_BODY SecurityCategory/type
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
- hf_ess_SecurityCategory_type_OID, object_identifier_id);
+#.FN_PARS SecurityCategory/type
+ FN_VARIANT = _str HF_INDEX = hf_ess_SecurityCategory_type_OID VAL_PTR = &object_identifier_id
#.FN_BODY SecurityCategory/value
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
diff --git a/asn1/ess/packet-ess-template.c b/asn1/ess/packet-ess-template.c
index 3d97f218e7..477522e0fd 100644
--- a/asn1/ess/packet-ess-template.c
+++ b/asn1/ess/packet-ess-template.c
@@ -51,7 +51,7 @@ static int hf_ess_SecurityCategory_type_OID = -1;
/* Initialize the subtree pointers */
#include "packet-ess-ett.c"
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
#include "packet-ess-fn.c"
diff --git a/asn1/ftam/ftam.cnf b/asn1/ftam/ftam.cnf
index d4f6af9448..22ab59d506 100644
--- a/asn1/ftam/ftam.cnf
+++ b/asn1/ftam/ftam.cnf
@@ -68,9 +68,7 @@ Object-Availability-Attribute/actual-values actual_values8
Legal-Qualification-Attribute/actual-values actual_values9
#.FN_PARS Extension-Attribute/extension-attribute-identifier
- VAL_PTR = object_identifier_id
-
-
+ FN_VARIANT = _str VAL_PTR = &object_identifier_id
#.FN_BODY Contents-Type-Attribute/document-type/parameter
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
@@ -79,7 +77,7 @@ Legal-Qualification-Attribute/actual-values actual_values9
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
#.FN_PARS Attribute-Extensions-Pattern/_item/extension-set-attribute-Patterns/_item/extension-attribute-identifier
- VAL_PTR = object_identifier_id
+ FN_VARIANT = _str VAL_PTR = &object_identifier_id
#.FN_BODY Attribute-Extensions-Pattern/_item/extension-set-attribute-Patterns/_item/extension-attribute-Pattern
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
@@ -455,7 +453,7 @@ Legal-Qualification-Attribute/actual-values actual_values9
Diagnostic_sequence_of, hf_index, ett_ftam_Diagnostic);
-#.FN_BODY Document-Type-Name
+#.FN_BODY Document-Type-Name FN_VARIANT = _str VAL_PTR = &object_identifier_id
gint8 class;
gboolean pc, ind_field;
gint32 tag;
@@ -468,8 +466,7 @@ Legal-Qualification-Attribute/actual-values actual_values9
offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
}
- offset = dissect_ber_object_identifier(TRUE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+%(DEFAULT_BODY)s
#.FN_BODY FADU-Lock
gint8 class;
diff --git a/asn1/ftam/packet-ftam-template.c b/asn1/ftam/packet-ftam-template.c
index ceffa589b8..e0b01ebfc9 100644
--- a/asn1/ftam/packet-ftam-template.c
+++ b/asn1/ftam/packet-ftam-template.c
@@ -50,7 +50,7 @@
/* Initialize the protocol and registered fields */
int proto_ftam = -1;
-static char object_identifier_id[MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/* Declare the function to avoid a compiler warning */
static int dissect_ftam_OR_Set(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_);
diff --git a/asn1/ocsp/ocsp.cnf b/asn1/ocsp/ocsp.cnf
index 567ef511bd..1f61c4372d 100644
--- a/asn1/ocsp/ocsp.cnf
+++ b/asn1/ocsp/ocsp.cnf
@@ -31,9 +31,8 @@ ServiceLocator B "1.3.6.1.5.5.7.48.1.7" "id-pkix-ocsp-service-locator"
#.FIELD_RENAME
-#.FN_BODY ResponseBytes/responseType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_ocsp_responseType_id, responseType_id);
+#.FN_PARS ResponseBytes/responseType
+ FN_VARIANT = _str HF_INDEX = hf_ocsp_responseType_id VAL_PTR = &responseType_id
#.FN_BODY ResponseBytes/response
gint8 class;
diff --git a/asn1/ocsp/packet-ocsp-template.c b/asn1/ocsp/packet-ocsp-template.c
index 888a52943b..45b513c329 100644
--- a/asn1/ocsp/packet-ocsp-template.c
+++ b/asn1/ocsp/packet-ocsp-template.c
@@ -53,7 +53,7 @@ static int hf_ocsp_responseType_id = -1;
static gint ett_ocsp = -1;
#include "packet-ocsp-ett.c"
-static char responseType_id[BER_MAX_OID_STR_LEN];
+static const char *responseType_id;
#include "packet-ocsp-fn.c"
diff --git a/asn1/pkix1explicit/packet-pkix1explicit-template.c b/asn1/pkix1explicit/packet-pkix1explicit-template.c
index 5864278ea7..5074eb1846 100644
--- a/asn1/pkix1explicit/packet-pkix1explicit-template.c
+++ b/asn1/pkix1explicit/packet-pkix1explicit-template.c
@@ -54,7 +54,7 @@ static int hf_pkix1explicit_object_identifier_id = -1;
#include "packet-pkix1explicit-ett.c"
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
int
dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
diff --git a/asn1/pkix1explicit/pkix1explicit.cnf b/asn1/pkix1explicit/pkix1explicit.cnf
index 5e9ec6adb0..2ee8302b40 100644
--- a/asn1/pkix1explicit/pkix1explicit.cnf
+++ b/asn1/pkix1explicit/pkix1explicit.cnf
@@ -31,16 +31,14 @@ DomainParameters B "1.2.840.10046.2.1" "dhpublicnumber"
#.FN_BODY DirectoryString
offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
-#.FN_BODY AttributeTypeAndValue/value
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_pkix1explicit_object_identifier_id, object_identifier_id);
+#.FN_PARS AttributeTypeAndValue/value
+ FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id
#.FN_BODY AttributeTypeAndValue/value
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-#.FN_BODY Extension/extnId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_pkix1explicit_object_identifier_id, object_identifier_id);
+#.FN_PARS Extension/extnId
+ FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id
#.FN_BODY Extension/extnValue
gint8 class;
diff --git a/asn1/pkixcmp/cmp.cnf b/asn1/pkixcmp/cmp.cnf
index b6360cea6a..66798b85bf 100644
--- a/asn1/pkixcmp/cmp.cnf
+++ b/asn1/pkixcmp/cmp.cnf
@@ -59,9 +59,8 @@ RevReqContent
#.FIELD_RENAME
-#.FN_BODY InfoTypeAndValue/infoType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmp_type_oid, object_identifier_id);
+#.FN_PARS InfoTypeAndValue/infoType
+ FN_VARIANT = _str HF_INDEX = hf_cmp_type_oid VAL_PTR = &object_identifier_id
#.FN_BODY InfoTypeAndValue/infoValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
diff --git a/asn1/pkixcmp/packet-cmp-template.c b/asn1/pkixcmp/packet-cmp-template.c
index 4ee367dbc7..3e76384102 100644
--- a/asn1/pkixcmp/packet-cmp-template.c
+++ b/asn1/pkixcmp/packet-cmp-template.c
@@ -66,7 +66,7 @@ static int hf_cmp_ttcb = -1;
static gint ett_cmp = -1;
#include "packet-cmp-ett.c"
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
#include "packet-cmp-fn.c"
diff --git a/asn1/pkixcrmf/crmf.cnf b/asn1/pkixcrmf/crmf.cnf
index 3ceb9cadae..e7b77cef0a 100644
--- a/asn1/pkixcrmf/crmf.cnf
+++ b/asn1/pkixcrmf/crmf.cnf
@@ -53,9 +53,8 @@ CertTemplate/issuer template_issuer
POPOSigningKey/signature sk_signature
PKMACValue/value pkmac_value
-#.FN_BODY AttributeTypeAndValue/type
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_crmf_type_oid, object_identifier_id);
+#.FN_PARS AttributeTypeAndValue/type
+ FN_VARIANT = _str HF_INDEX = hf_crmf_type_oid VAL_PTR = &object_identifier_id
#.FN_BODY AttributeTypeAndValue/value
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
diff --git a/asn1/pkixcrmf/packet-crmf-template.c b/asn1/pkixcrmf/packet-crmf-template.c
index 5f5b8679b3..29b60fbc4b 100644
--- a/asn1/pkixcrmf/packet-crmf-template.c
+++ b/asn1/pkixcrmf/packet-crmf-template.c
@@ -52,7 +52,7 @@ static int hf_crmf_type_oid = -1;
/* Initialize the subtree pointers */
#include "packet-crmf-ett.c"
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
#include "packet-crmf-fn.c"
diff --git a/asn1/pkixqualified/packet-pkixqualified-template.c b/asn1/pkixqualified/packet-pkixqualified-template.c
index 865868e203..b7d0f75244 100644
--- a/asn1/pkixqualified/packet-pkixqualified-template.c
+++ b/asn1/pkixqualified/packet-pkixqualified-template.c
@@ -51,7 +51,7 @@ int proto_pkixqualified = -1;
/* Initialize the subtree pointers */
#include "packet-pkixqualified-ett.c"
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
#include "packet-pkixqualified-fn.c"
diff --git a/asn1/pkixqualified/pkixqualified.cnf b/asn1/pkixqualified/pkixqualified.cnf
index 29b2050fff..3307a6fc67 100644
--- a/asn1/pkixqualified/pkixqualified.cnf
+++ b/asn1/pkixqualified/pkixqualified.cnf
@@ -31,9 +31,8 @@ Printablestring B "1.3.6.1.5.5.7.9.5" "id-pda-countryOfResidence"
#.FIELD_RENAME
-#.FN_BODY QCStatement/statementId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_pkixqualified_statementId, object_identifier_id);
+#.FN_PARS QCStatement/statementId
+ FN_VARIANT = _str HF_INDEX = hf_pkixqualified_statementId VAL_PTR = &object_identifier_id
#.FN_BODY QCStatement/statementInfo
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
diff --git a/asn1/pres/packet-pres-template.c b/asn1/pres/packet-pres-template.c
index f4b79ac433..7e7513b6ff 100644
--- a/asn1/pres/packet-pres-template.c
+++ b/asn1/pres/packet-pres-template.c
@@ -58,7 +58,7 @@ packet_info *global_pinfo = NULL;
/* dissector for data */
static dissector_handle_t data_handle;
-static char abstract_syntax_name_oid[BER_MAX_OID_STR_LEN];
+static const char *abstract_syntax_name_oid;
static guint32 presentation_context_identifier;
/* to keep track of presentation context identifiers and protocol-oids */
@@ -111,7 +111,7 @@ pres_init(void)
}
static void
-register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
+register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid)
{
pres_ctx_oid_t *pco, *tmppco;
pco=se_alloc(sizeof(pres_ctx_oid_t));
diff --git a/asn1/pres/pres.cnf b/asn1/pres/pres.cnf
index fd5c4df37e..ba2d332ac9 100644
--- a/asn1/pres/pres.cnf
+++ b/asn1/pres/pres.cnf
@@ -63,7 +63,7 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason
#.FN_PARS Abstract_syntax_name
- VAL_PTR = abstract_syntax_name_oid
+ FN_VARIANT = _str VAL_PTR = &abstract_syntax_name_oid
#.FN_PARS Presentation_context_identifier
VAL_PTR = &presentation_context_identifier
diff --git a/asn1/spnego/packet-spnego-template.c b/asn1/spnego/packet-spnego-template.c
index 151eb43a12..59f7851668 100644
--- a/asn1/spnego/packet-spnego-template.c
+++ b/asn1/spnego/packet-spnego-template.c
@@ -73,7 +73,7 @@ static int hf_spnego_krb5_confounder = -1;
#include "packet-spnego-hf.c"
/* Global variables */
-gchar MechType_oid[MAX_OID_STR_LEN];
+static const char *MechType_oid;
gssapi_oid_value *next_level_value;
gboolean saw_mechanism = FALSE;
@@ -163,7 +163,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *subtree;
int offset = 0;
guint16 token_id;
- gchar oid[MAX_OID_STR_LEN];
+ const char *oid;
gssapi_oid_value *value;
tvbuff_t *krb5_tvb;
gint8 class;
@@ -222,7 +222,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
/* Next, the OID */
- offset=dissect_ber_object_identifier(FALSE, pinfo, subtree, tvb, offset, hf_spnego_krb5_oid, oid);
+ offset=dissect_ber_object_identifier_str(FALSE, pinfo, subtree, tvb, offset, hf_spnego_krb5_oid, &oid);
value = gssapi_lookup_oid_str(oid);
diff --git a/asn1/spnego/spnego.cnf b/asn1/spnego/spnego.cnf
index 1ebd727d5e..d39d09238a 100644
--- a/asn1/spnego/spnego.cnf
+++ b/asn1/spnego/spnego.cnf
@@ -17,7 +17,7 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC
#.FN_PARS MechType
- VAL_PTR = MechType_oid
+ FN_VARIANT = _str VAL_PTR = &MechType_oid
#.FN_BODY MechType
diff --git a/asn1/tcap/packet-tcap-template.c b/asn1/tcap/packet-tcap-template.c
index 0bf0d6334e..1755934979 100644
--- a/asn1/tcap/packet-tcap-template.c
+++ b/asn1/tcap/packet-tcap-template.c
@@ -74,8 +74,8 @@ static gboolean g_tcap_ends_def_len = FALSE;
dissector_handle_t tcap_handle;
static dissector_table_t ber_oid_dissector_table=NULL;
-static char * cur_oid;
-static char * tcapext_oid;
+static const char * cur_oid;
+static const char * tcapext_oid;
static proto_tree *tcap_top_tree=NULL;
static dissector_handle_t data_handle;
static dissector_table_t tcap_itu_ssn_dissector_table; /* map use ssn in sccp */
diff --git a/asn1/tcap/tcap.cnf b/asn1/tcap/tcap.cnf
index 2e3068f0ee..687f5601ce 100644
--- a/asn1/tcap/tcap.cnf
+++ b/asn1/tcap/tcap.cnf
@@ -124,19 +124,13 @@ else
dissector_try_port(tcap_itu_ssn_dissector_table, pinfo->match_port, next_tvb, pinfo, tcap_top_tree);
return offset+len;
-#.FN_BODY Applicationcontext
- static char buffer[128];
- cur_oid = buffer;
- pinfo->private_data = buffer;
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, cur_oid);
-
-#.FN_BODY UserInfoOID
- static char buffer[128];
- tcapext_oid = buffer;
- pinfo->private_data = buffer;
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, tcapext_oid);
+#.FN_BODY Applicationcontext FN_VARIANT = _str VAL_PTR = &cur_oid
+%(DEFAULT_BODY)s
+ pinfo->private_data = cur_oid;
+
+#.FN_BODY UserInfoOID FN_VARIANT = _str VAL_PTR = &tcapext_oid
+%(DEFAULT_BODY)s
+ pinfo->private_data = tcapext_oid;
#.FN_BODY ExternUserInfo
tvbuff_t *next_tvb;
diff --git a/asn1/x411/packet-x411-template.c b/asn1/x411/packet-x411-template.c
index a02ed78ec0..f21ef4ebb1 100644
--- a/asn1/x411/packet-x411-template.c
+++ b/asn1/x411/packet-x411-template.c
@@ -28,6 +28,7 @@
#endif
#include <glib.h>
+#include <epan/emem.h>
#include <epan/packet.h>
#include <epan/conversation.h>
@@ -55,7 +56,7 @@ int proto_x411 = -1;
static struct SESSION_DATA_STRUCTURE* session = NULL;
static int extension_id = 0; /* integer extension id */
-static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */
+static const char *object_identifier_id; /* content type identifier */
static proto_tree *top_tree=NULL;
diff --git a/asn1/x411/x411.cnf b/asn1/x411/x411.cnf
index 2260d5fd73..72cdef65c7 100644
--- a/asn1/x411/x411.cnf
+++ b/asn1/x411/x411.cnf
@@ -263,7 +263,7 @@ UniversalOrganizationalUnitNames B "x411.extension-attribute.27" "universal-orga
VAL_PTR = &extension_id
#.FN_PARS ExtendedContentType
- VAL_PTR = object_identifier_id
+ FN_VARIANT = _str VAL_PTR = &object_identifier_id
#.FN_PARS BuiltInContentType
VAL_PTR = &ict
@@ -276,10 +276,10 @@ UniversalOrganizationalUnitNames B "x411.extension-attribute.27" "universal-orga
/* convert integer content type to oid for dispatch when the content is found */
switch(ict) {
case 2:
- g_snprintf(object_identifier_id, BER_MAX_OID_STR_LEN, "2.6.1.10.0");
+ object_identifier_id = ep_strdup("2.6.1.10.0");
break;
case 22:
- g_snprintf(object_identifier_id, BER_MAX_OID_STR_LEN, "2.6.1.10.1");
+ object_identifier_id = ep_strdup("2.6.1.10.1");
break;
default:
break;
diff --git a/asn1/x420/packet-x420-template.c b/asn1/x420/packet-x420-template.c
index e17d6af99f..f0be929410 100644
--- a/asn1/x420/packet-x420-template.c
+++ b/asn1/x420/packet-x420-template.c
@@ -50,7 +50,7 @@
/* Initialize the protocol and registered fields */
int proto_x420 = -1;
-static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */
+static const char *object_identifier_id; /* content type identifier */
#include "packet-x420-hf.c"
diff --git a/asn1/x420/x420.cnf b/asn1/x420/x420.cnf
index 71e7148527..564089c8a3 100644
--- a/asn1/x420/x420.cnf
+++ b/asn1/x420/x420.cnf
@@ -46,7 +46,7 @@ ChangeOfAddressAdvice B "2.6.1.19.1" "id-on-change-of-address-advice"
IPMAssemblyInstructions B "2.6.1.17.2" "id-mst-assembly-instructions"
#.FN_PARS IPMSExtension/type
- VAL_PTR = object_identifier_id
+ FN_VARIANT = _str VAL_PTR = &object_identifier_id
#.FN_BODY IPMSExtension/type
char *name = NULL;
diff --git a/asn1/x509af/packet-x509af-template.c b/asn1/x509af/packet-x509af-template.c
index 1f8a2993b9..393a052eea 100644
--- a/asn1/x509af/packet-x509af-template.c
+++ b/asn1/x509af/packet-x509af-template.c
@@ -54,10 +54,10 @@ static int hf_x509af_extension_id = -1;
static gint ett_pkix_crl = -1;
#include "packet-x509af-ett.c"
-static char algorithm_id[BER_MAX_OID_STR_LEN];
+static const char *algorithm_id;
-static char extension_id[BER_MAX_OID_STR_LEN];
+static const char *extension_id;
#include "packet-x509af-fn.c"
diff --git a/asn1/x509af/x509af.cnf b/asn1/x509af/x509af.cnf
index 942155eddf..4bde694356 100644
--- a/asn1/x509af/x509af.cnf
+++ b/asn1/x509af/x509af.cnf
@@ -66,16 +66,15 @@ IssuerSerial/issuer issuerName
CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate revokedUserCertificate
#.END
-#.FN_BODY AlgorithmIdentifier/algorithmId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509af_algorithm_id, algorithm_id);
+#.FN_PARS AlgorithmIdentifier/algorithmId
+ FN_VARIANT = _str HF_INDEX = hf_x509af_algorithm_id VAL_PTR = &algorithm_id
+
#.FN_BODY AlgorithmIdentifier/parameters
offset=call_ber_oid_callback(algorithm_id, tvb, offset, pinfo, tree);
-#.FN_BODY Extension/extnId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509af_extension_id, extension_id);
+#.FN_PARS Extension/extnId
+ FN_VARIANT = _str HF_INDEX = hf_x509af_extension_id VAL_PTR = &extension_id
#.FN_BODY Extension/extnValue
gint8 class;
diff --git a/asn1/x509ce/packet-x509ce-template.c b/asn1/x509ce/packet-x509ce-template.c
index 05945be10f..d5928ceba9 100644
--- a/asn1/x509ce/packet-x509ce-template.c
+++ b/asn1/x509ce/packet-x509ce-template.c
@@ -55,7 +55,7 @@ static int hf_x509ce_IPAddress = -1;
/* Initialize the subtree pointers */
#include "packet-x509ce-ett.c"
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
#include "packet-x509ce-fn.c"
diff --git a/asn1/x509ce/x509ce.cnf b/asn1/x509ce/x509ce.cnf
index a547e1876c..edce713b94 100644
--- a/asn1/x509ce/x509ce.cnf
+++ b/asn1/x509ce/x509ce.cnf
@@ -104,9 +104,8 @@ CRLReferral/issuer crlr_issuer
CertificatePairExactAssertion/issuedToThisCAAssertion cpea_issuedToThisCAAssertion
CertificatePairExactAssertion/issuedByThisCAAssertion cpea_issuedByThisCAAssertion
-#.FN_BODY PolicyQualifierId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509ce_object_identifier_id, object_identifier_id);
+#.FN_PARS PolicyQualifierId
+ FN_VARIANT = _str HF_INDEX = hf_x509ce_object_identifier_id VAL_PTR = &object_identifier_id
#.FN_BODY PolicyQualifierValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
diff --git a/asn1/x509if/packet-x509if-template.c b/asn1/x509if/packet-x509if-template.c
index 097e4e1551..a53ddcc364 100644
--- a/asn1/x509if/packet-x509if-template.c
+++ b/asn1/x509if/packet-x509if-template.c
@@ -50,7 +50,7 @@ static int hf_x509if_object_identifier_id = -1;
/* Initialize the subtree pointers */
#include "packet-x509if-ett.c"
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
#include "packet-x509if-fn.c"
diff --git a/asn1/x509if/x509if.cnf b/asn1/x509if/x509if.cnf
index 09303e7eab..d59a97022a 100644
--- a/asn1/x509if/x509if.cnf
+++ b/asn1/x509if/x509if.cnf
@@ -84,16 +84,14 @@ RequestAttribute/defaultValues/_item/values/_item ra_values_item
RequestAttribute/selectedValues ra_selectedValues
RequestAttribute/selectedValues/_item ra_selectedValues_item
-#.FN_BODY ContextId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509if_object_identifier_id, object_identifier_id);
+#.FN_PARS ContextId
+ FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
#.FN_BODY ContextValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-#.FN_BODY AttributeId
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509if_object_identifier_id, object_identifier_id);
+#.FN_PARS AttributeId
+ FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
#.FN_BODY AttributeValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
@@ -101,9 +99,8 @@ RequestAttribute/selectedValues/_item ra_selectedValues_item
#.FN_BODY SelectedValues
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-#.FN_BODY DefaultValueType
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509if_object_identifier_id, object_identifier_id);
+#.FN_PARS DefaultValueType
+ FN_VARIANT = _str HF_INDEX = hf_x509if_object_identifier_id VAL_PTR = &object_identifier_id
#.FN_BODY DefaultValueValues
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
diff --git a/epan/dissectors/packet-acse.c b/epan/dissectors/packet-acse.c
index 2fb969ef56..6cedf275dc 100644
--- a/epan/dissectors/packet-acse.c
+++ b/epan/dissectors/packet-acse.c
@@ -226,7 +226,7 @@ static gint ett_acse_Authentication_value = -1;
static struct SESSION_DATA_STRUCTURE* session = NULL;
-static char object_identifier_id[MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/* indirect_reference, used to pick up the signalling so we know what
kind of data is transferred in SES_DATA_TRANSFER_PDUs */
static guint32 indir_ref=0;
@@ -308,10 +308,7 @@ find_oid_by_ctx_id(packet_info *pinfo _U_, guint32 idx)
static int
dissect_acse_T_direct_reference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
-
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
return offset;
}
@@ -330,7 +327,7 @@ dissect_acse_T_indirect_reference(gboolean implicit_tag _U_, tvbuff_t *tvb, int
/* look up the indirect reference */
if((oid = find_oid_by_pres_ctx_id(pinfo, indir_ref)) != NULL) {
- g_snprintf(object_identifier_id, MAX_OID_STR_LEN, "%s", oid);
+ object_identifier_id = ep_strdup(oid);
}
if(session)
@@ -498,8 +495,8 @@ static int dissect_ASO_context_name_list_item(packet_info *pinfo, proto_tree *tr
static int
dissect_acse_T_AARQ_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_index, &object_identifier_id);
return offset;
@@ -764,9 +761,7 @@ static int dissect_charstring_impl(packet_info *pinfo, proto_tree *tree, tvbuff_
static int
dissect_acse_T_other_mechanism_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
return offset;
}
@@ -1164,8 +1159,8 @@ static int dissect_aARE_protocol_version_impl(packet_info *pinfo, proto_tree *tr
static int
dissect_acse_T_AARE_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_index, &object_identifier_id);
return offset;
@@ -1672,8 +1667,8 @@ static int dissect_adt_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
static int
dissect_acse_T_ACRQ_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_index, &object_identifier_id);
return offset;
@@ -1708,8 +1703,8 @@ static int dissect_acrq_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
static int
dissect_acse_T_ACRP_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_index, &object_identifier_id);
return offset;
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index a5d4de7a9f..b652d2cbe5 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -201,7 +201,7 @@ register_ber_oid_name(const char *oid, const char *name)
/* Get oid name from hash table to get translation in proto dissection(packet-per.c) */
char *
-get_ber_oid_name(char *oid)
+get_ber_oid_name(const char *oid)
{
return g_hash_table_lookup(oid_table, oid);
}
@@ -1716,16 +1716,17 @@ dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i
* if value_string is non-NULL it must point to a buffer of at least
* MAX_OID_STR_LEN bytes.
*/
-int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *value_string) {
+int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **value_tvb)
+{
gint8 class;
gboolean pc;
gint32 tag;
guint32 len;
int eoffset;
char *str, *name;
- proto_item *item;
+ proto_item *item = NULL;
+ header_field_info *hfi;
- str=ep_alloc(MAX_OID_STR_LEN);
#ifdef DEBUG_BER
{
char *name;
@@ -1744,10 +1745,6 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
}
#endif
- if(value_string) {
- value_string[0] = '\0';
- }
-
if(!implicit_tag) {
/* sanity check */
offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
@@ -1764,27 +1761,50 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
eoffset=offset+len;
}
- oid_to_str_buf(tvb_get_ptr(tvb, offset, len), len, str, MAX_OID_STR_LEN);
- offset += len;
+ str = oid_to_str(tvb_get_ptr(tvb, offset, len), len);
- if(hf_id >= 0) {
- item=proto_tree_add_string(tree, hf_id, tvb, offset - len, len, str);
- /* see if we know the name of this oid */
- if(item){
- name=g_hash_table_lookup(oid_table, str);
- if(name){
- proto_item_append_text(item, " (%s)", name);
- }
- }
- }
+ hfi = proto_registrar_get_nth(hf_id);
+ /*if (hfi->type == FT_OID) {
+ item = proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
+ } else*/ if (IS_FT_STRING(hfi->type)) {
+ item = proto_tree_add_string(tree, hf_id, tvb, offset, len, str);
+ } else {
+ DISSECTOR_ASSERT_NOT_REACHED();
+ }
+
+ if (value_tvb)
+ *value_tvb = tvb_new_subset(tvb, offset, len, len);
- if(value_string) {
- g_snprintf(value_string, MAX_OID_STR_LEN, "%s", str);
+ /* see if we know the name of this oid */
+ if(item){
+ name=g_hash_table_lookup(oid_table, str);
+ if(name){
+ proto_item_append_text(item, " (%s)", name);
+ }
}
return eoffset;
}
+int dissect_ber_object_identifier_str(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, const char **value_string)
+{
+ tvbuff_t *value_tvb = NULL;
+ guint length;
+
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_id, (value_string) ? &value_tvb : NULL);
+
+ if (value_string) {
+ if (value_tvb && (length = tvb_length(value_tvb))) {
+ *value_string = oid_to_str(tvb_get_ptr(value_tvb, 0, length), length);
+ } else {
+ *value_string = "";
+ }
+ }
+
+ return offset;
+}
+
+
static int dissect_ber_sq_of(gboolean implicit_tag, gint32 type, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_sequence_t *seq, gint hf_id, gint ett_id) {
gint8 class;
gboolean pc, ind = FALSE, ind_field;
diff --git a/epan/dissectors/packet-ber.h b/epan/dissectors/packet-ber.h
index 7626f0d167..015b61fc99 100644
--- a/epan/dissectors/packet-ber.h
+++ b/epan/dissectors/packet-ber.h
@@ -135,10 +135,9 @@ extern int dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuf
/* this function dissects a BER Object Identifier
- * IF you pass a pointer for value_string to this one, MAKE SURE it is declared
- * as char foo[MAX_OID_STR_LEN]
*/
-extern int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *value_string);
+extern int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **value_tvb);
+extern int dissect_ber_object_identifier_str(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, const char **value_string);
/* this function dissects a BER sequence of
*/
@@ -171,7 +170,7 @@ void register_ber_oid_dissector_handle(const char *oid, dissector_handle_t disse
void register_ber_oid_dissector(const char *oid, dissector_t dissector, int proto, const char *name);
void register_ber_oid_name(const char *oid, const char *name);
void dissect_ber_oid_NULL_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-char * get_ber_oid_name(char *str);
+char * get_ber_oid_name(const char *str);
#endif /* __PACKET_BER_H__ */
diff --git a/epan/dissectors/packet-cmip.c b/epan/dissectors/packet-cmip.c
index a146f34a07..8f993eae59 100644
--- a/epan/dissectors/packet-cmip.c
+++ b/epan/dissectors/packet-cmip.c
@@ -303,16 +303,16 @@ static int opcode_type;
static int attributeform;
#define ATTRIBUTE_LOCAL_FORM 0
#define ATTRIBUTE_GLOBAL_FORM 1
-static char attribute_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *attribute_identifier_id;
-static char attributevalueassertion_id[BER_MAX_OID_STR_LEN];
+static const char *attributevalueassertion_id;
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
static int objectclassform;
#define OBJECTCLASS_LOCAL_FORM 0
#define OBJECTCLASS_GLOBAL_FORM 1
-static char objectclass_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *objectclass_identifier_id;
/*--- Included file: packet-cmip-fn.c ---*/
@@ -371,9 +371,7 @@ static int dissect_modifyOperator_impl(packet_info *pinfo, proto_tree *tree, tvb
static int
dissect_cmip_T_attributeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_attributeId_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_attributeId_OID, &object_identifier_id);
return offset;
}
@@ -388,7 +386,6 @@ dissect_cmip_T_attributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-
return offset;
}
static int dissect_attributeValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
@@ -419,9 +416,7 @@ static int dissect_modificationList_item(packet_info *pinfo, proto_tree *tree, t
static int
dissect_cmip_T_ocglobalForm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
objectclassform = OBJECTCLASS_GLOBAL_FORM;
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
- hf_cmip_ocglobalForm, objectclass_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &objectclass_identifier_id);
return offset;
}
@@ -434,8 +429,9 @@ static int dissect_ocglobalForm_impl(packet_info *pinfo, proto_tree *tree, tvbuf
static int
dissect_cmip_T_oclocalForm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
objectclassform = OBJECTCLASS_LOCAL_FORM;
- offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_oclocalForm, NULL);
+ offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
+ NULL);
return offset;
}
@@ -475,8 +471,7 @@ static int dissect_baseManagedObjectClass(packet_info *pinfo, proto_tree *tree,
static int
dissect_cmip_T_id(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- attributevalueassertion_id);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &attributevalueassertion_id);
return offset;
}
@@ -650,8 +645,7 @@ static int dissect_errorStatus(packet_info *pinfo, proto_tree *tree, tvbuff_t *t
static int
dissect_cmip_T_globalForm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
attributeform = ATTRIBUTE_GLOBAL_FORM;
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- attribute_identifier_id);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &attribute_identifier_id);
@@ -877,9 +871,7 @@ static int dissect_errorStatus2(packet_info *pinfo, proto_tree *tree, tvbuff_t *
static int
dissect_cmip_T_attributeId1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_attributeId_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_attributeId_OID, &object_identifier_id);
return offset;
}
@@ -894,7 +886,6 @@ dissect_cmip_T_attributeValue1(gboolean implicit_tag _U_, tvbuff_t *tvb, int off
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-
return offset;
}
static int dissect_attributeValue1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
@@ -1007,9 +998,7 @@ static int dissect_errorStatus1(packet_info *pinfo, proto_tree *tree, tvbuff_t *
static int
dissect_cmip_T_actionType1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_actionType_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_actionType_OID, &object_identifier_id);
return offset;
}
@@ -1021,9 +1010,7 @@ static int dissect_actionType1(packet_info *pinfo, proto_tree *tree, tvbuff_t *t
static int
dissect_cmip_T_actionType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_actionType_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_actionType_OID, &object_identifier_id);
return offset;
}
@@ -1053,9 +1040,7 @@ static int dissect_actionId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
static int
dissect_cmip_T_eventType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_eventType_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_eventType_OID, &object_identifier_id);
return offset;
}
@@ -1110,9 +1095,7 @@ static int dissect_actionArgument(packet_info *pinfo, proto_tree *tree, tvbuff_t
static int
dissect_cmip_T_actionType3(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_actionType_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_actionType_OID, &object_identifier_id);
return offset;
}
@@ -1158,9 +1141,7 @@ static int dissect_actionInfo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_
static int
dissect_cmip_T_eventType1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_eventType_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_eventType_OID, &object_identifier_id);
return offset;
}
@@ -1175,7 +1156,6 @@ dissect_cmip_T_eventInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-
return offset;
}
static int dissect_eventInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
@@ -1294,9 +1274,7 @@ static int dissect_actionError_impl(packet_info *pinfo, proto_tree *tree, tvbuff
static int
dissect_cmip_T_errorId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_errorId_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_errorId_OID, &object_identifier_id);
return offset;
}
@@ -1707,9 +1685,7 @@ static int dissect_getResult_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
static int
dissect_cmip_T_actionType2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_actionType_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_actionType_OID, &object_identifier_id);
return offset;
}
@@ -1827,9 +1803,7 @@ dissect_cmip_LinkedReplyArgument(gboolean implicit_tag _U_, tvbuff_t *tvb, int o
static int
dissect_cmip_T_eventType2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_eventType_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_eventType_OID, &object_identifier_id);
return offset;
}
@@ -1889,9 +1863,7 @@ dissect_cmip_EventReportResult(gboolean implicit_tag _U_, tvbuff_t *tvb, int off
static int
dissect_cmip_T_eventType3(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmip_eventType_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_eventType_OID, &object_identifier_id);
return offset;
}
@@ -1906,7 +1878,6 @@ dissect_cmip_T_eventInfo1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
-
return offset;
}
static int dissect_eventInfo1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
@@ -2107,8 +2078,7 @@ static int dissect_ae_title_form1(packet_info *pinfo, proto_tree *tree, tvbuff_t
static int
dissect_cmip_AE_title_form2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -2202,8 +2172,7 @@ dissect_cmip_OperationalState(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
static int
dissect_cmip_NameBinding(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
diff --git a/epan/dissectors/packet-cmp.c b/epan/dissectors/packet-cmp.c
index b96e3586d2..6bafc791f0 100644
--- a/epan/dissectors/packet-cmp.c
+++ b/epan/dissectors/packet-cmp.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-cmp.c */
+/* .\packet-cmp.c */
/* ../../tools/asn2eth.py -X -b -e -p cmp -c cmp.cnf -s packet-cmp-template CMP.asn */
/* Input file: packet-cmp-template.c */
@@ -227,7 +227,7 @@ static gint ett_cmp_ErrorMsgContent = -1;
/*--- End of included file: packet-cmp-ett.c ---*/
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
@@ -456,9 +456,7 @@ static int dissect_errorDetails(packet_info *pinfo, proto_tree *tree, tvbuff_t *
static int
dissect_cmp_T_infoType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cmp_type_oid, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmp_type_oid, &object_identifier_id);
return offset;
}
@@ -1466,7 +1464,7 @@ dissect_cmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
return tvb_length(tvb);
}
-static void
+static int
dissect_cmp_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
proto_item *item=NULL;
@@ -2028,7 +2026,7 @@ void proto_reg_handoff_cmp(void) {
dissector_handle_t cmp_http_handle;
dissector_handle_t cmp_tcp_handle;
- cmp_http_handle = create_dissector_handle(dissect_cmp_http, proto_cmp);
+ cmp_http_handle = new_create_dissector_handle(dissect_cmp_http, proto_cmp);
dissector_add_string("media_type", "application/pkixcmp", cmp_http_handle);
cmp_tcp_handle = new_create_dissector_handle(dissect_cmp_tcp, proto_cmp);
diff --git a/epan/dissectors/packet-cms.c b/epan/dissectors/packet-cms.c
index 23f5edf89d..6eeef3220f 100644
--- a/epan/dissectors/packet-cms.c
+++ b/epan/dissectors/packet-cms.c
@@ -197,7 +197,7 @@ static gint ett_cms_ExtendedCertificateInfo = -1;
static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2eth stops generating these silly wrappers */
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/*--- Included file: packet-cms-fn.c ---*/
@@ -239,8 +239,8 @@ static int dissect_contentType1(packet_info *pinfo, proto_tree *tree, tvbuff_t *
static int
dissect_cms_T_contentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cms_ci_contentType, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_cms_ci_contentType, &object_identifier_id);
return offset;
@@ -337,8 +337,8 @@ static int dissect_digestAlgorithms(packet_info *pinfo, proto_tree *tree, tvbuff
static int
dissect_cms_T_eContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cms_ci_contentType, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+ hf_cms_ci_contentType, &object_identifier_id);
return offset;
@@ -393,10 +393,7 @@ static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff
static int
dissect_cms_T_attrType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cms_attrType, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
return offset;
}
@@ -950,9 +947,7 @@ static int dissect_generalTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *t
static int
dissect_cms_T_keyAttrId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_cms_ci_contentType, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cms_ci_contentType, &object_identifier_id);
return offset;
}
diff --git a/epan/dissectors/packet-crmf.c b/epan/dissectors/packet-crmf.c
index 01d2ba8dcf..2a87725cba 100644
--- a/epan/dissectors/packet-crmf.c
+++ b/epan/dissectors/packet-crmf.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-crmf.c */
+/* .\packet-crmf.c */
/* ../../tools/asn2eth.py -X -b -e -p crmf -c crmf.cnf -s packet-crmf-template CRMF.asn */
/* Input file: packet-crmf-template.c */
@@ -154,7 +154,7 @@ static gint ett_crmf_CertId = -1;
/*--- End of included file: packet-crmf-ett.c ---*/
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/*--- Included file: packet-crmf-fn.c ---*/
@@ -374,9 +374,7 @@ static int dissect_certTemplate(packet_info *pinfo, proto_tree *tree, tvbuff_t *
static int
dissect_crmf_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_crmf_type_oid, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_crmf_type_oid, &object_identifier_id);
return offset;
}
diff --git a/epan/dissectors/packet-ess.c b/epan/dissectors/packet-ess.c
index 2719a22d0a..65b0e5d523 100644
--- a/epan/dissectors/packet-ess.c
+++ b/epan/dissectors/packet-ess.c
@@ -138,7 +138,7 @@ static gint ett_ess_IssuerSerial = -1;
/*--- End of included file: packet-ess-ett.c ---*/
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/*--- Included file: packet-ess-fn.c ---*/
@@ -458,9 +458,7 @@ static int dissect_privacy_mark(packet_info *pinfo, proto_tree *tree, tvbuff_t *
static int
dissect_ess_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
- hf_ess_SecurityCategory_type_OID, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_ess_SecurityCategory_type_OID, &object_identifier_id);
return offset;
}
diff --git a/epan/dissectors/packet-ftam.c b/epan/dissectors/packet-ftam.c
index e6364c16d4..c9097d8ec6 100644
--- a/epan/dissectors/packet-ftam.c
+++ b/epan/dissectors/packet-ftam.c
@@ -57,7 +57,7 @@
/* Initialize the protocol and registered fields */
int proto_ftam = -1;
-static char object_identifier_id[MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/* Declare the function to avoid a compiler warning */
static int dissect_ftam_OR_Set(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_);
@@ -936,8 +936,8 @@ dissect_ftam_Document_Type_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int of
offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
}
- offset = dissect_ber_object_identifier(TRUE, pinfo, tree, tvb, offset,
- hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
+
return offset;
@@ -2698,7 +2698,7 @@ static int dissect_extension_set_identifier_impl(packet_info *pinfo, proto_tree
static int
dissect_ftam_T_extension_attribute_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
return offset;
}
@@ -4816,7 +4816,7 @@ static int dissect_object_availabiiity_Pattern_impl(packet_info *pinfo, proto_tr
static int
dissect_ftam_T_extension_attribute_identifier1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
return offset;
}
diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c
index 8321b811cb..ff44d3d286 100644
--- a/epan/dissectors/packet-gssapi.c
+++ b/epan/dissectors/packet-gssapi.c
@@ -101,7 +101,7 @@ gssapi_init_oid(const char *oid, int proto, int ett, dissector_handle_t handle,
* an argument.
*/
gssapi_oid_value *
-gssapi_lookup_oid_str(gchar *oid_key)
+gssapi_lookup_oid_str(const char *oid_key)
{
gssapi_oid_value *value;
value = g_hash_table_lookup(gssapi_oids, oid_key);
@@ -124,7 +124,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
- gchar oid[MAX_OID_STR_LEN];
+ const char *oid;
start_offset=0;
offset=start_offset;
@@ -234,7 +234,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Read oid */
oid_start_offset=offset;
- offset=dissect_ber_object_identifier(FALSE, pinfo, subtree, tvb, offset, hf_gssapi_oid, oid);
+ offset=dissect_ber_object_identifier_str(FALSE, pinfo, subtree, tvb, offset, hf_gssapi_oid, &oid);
/*
* Hand off to subdissector.
diff --git a/epan/dissectors/packet-ocsp.c b/epan/dissectors/packet-ocsp.c
index 6a8dbcd375..27de186e3e 100644
--- a/epan/dissectors/packet-ocsp.c
+++ b/epan/dissectors/packet-ocsp.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-ocsp.c */
+/* .\packet-ocsp.c */
/* ../../tools/asn2eth.py -X -b -e -p ocsp -c ocsp.cnf -s packet-ocsp-template OCSP.asn */
/* Input file: packet-ocsp-template.c */
@@ -139,7 +139,7 @@ static gint ett_ocsp_CrlID = -1;
/*--- End of included file: packet-ocsp-ett.c ---*/
-static char responseType_id[BER_MAX_OID_STR_LEN];
+static const char *responseType_id;
@@ -389,9 +389,7 @@ static int dissect_responseStatus(packet_info *pinfo, proto_tree *tree, tvbuff_t
static int
dissect_ocsp_T_responseType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_ocsp_responseType_id, responseType_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_ocsp_responseType_id, &responseType_id);
return offset;
}
@@ -671,8 +669,7 @@ dissect_ocsp_ArchiveCutoff(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
static int
dissect_ocsp_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
diff --git a/epan/dissectors/packet-pkix1explicit.c b/epan/dissectors/packet-pkix1explicit.c
index db033ba73c..9486db1fd7 100644
--- a/epan/dissectors/packet-pkix1explicit.c
+++ b/epan/dissectors/packet-pkix1explicit.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-pkix1explicit.c */
+/* .\packet-pkix1explicit.c */
/* ../../tools/asn2eth.py -e -X -b -p pkix1explicit -c pkix1explicit.cnf -s packet-pkix1explicit-template PKIX1EXPLICIT93.asn */
/* Input file: packet-pkix1explicit-template.c */
@@ -98,7 +98,7 @@ static gint ett_pkix1explicit_TeletexDomainDefinedAttribute = -1;
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
int
dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
@@ -159,9 +159,7 @@ dissect_pkix1explicit_CertificateSerialNumber(gboolean implicit_tag _U_, tvbuff_
static int
dissect_pkix1explicit_T_extnId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_pkix1explicit_object_identifier_id, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_pkix1explicit_object_identifier_id, &object_identifier_id);
return offset;
}
@@ -313,8 +311,7 @@ dissect_pkix1explicit_DomainParameters(gboolean implicit_tag _U_, tvbuff_t *tvb,
static int
dissect_pkix1explicit_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -326,9 +323,6 @@ static int dissect_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int
static int
dissect_pkix1explicit_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_pkix1explicit_object_identifier_id, object_identifier_id);
-
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
diff --git a/epan/dissectors/packet-pkixqualified.c b/epan/dissectors/packet-pkixqualified.c
index 52e35a70f6..d409ce5e53 100644
--- a/epan/dissectors/packet-pkixqualified.c
+++ b/epan/dissectors/packet-pkixqualified.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-pkixqualified.c */
+/* .\packet-pkixqualified.c */
/* ../../tools/asn2eth.py -X -b -e -p pkixqualified -c pkixqualified.cnf -s packet-pkixqualified-template PKIXqualified.asn */
/* Input file: packet-pkixqualified-template.c */
@@ -94,7 +94,7 @@ static gint ett_pkixqualified_NameRegistrationAuthorities = -1;
/*--- End of included file: packet-pkixqualified-ett.c ---*/
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/*--- Included file: packet-pkixqualified-fn.c ---*/
@@ -160,8 +160,7 @@ static int dissect_predefinedBiometricType(packet_info *pinfo, proto_tree *tree,
static int
dissect_pkixqualified_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -261,9 +260,7 @@ dissect_pkixqualified_BiometricSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb,
static int
dissect_pkixqualified_T_statementId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_pkixqualified_statementId, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_pkixqualified_statementId, &object_identifier_id);
return offset;
}
@@ -317,7 +314,7 @@ dissect_pkixqualified_QCStatements(gboolean implicit_tag _U_, tvbuff_t *tvb, int
static const ber_sequence_t NameRegistrationAuthorities_sequence_of[1] = {
- { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_NameRegistrationAuthorities_item },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_NameRegistrationAuthorities_item },
};
static int
diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c
index 882261da2a..ba0b1c49a6 100644
--- a/epan/dissectors/packet-pres.c
+++ b/epan/dissectors/packet-pres.c
@@ -65,7 +65,7 @@ packet_info *global_pinfo = NULL;
/* dissector for data */
static dissector_handle_t data_handle;
-static char abstract_syntax_name_oid[BER_MAX_OID_STR_LEN];
+static const char *abstract_syntax_name_oid;
static guint32 presentation_context_identifier;
/* to keep track of presentation context identifiers and protocol-oids */
@@ -240,7 +240,7 @@ pres_init(void)
}
static void
-register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
+register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid)
{
pres_ctx_oid_t *pco, *tmppco;
pco=se_alloc(sizeof(pres_ctx_oid_t));
@@ -406,7 +406,7 @@ static int dissect_Presentation_context_deletion_list_item(packet_info *pinfo, p
static int
dissect_pres_Abstract_syntax_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, abstract_syntax_name_oid);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &abstract_syntax_name_oid);
return offset;
}
diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c
index 5935b02e19..0e7961bee4 100644
--- a/epan/dissectors/packet-spnego.c
+++ b/epan/dissectors/packet-spnego.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-spnego.c */
+/* .\packet-spnego.c */
/* ../../tools/asn2eth.py -X -b -e -p spnego -c spnego.cnf -s packet-spnego-template spnego.asn */
/* Input file: packet-spnego-template.c */
@@ -107,7 +107,7 @@ static int hf_spnego_ContextFlags_integFlag = -1;
/* Global variables */
-gchar MechType_oid[MAX_OID_STR_LEN];
+static const char *MechType_oid;
gssapi_oid_value *next_level_value;
gboolean saw_mechanism = FALSE;
@@ -155,7 +155,7 @@ dissect_spnego_MechType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pa
gssapi_oid_value *value;
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, MechType_oid);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &MechType_oid);
value = gssapi_lookup_oid_str(MechType_oid);
@@ -646,7 +646,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *subtree;
int offset = 0;
guint16 token_id;
- gchar oid[MAX_OID_STR_LEN];
+ const char *oid;
gssapi_oid_value *value;
tvbuff_t *krb5_tvb;
gint8 class;
@@ -705,7 +705,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
/* Next, the OID */
- offset=dissect_ber_object_identifier(FALSE, pinfo, subtree, tvb, offset, hf_spnego_krb5_oid, oid);
+ offset=dissect_ber_object_identifier_str(FALSE, pinfo, subtree, tvb, offset, hf_spnego_krb5_oid, &oid);
value = gssapi_lookup_oid_str(oid);
diff --git a/epan/dissectors/packet-tcap.c b/epan/dissectors/packet-tcap.c
index a45d1a7041..771adc5724 100644
--- a/epan/dissectors/packet-tcap.c
+++ b/epan/dissectors/packet-tcap.c
@@ -264,8 +264,8 @@ static gboolean g_tcap_ends_def_len = FALSE;
dissector_handle_t tcap_handle;
static dissector_table_t ber_oid_dissector_table=NULL;
-static char * cur_oid;
-static char * tcapext_oid;
+static const char * cur_oid;
+static const char * tcapext_oid;
static proto_tree *tcap_top_tree=NULL;
static dissector_handle_t data_handle;
static dissector_table_t tcap_itu_ssn_dissector_table; /* map use ssn in sccp */
@@ -303,11 +303,9 @@ static int dissect_protocol_versionrq_impl(packet_info *pinfo, proto_tree *tree,
static int
dissect_tcap_Applicationcontext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- static char buffer[128];
- cur_oid = buffer;
- pinfo->private_data = buffer;
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, cur_oid);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &cur_oid);
+
+ pinfo->private_data = cur_oid;
return offset;
@@ -551,8 +549,7 @@ dissect_tcap_DialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
static int
dissect_tcap_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -612,11 +609,9 @@ dissect_tcap_ExternalPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
static int
dissect_tcap_UserInfoOID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- static char buffer[128];
- tcapext_oid = buffer;
- pinfo->private_data = buffer;
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_index, tcapext_oid);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &tcapext_oid);
+
+ pinfo->private_data = tcapext_oid;
return offset;
@@ -1569,8 +1564,7 @@ static int dissect_integerApplicationId(packet_info *pinfo, proto_tree *tree, tv
static int
dissect_tcap_ObjectIDApplicationContext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
diff --git a/epan/dissectors/packet-x411.c b/epan/dissectors/packet-x411.c
index b0b76b51c2..f6e6dfa0f3 100644
--- a/epan/dissectors/packet-x411.c
+++ b/epan/dissectors/packet-x411.c
@@ -35,6 +35,7 @@
#endif
#include <glib.h>
+#include <epan/emem.h>
#include <epan/packet.h>
#include <epan/conversation.h>
@@ -62,7 +63,7 @@ int proto_x411 = -1;
static struct SESSION_DATA_STRUCTURE* session = NULL;
static int extension_id = 0; /* integer extension id */
-static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */
+static const char *object_identifier_id; /* content type identifier */
static proto_tree *top_tree=NULL;
@@ -1920,10 +1921,10 @@ dissect_x411_BuiltInContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int of
/* convert integer content type to oid for dispatch when the content is found */
switch(ict) {
case 2:
- g_snprintf(object_identifier_id, BER_MAX_OID_STR_LEN, "2.6.1.10.0");
+ object_identifier_id = ep_strdup("2.6.1.10.0");
break;
case 22:
- g_snprintf(object_identifier_id, BER_MAX_OID_STR_LEN, "2.6.1.10.1");
+ object_identifier_id = ep_strdup("2.6.1.10.1");
break;
default:
break;
@@ -1943,7 +1944,7 @@ static int dissect_built_in_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
static int
dissect_x411_ExtendedContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
return offset;
}
diff --git a/epan/dissectors/packet-x420.c b/epan/dissectors/packet-x420.c
index f711388dc6..d786dbe90f 100644
--- a/epan/dissectors/packet-x420.c
+++ b/epan/dissectors/packet-x420.c
@@ -57,7 +57,7 @@
/* Initialize the protocol and registered fields */
int proto_x420 = -1;
-static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */
+static const char *object_identifier_id; /* content type identifier */
/*--- Included file: packet-x420-hf.c ---*/
@@ -487,7 +487,7 @@ static int
dissect_x420_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
char *name = NULL;
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
name = get_ber_oid_name(object_identifier_id);
diff --git a/epan/dissectors/packet-x509af.c b/epan/dissectors/packet-x509af.c
index 09d1c08bc5..81a0ced855 100644
--- a/epan/dissectors/packet-x509af.c
+++ b/epan/dissectors/packet-x509af.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-x509af.c */
+/* .\packet-x509af.c */
/* ../../tools/asn2eth.py -X -b -e -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */
/* Input file: packet-x509af-template.c */
@@ -170,10 +170,10 @@ static gint ett_x509af_SET_OF_AttributeType = -1;
/*--- End of included file: packet-x509af-ett.c ---*/
-static char algorithm_id[BER_MAX_OID_STR_LEN];
+static const char *algorithm_id;
-static char extension_id[BER_MAX_OID_STR_LEN];
+static const char *extension_id;
@@ -261,9 +261,7 @@ static int dissect_serial(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i
static int
dissect_x509af_T_algorithmId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509af_algorithm_id, algorithm_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509af_algorithm_id, &algorithm_id);
return offset;
}
@@ -437,9 +435,7 @@ static int dissect_subjectPublicKeyInfo(packet_info *pinfo, proto_tree *tree, tv
static int
dissect_x509af_T_extnId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509af_extension_id, extension_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509af_extension_id, &extension_id);
return offset;
}
@@ -525,9 +521,9 @@ static const ber_sequence_t T_signedCertificate_sequence[] = {
{ BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_version },
{ BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
{ BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature },
- { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
{ BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_validity },
- { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_subject },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_subject },
{ BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_subjectPublicKeyInfo },
{ BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_issuerUniqueIdentifier_impl },
{ BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_subjectUniqueIdentifier_impl },
@@ -712,7 +708,7 @@ static int dissect_revokedCertificates(packet_info *pinfo, proto_tree *tree, tvb
static const ber_sequence_t T_signedCertificateList_sequence[] = {
{ BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_version },
{ BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature },
- { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
{ BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_thisUpdate },
{ BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_nextUpdate },
{ BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_revokedCertificates },
diff --git a/epan/dissectors/packet-x509ce.c b/epan/dissectors/packet-x509ce.c
index eaa24e5442..a51af864a0 100644
--- a/epan/dissectors/packet-x509ce.c
+++ b/epan/dissectors/packet-x509ce.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-x509ce.c */
+/* .\packet-x509ce.c */
/* ../../tools/asn2eth.py -X -b -e -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */
/* Input file: packet-x509ce-template.c */
@@ -260,7 +260,7 @@ static gint ett_x509ce_PkiPathMatchSyntax = -1;
/*--- End of included file: packet-x509ce-ett.c ---*/
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/*--- Included file: packet-x509ce-fn.c ---*/
@@ -379,8 +379,7 @@ static int dissect_iPAddress_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
static int
dissect_x509ce_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -530,8 +529,7 @@ static int dissect_keyUsage_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
int
dissect_x509ce_KeyPurposeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -604,8 +602,7 @@ dissect_x509ce_PrivateKeyUsagePeriod(gboolean implicit_tag _U_, tvbuff_t *tvb, i
static int
dissect_x509ce_CertPolicyId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -626,9 +623,7 @@ static int dissect_CertPolicySet_item(packet_info *pinfo, proto_tree *tree, tvbu
static int
dissect_x509ce_PolicyQualifierId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509ce_object_identifier_id, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509ce_object_identifier_id, &object_identifier_id);
return offset;
}
@@ -975,8 +970,7 @@ dissect_x509ce_CRLReason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
int
dissect_x509ce_HoldInstruction(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -1329,7 +1323,7 @@ dissect_x509ce_BaseCRLNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offse
static const ber_sequence_t CertificateExactAssertion_sequence[] = {
{ BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
- { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
{ 0, 0, 0, NULL }
};
@@ -1476,7 +1470,7 @@ dissect_x509ce_CertificatePairAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb
static const ber_sequence_t CertificateListExactAssertion_sequence[] = {
- { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
{ BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_distributionPoint },
{ 0, 0, 0, NULL }
};
@@ -1491,7 +1485,7 @@ dissect_x509ce_CertificateListExactAssertion(gboolean implicit_tag _U_, tvbuff_t
static const ber_sequence_t CertificateListAssertion_sequence[] = {
- { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuer },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuer },
{ BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_minCRLNumber_impl },
{ BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_maxCRLNumber_impl },
{ BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_reasonFlags },
@@ -1510,8 +1504,8 @@ dissect_x509ce_CertificateListAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb
static const ber_sequence_t PkiPathMatchSyntax_sequence[] = {
- { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_firstIssuer },
- { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_lastSubject },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_firstIssuer },
+ { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_lastSubject },
{ 0, 0, 0, NULL }
};
diff --git a/epan/dissectors/packet-x509if.c b/epan/dissectors/packet-x509if.c
index 077515677a..8422135071 100644
--- a/epan/dissectors/packet-x509if.c
+++ b/epan/dissectors/packet-x509if.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-x509if.c */
+/* .\packet-x509if.c */
/* ../../tools/asn2eth.py -X -b -e -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */
/* Input file: packet-x509if-template.c */
@@ -276,7 +276,7 @@ static gint ett_x509if_MRSubstitution = -1;
/*--- End of included file: packet-x509if-ett.c ---*/
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
/*--- Included file: packet-x509if-fn.c ---*/
@@ -348,9 +348,7 @@ static int dissect_description(packet_info *pinfo, proto_tree *tree, tvbuff_t *t
static int
dissect_x509if_AttributeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509if_object_identifier_id, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509if_object_identifier_id, &object_identifier_id);
return offset;
}
@@ -582,9 +580,7 @@ static int dissect_matchedValuesOnly(packet_info *pinfo, proto_tree *tree, tvbuf
static int
dissect_x509if_ContextId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509if_object_identifier_id, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509if_object_identifier_id, &object_identifier_id);
return offset;
}
@@ -924,8 +920,7 @@ static int dissect_maximum(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
static int
dissect_x509if_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
+ offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
return offset;
}
@@ -1337,9 +1332,7 @@ static int dissect_ra_selectedValues(packet_info *pinfo, proto_tree *tree, tvbuf
static int
dissect_x509if_DefaultValueType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
- offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
- hf_x509if_object_identifier_id, object_identifier_id);
-
+ offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509if_object_identifier_id, &object_identifier_id);
return offset;
}