Commit Graph

74 Commits

Author SHA1 Message Date
Jörg Mayer 1900bf87fc done:
packet-ntp.c: Rather confused and incorrect use of g_snprintf return value
packet-pim.c: whitespace change
packet-icmpv6.c: g_snprintf takes trailing \0 into account, fix off by 1 error
packet-clnp.c: Fix incorrect use of g_snprintf return value
packet-isakmp.c: g_snprintf takes trailing \0 into account
packet-tr.c: Fix incorrect use of g_snprintf return value
packet-radius.c: Fix incorrect use of g_snprintf return value
packet-radius.h: constify a string variable
packet-ldap.c: The return value isn't needed, so don't use it incorrectly
packet-tcp.c: Fix incorrect use of g_snprintf return value
packet-windows-common.c: Remove unneeded DISSECTOR_ASSERT
packet-smb-sidsnooping.c: g_snprintf takes trailing \0 into account
packet-pvfs2.c: g_snprintf takes trailing \0 into account
packet-ptp.c: Remove #include snprintf
packet-ppp.c: Fix incorrect use of g_snprintf return value
packet-ospf.c: Fix incorrect use of g_snprintf return value
packet-mip6.c: snprintf -> g_snprintf
packet-bootp.c: Remove a commented out bad use of g_snprintf
packet-ber.c: snprintf -> g_snprintf, g_snprintf takes trailing \0 into account

2do:

     52 packet-ieee80211.c: 2DO
      2 packet-nfs.c: 2DO - too many side effects
     33 packet-bgp.c: 2DO
     18 packet-dns.c: 2DO
     14 packet-dcm.c: 2DO
     13 packet-x11.c: 2DO
     11 packet-kerberos.c: 2DO
     10 packet-diameter.c: 2DO
      9 packet-snmp.c: 2DO
      9 packet-pgm.c: 2DO
      7 packet-nbns.c: 2DO
      6 packet-fcswils.c: 2DO
      5 packet-wccp.c: 2DO
      5 packet-cops.c: 2DO
      4 packet-wtp.c: 2DO


svn path=/trunk/; revision=17038
2006-01-16 07:59:44 +00:00
Jörg Mayer f9a57f08d1 Bill Meier:
Spelling fixes.

svn path=/trunk/; revision=16956
2006-01-05 13:01:08 +00:00
Luis Ontanon 5ff580e14f From: Graeme Hewson
Decryption of the RADIUS User-Password attribute is currently broken.


svn path=/trunk/; revision=16920
2005-12-30 18:41:56 +00:00
Jörg Mayer 9575877bb7 packet-radius.c, packet-xml.c:
Fix a memory leak found by valgrind:
        Although dir isn't a directory it may still use memory

packet-xml.c:
        Reformat the relevant function in packet-xml.c to be readable on systems
        where a tab is 8 spaces.

svn path=/trunk/; revision=16865
2005-12-20 08:35:53 +00:00
Luis Ontanon 54695fec80 propperly initialize vendor->ett if the vendor is not found while radius_register_avp_dissector().
fixes bug 488.


svn path=/trunk/; revision=16064
2005-10-01 11:16:17 +00:00
Guy Harris 13c7fec8f5 Give more details about too-short AVPs, give up immediately for AVPs
shorter than 2 bytes, and make the item for an AVP with a length < 2 a
generated item.

Put the top-level item for an AVP into the tree the same way regardless
of whether it's Vendor-Specific or not, and skip past the type and
length right after that, before we check for Vendor-Specific.  (This
means we no longer treat "vendor ID = 0" as an indication that this
isn't Vendor-Specific - nothing prevents a packet from getting onto the
wire with a vendor ID of 0; this fixes bug 485.)

Don't require a Vendor-Specific AVP to be at least 6 bytes long; it
might not be particularly useful to have one that has a vendor ID and
nothing else, but we might as well dissect the vendor ID portion.

Do some other cleanups.

svn path=/trunk/; revision=16015
2005-09-27 00:03:45 +00:00
Guy Harris a997ee591b Add a new "ipxnet" type for the RADIUS dictionary, for IPX network
numbers.  (Currently, we don't have any dictionary entries with that
type, although we have an attribute with special code to handle it that
uses that type.)

