Wireshark-bugs: [Wireshark-bugs] [Bug 7283] SNMPv3 EngineID decode error
Date: Thu, 24 May 2012 05:01:06 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7283

--- Comment #1 from Hao Song <songhao@xxxxxxx> 2012-05-24 05:01:06 PDT ---
Oops, let me fix my bug
Here is the correct code

      /* case 128: */ /* move case 128 to the default branch */
      case SNMP_ENGINEID_FORMAT_OCTETS:
      default:
        /* most common enterprise-specific format: (ucd|net)-snmp random */
        if ((format == 128) && ((enterpriseid==2021)||(enterpriseid==8072))) {
          proto_item_append_text(item, (enterpriseid==2021) ? ": UCD-SNMP
Random": ": Net-SNMP Random");
          /* demystify: 4B random, 4B epoch seconds */
          if (len_remain==8) {
            proto_tree_add_item(tree, hf_snmp_engineid_data, tvb, offset, 4,
ENC_NA);
            seconds = tvb_get_letohl(tvb, offset+4);
            ts.secs = seconds;
            ts.nsecs = 0;
            proto_tree_add_time_format_value(tree, hf_snmp_engineid_time, tvb,
offset+4, 4, &ts, "%s", abs_time_secs_to_str(seconds, ABSOLUTE_TIME_LOCAL,
TRUE));
            offset+=8;
            len_remain=0;
          }
        }
        else
        {
          /* max. 27 bytes, administratively assigned or unknown format */
          if (len_remain<=27) {
            proto_tree_add_item(tree, hf_snmp_engineid_data, tvb, offset,
len_remain, ENC_NA);
            offset+=len_remain;
            len_remain=0;
          }
        }

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.