aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ber.c21
-rw-r--r--epan/dissectors/packet-per.c21
2 files changed, 37 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 781032b6c5..1643ba3b1d 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -74,6 +74,7 @@
#include <epan/prefs.h>
#include <epan/reassemble.h>
#include <epan/emem.h>
+#include <epan/dissectors/format-oid.h>
#include "packet-ber.h"
#ifndef MIN
@@ -1736,7 +1737,11 @@ int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, pro
int eoffset;
char *str, *name;
proto_item *item = NULL;
- header_field_info *hfi;
+ header_field_info *hfi;
+
+ const guint8 *oid_ptr;
+ subid_t *subid_oid;
+ guint subid_oid_length;
#ifdef DEBUG_BER
{
@@ -1772,7 +1777,8 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
eoffset=offset+len;
}
- str = oid_to_str(tvb_get_ptr(tvb, offset, len), len);
+ oid_ptr = tvb_get_ptr(tvb, offset, len);
+ str = oid_to_str(oid_ptr, len);
hfi = proto_registrar_get_nth(hf_id);
if (hfi->type == FT_OID) {
@@ -1791,7 +1797,18 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
name=g_hash_table_lookup(oid_table, str);
if(name){
proto_item_append_text(item, " (%s)", name);
+ }else{
+ gchar *decoded_oid;
+ gchar *non_decoded_oid;
+
+ subid_oid = g_malloc((len+1) * sizeof(gulong));
+ subid_oid_length = oid_to_subid_buf(oid_ptr, len, subid_oid, ((len+1) * sizeof(gulong)));
+ new_format_oid(subid_oid, subid_oid_length,
+ &non_decoded_oid, &decoded_oid);
+ proto_item_append_text(item, " (%s)", (decoded_oid == NULL) ? non_decoded_oid : decoded_oid);
+
}
+
}
return eoffset;
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index ce644a127a..c3084f5320 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -41,6 +41,7 @@ proper helper routines
#include <epan/to_str.h>
#include <epan/prefs.h>
#include <epan/emem.h>
+#include <epan/dissectors/format-oid.h>
#include "packet-per.h"
#include "packet-ber.h"
@@ -532,7 +533,6 @@ dissect_per_constrained_sequence_of(tvbuff_t *tvb, guint32 offset, packet_info *
header_field_info *hfi;
proto_item *pi;
-
DEBUG_ENTRY("dissect_per_constrained_sequence_of");
/* 19.5 if min==max and min,max<64k ==> no length determinant */
@@ -610,11 +610,16 @@ dissect_per_object_identifier(tvbuff_t *tvb, guint32 offset, packet_info *pinfo
proto_item *item = NULL;
header_field_info *hfi;
+ const guint8 *oid_ptr;
+ subid_t *subid_oid;
+ guint subid_oid_length;
+
DEBUG_ENTRY("dissect_per_object_identifier");
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_per_object_identifier_length, &length);
-
- str = oid_to_str(tvb_get_ptr(tvb, offset>>3, length), length);
+
+ oid_ptr = tvb_get_ptr(tvb, offset>>3, length);
+ str = oid_to_str(oid_ptr, length);
hfi = proto_registrar_get_nth(hf_index);
if (hfi->type == FT_OID) {
@@ -635,7 +640,17 @@ DEBUG_ENTRY("dissect_per_object_identifier");
name = get_ber_oid_name(str);
if(name){
proto_item_append_text(item, " (%s)", name);
+ }else{
+ gchar *decoded_oid;
+ gchar *non_decoded_oid;
+
+ subid_oid = g_malloc((length+1) * sizeof(gulong));
+ subid_oid_length = oid_to_subid_buf(oid_ptr, length, subid_oid, ((length+1) * sizeof(gulong)));
+ new_format_oid(subid_oid, subid_oid_length,
+ &non_decoded_oid, &decoded_oid);
+ proto_item_append_text(item, " (%s)", (decoded_oid == NULL) ? non_decoded_oid : decoded_oid);
}
+
}
return offset;