diff options
author | kukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-11-14 10:02:31 +0000 |
---|---|---|
committer | kukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-11-14 10:02:31 +0000 |
commit | 167ac032bf154aa961046acda1a4c950a92f8bf6 (patch) | |
tree | e8f6231cfc7a837d8fc9901a7a676180dce93bd1 /epan | |
parent | 90aab32112f01b232484bc9f84329a3d3de49d89 (diff) |
- dissect_ber_object_identifier() returns value as tvb
- new dissect_ber_object_identifier_str() function
- BER dissectors adapted and regenerated
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16501 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-acse.c | 29 | ||||
-rw-r--r-- | epan/dissectors/packet-ber.c | 64 | ||||
-rw-r--r-- | epan/dissectors/packet-ber.h | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-cmip.c | 75 | ||||
-rw-r--r-- | epan/dissectors/packet-cmp.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-cms.c | 19 | ||||
-rw-r--r-- | epan/dissectors/packet-crmf.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-ess.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ftam.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-gssapi.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ocsp.c | 11 | ||||
-rw-r--r-- | epan/dissectors/packet-pkix1explicit.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-pkixqualified.c | 13 | ||||
-rw-r--r-- | epan/dissectors/packet-pres.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-spnego.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-tcap.c | 26 | ||||
-rw-r--r-- | epan/dissectors/packet-x411.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-x420.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-x509af.c | 20 | ||||
-rw-r--r-- | epan/dissectors/packet-x509ce.c | 30 | ||||
-rw-r--r-- | epan/dissectors/packet-x509if.c | 19 |
21 files changed, 168 insertions, 230 deletions
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; } |