Specially handle Framed-IP-Address, Login-IP-Host, and
Framed-IPX-Network, so that the special values are displayed specially.

Clean up indentation.

Don't specify a number base for IPv4 or IPv6 addresses; the number base
is ignored.

svn path=/trunk/; revision=16008
2005-09-26 08:48:19 +00:00
Luis Ontanon 35cfa4c11c test the avp_vsa_len not the avp_lenght!
svn path=/trunk/; revision=15999
2005-09-25 02:50:03 +00:00
Luis Ontanon 32c673552c Don't ASSERT if a VSA is too short, add an item reporting the error and leave.
svn path=/trunk/; revision=15998
2005-09-25 02:48:53 +00:00
Luis Ontanon 993e209b7f - There can be '/' in attribute names as well
- 140Kb of leaks less.


svn path=/trunk/; revision=15986
2005-09-24 15:07:38 +00:00
Ronnie Sahlberg 44fb2d3d56 Dont decrement the length by 2 if it is already less than two
since then the length will wrap and become +4G or so.

This fixes bug 479


svn path=/trunk/; revision=15982
2005-09-23 20:51:09 +00:00
Luis Ontanon fbc222f41a Change "Value" into "VSA" for Vendor SPecific Attributes
svn path=/trunk/; revision=15873
2005-09-19 19:36:32 +00:00
Luis Ontanon a6ff6fb97c - allow multiple attributes inside one VSA (fixes bug 438)
- preference to choose whether to add the AVP's payload length items
- preference to add an alternate UDP port


svn path=/trunk/; revision=15870
2005-09-19 17:42:02 +00:00
Guy Harris 973920e91d Convert some more "tvb_memcpy()"s fetching IPv4 and IPv6 addresses to
calls to "tvb_get_ipv4()" and "tvb_get_ipv6()".

Fix a call in the BGP dissector to properly fetch an IEEE floating-point
number.

Update some I-D info.

svn path=/trunk/; revision=15774
2005-09-13 00:50:43 +00:00
Ronnie Sahlberg 7ddc41a925 sprintf removal
svn path=/trunk/; revision=15556
2005-08-27 01:05:14 +00:00
Guy Harris e965cb849c Clean up some more const issues.
svn path=/trunk/; revision=15151
2005-07-30 02:22:22 +00:00
Guy Harris 66a2801dfa Use "PROTO_ITEM_SET_GENERATED()" to mark generated items as such; it
takes care of the square brackets, etc..

svn path=/trunk/; revision=15140
2005-07-29 07:28:07 +00:00
Gerald Combs de2803bc52 Don't add a new data source if we don't have any data.
svn path=/trunk/; revision=15089
2005-07-26 15:59:54 +00:00
Luis Ontanon caa15f2906 Get rid of a unused variable
svn path=/trunk/; revision=15065
2005-07-25 19:19:34 +00:00
Luis Ontanon 28de1cec4d Fix the IP address representation string (was inverted on little endians)
svn path=/trunk/; revision=15063
2005-07-25 19:03:57 +00:00
Gerald Combs 4d666be4b8 Break out of an infinite loop. Fixes bugs 296 and 297.
svn path=/trunk/; revision=15054
2005-07-25 15:43:38 +00:00
Guy Harris 255b302a82 Fix some typoes.
Call "dissect_attribute_value_pairs()" regardless of whether we're
building a protocol tree, so the EAP subdissector is always called.

"dissect_attribute_value_pairs()" is only called when the length of AVPs
in the packet is non-zero; don't bother checking for a zero length.

Don't put two items in for each AVP - one is sufficient.

Add some more length checks when processing AVPs.  Don't require AVPs to
be at least 3 bytes long - they might have just a type and length; let
an exception be thrown if that's a problem.

Don't require that the entire AVP be available in the tvbuff before
processing it; let an exception be thrown as we're processing the AVP if
we don't have all the data, so the stuff before the end is processed.

Give the tvbuff for the AVP data a length that reflects the length of
data left in the tvbuff, so that the appropriate exception is thrown if
the packet was cut short by a snapshot length.

Don't have a fixed-length buffer for reassembled EAP messages; grow it
as necessary.

Don't special-case the initial part of the processing of EAP messages;
put in the standard length item, as well as, for fragments, an item for
the fragment data.

