Wireshark-bugs: [Wireshark-bugs] [Bug 9192] no support for RELATIVE-OID ASN.1 type

Date: Sun, 06 Oct 2013 14:06:36 +0000

changed bug 9192

What Removed Added
CC   [email protected]

Comment # 3 on bug 9192 from
It looks like some copy paste error landed in the new code:
- in dissect_ber_relative_oid() function, shouldn't the following code:
        if ( (ber_class != BER_CLASS_UNI)
          || (tag != BER_UNI_TAG_OID) ) {
be instead:
        if ( (ber_class != BER_CLASS_UNI)
          || (tag != BER_UNI_TAG_RELATIVE_OID) ) {
- in dissect_ber_relative_oid_str() function, shouldn't the line:
    offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb,
offset, hf_id, (value_stringx) ? &value_tvb : NULL);
be instead:
    offset = dissect_ber_relative_oid(implicit_tag, actx, tree, tvb, offset,
hf_id, (value_stringx) ? &value_tvb : NULL);

Moreover I can see that the code of dissect_ber_relative_oid() is almost
similar to dissect_ber_object_identifier(). Same thing for
dissect_ber_relative_oid_str() and dissect_ber_object_identifier_str().

If the dissection is really similar, we could simply remove the duplicate code
and define those new functions as:

int
dissect_ber_relative_oid(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree
*tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **value_tvb)
{
    return dissect_ber_relative_oid(implicit_ta, actx, tree, tvb, offset,
hf_id, value_tvb);
}

with small changes in dissect_ber_object_identifier() so as to handle both OID
and REL_OID cases, and

int
dissect_ber_relative_oid_str(gboolean implicit_tag, asn1_ctx_t *actx,
proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, const char
**value_stringx)
{
    return dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb,
offset, hf_id, value_stringx);
}


You are receiving this mail because:
  • You are watching all bug changes.