Check for non-consecutive EAP-Message attributes.

Set the columns non-writable while dissecting the EAP message, so
Protocol and Info reflect the RADIUS packet.

Doing the reassembly by gluing together all the consecutive EAP-Message
attributes means we don't need help from the EAP dissector, returning
the total length of the EAP message.  Get rid of the no-longer-needed
eap_fragment dissector; just call the regular EAP dissector.

svn path=/trunk/; revision=15046
2005-07-24 20:39:19 +00:00
Guy Harris 554f620001 Constify to remove a bunch of warnings. Add some casts to squelch
(presumably-)harmless-but-otherwise-unremovable const-to-nonconst
warnings.

In the TACACS dissector, clean up the variables used in option parsing
to avoid some const-to-nonconst warnings.

Clean up some white space.

svn path=/trunk/; revision=15043
2005-07-24 19:01:28 +00:00
Luis Ontanon e9ec2c51aa - change the report_failure dialog for a less painful g_warning
- use ep_alloc for reassemling eap fragments instead of a static buffer
- use ep_strdup_printf() instead of a static buffe to return the cosine's VP/VC AVP label
- add few TODO comments


svn path=/trunk/; revision=15028
2005-07-24 02:53:09 +00:00
Gerald Combs 210deaf2cd Tweak the previous fix.
svn path=/trunk/; revision=14947
2005-07-17 22:30:56 +00:00
Gerald Combs 141f8341af Make the recent RADIUS changes work on IA64.
svn path=/trunk/; revision=14946
2005-07-17 22:16:59 +00:00
Guy Harris 9859c05fbc Get rid of the newline between "radius:" and the error when trying to
read the RADIUS directory.

The error string from "radius_load_dictionary()" is g_malloced; free it,
and g_strdup the "Could not find the radius directory" error, so we
don't have to worry about constant vs. g_malloced strings.

svn path=/trunk/; revision=14937
2005-07-16 01:55:58 +00:00
Luis Ontanon 9c341a333d Radius Dictionary Support
Part 2: the code

svn path=/trunk/; revision=14925
2005-07-15 21:12:27 +00:00
Guy Harris ab797734dd Get rid of the private "my_match_strval()" routine in many dissectors;
add a "match_strval_idx()" routine that does the same thing, and have
"match_strval()" call it.

Make those routines, and "val_to_str()", return a "const" pointer. 
Update dissectors as necessary to squelch compiler warnings produced by
that.

Use "val_to_str()" rather than using "match_strval()" and then, if the
result is null, substituting a specific string.  Clean up some other
"match_strval()"/"val_to_str()" usages.

Add a null pointer check in the NDPS dissector's "attribute_value()"
routine, as it's not clear that "global_attribute_name" won't be null at
that point.

Make some global variables in the AFS4INT dissector local.

Make some routines not used outside the module they're in static.

Make some tables "static const".

Clean up white space.

Fix Gerald's address in some files.

svn path=/trunk/; revision=14786
2005-06-26 19:56:52 +00:00
Anders Broman 2524713192 Add some Cisco AVP:s
svn path=/trunk/; revision=14705
2005-06-19 21:16:04 +00:00
Anders Broman 03bae827fc Change "radius type" on some vendor AVP:s and add some more ones.
svn path=/trunk/; revision=14673
2005-06-16 22:07:38 +00:00
Anders Broman e430a0b6f0 Add vendor AVP:s for T-Mobile and T-Systems Nova International GmbH.
svn path=/trunk/; revision=14629
2005-06-14 21:46:51 +00:00
Ulf Lamping fdb5b1af02 just to get things straight: a dissector should *never* do any g_assert() calls!
in a simple approach, I've replaced all g_assert() and g_assert_not_reached() calls by their exception throwing counterparts DISSECTOR_ASSERT() and DISSECTOR_ASSERT_NOT_REACHED()

this will replace application crash by showing a dissector bug, which is the desired behaviour

there were some g_assert calls in the protocol registering functions, which might not be acting as expected now, but to be able to simply search for g_assert in the future I've replaced that calls too

one g_assert remained, the one when someone throws an unknown exception "into" packet_frame.c, but IMHO this one should remain.

svn path=/trunk/; revision=14608
2005-06-10 18:28:22 +00:00
Anders Broman 1db20f1782 Fix a typo.
svn path=/trunk/; revision=14584
2005-06-08 05:03:36 +00:00
Gerald Combs bcd1c5b9fa From Steve Grubb: Fix buffer and array length checks. Fixes part of bug 217.
svn path=/trunk/; revision=14498
2005-05-30 21:01:52 +00:00
Jörg Mayer b6db235c77 Change 802.11f -> F, 802.1d -> D, 802.1x -> X, 802.1q -Q, 802.1P -> p
svn path=/trunk/; revision=14321
2005-05-05 17:07:58 +00:00
Gerald Combs e0224c5286 Check an AVP length. Fixes bug 128.
svn path=/trunk/; revision=14210
2005-04-28 03:31:20 +00:00
Guy Harris 9ce4ff20ef Tagged integers have 4 bytes of data (1 byte of tag, 3 bytes of
integer), not 5 bytes.

svn path=/trunk/; revision=13753
2005-03-14 20:23:11 +00:00
Guy Harris 0c70225fc6 Comment changes.
svn path=/trunk/; revision=13750
2005-03-14 10:45:46 +00:00
Luis Ontanon 8b481b2ab9 From Florian Lohoff:
Add Netscreen vendor specific attributes


svn path=/trunk/; revision=13650
2005-03-07 11:35:52 +00:00
Anders Broman aae42374bc Change the RADIUS ATTRIBUTES for some 3GPP AVP:s to display them as (UTF8)Strings, also
added some more AVP:s from a later spec.

svn path=/trunk/; revision=13554
2005-02-28 20:51:23 +00:00
Anders Broman b956a7c0a8 From LEGO
patch adding few more fields to RADIUS (I and O Packets and Octets)

svn path=/trunk/; revision=13351
2005-02-08 18:51:27 +00:00
Anders Broman f2c5299014 From LEGO:
- remove duplicate fields from VSAs (every defined field in VSAs was set twice)
 - dissect radius packet with avplen == 0 (did not decode authenticator when no AVPs were present)

svn path=/trunk/; revision=13216
2005-01-31 21:36:31 +00:00
Guy Harris ce604cf8f0 From Luis Ontanon: add more filterable fields to DNS, PGM, GTP, and RADIUS.
svn path=/trunk/; revision=12835
2004-12-26 00:22:16 +00:00
Guy Harris 9e176608c5 RFC 2868 says that the length of a "tagged string" field must be at
least 3 - 2 for type+length and 1 for the tag - so treat a "tagged
string" field as bad if there isn't at least one byte of data.  (It's a
bit odd that the RFC says that the tag must be in the range 0x01-0x1F -
that sounds suspiciously as if they're saying "printable characters
aren't valid tags", to allow untagged strings, which might suggest that
a field with a length of 2 should be interpreted as an empty string.)

svn path=/trunk/; revision=12817
2004-12-22 19:27:09 +00:00
Guy Harris d7ba617f71 In the "rdconvertXXXtostr()" routines, check that the length passed in
is >= 0 (if it's not, that's a bug), and make the buffer index and total
length variables int as well, to match the length.

svn path=/trunk/; revision=12811
2004-12-22 01:51:00 +00:00
Guy Harris 88cbf869eb Move the RADIUS_TIMESTAMP, RADIUS_INTEGER4_TAGGED, and RADIUS_UNKNOWN
case branches up, so the case branches are in the same order as the
elements of the enum are, and add length checks to RADIUS_TIMESTAMP and
RADIUS_INTEGER4_TAGGED.

svn path=/trunk/; revision=12810
2004-12-22 01:42:54 +00:00
Guy Harris 7402efa058 Add some checks to make sure the AVP length is large enough for the item
we're fetching from the AVP.

In the case of a tagged string, if the length is 2 (meaning the data
length is 0), assume there's no tag.

svn path=/trunk/; revision=12808
2004-12-22 00:23:55 +00:00
Gerald Combs 8e36c366f8 Remove an unneeded "ntohl()" call.
svn path=/trunk/; revision=12790
2004-12-20 16:15:29 +00:00
Gerald Combs 6c8707b255 Add PacketCable Event Message information to the "Info" column.
svn path=/trunk/; revision=12702
2004-12-09 21:06:03 +00:00