summaryrefslogtreecommitdiff
path: root/print-isakmp.c
Commit message (Collapse)AuthorAgeFilesLines
* "sa_len" is, on some platforms, #defined to something else; useGuy Harris2009-06-291-5/+5
| | | | | "sa_length" instead, so as not to have compilation fail on those platforms. Do the same with "osa_len" while we're at it.
* Make the definition of ikev1_print() match its declaration - at leastGuy Harris2009-06-091-1/+1
| | | | one version of HP's C compiler complains otherwise.
* Add __attribute__((format)) to the declarations of the ndo_printf,Guy Harris2009-05-241-2/+2
| | | | | | | | | | | | | | | | ndo_error, and ndo_warning function pointers in a netdissect_options structure. Fix some errors adding that caught. Have the RRCP dissector extract fields itself, with the EXTRACT_ macros and a u_char pointer, rather than printing numbers from a structure which doesn't put structure members on natural boundaries (__attribute__((packed)) doesn't help, as not all compilers support it) - note also that not all processors support dereferencing unaligned pointers, e.g. SPARC - and assuming some fields are in the "right" byte order. Also have it check whether data is available in the packet before referring to it.
* Tag with _U_ parameters unused if HAVE_LIBCRYPTO isn't defined. (Yes,guy2008-02-051-6/+24
| | | | | at least with the GCC definition of _U_, you can put it before a variable.)
* Don't call routines if they don't exist.guy2008-01-241-2/+6
| | | | Fix a typo.
* fixed up auth payload printing code.mcr2007-11-271-12/+15
|
* added "make check"mcr2007-11-241-23/+146
| | | | | | | when optimization is not on, glibc6 doesn't define ntohs(), and our attempt to optimize it for x86 doesn't work --- the functions need to be static, not extern. added decryption of IKE v2 payloads, when keys are provided by -E.
* updated print-isakmp.c to do sensible thing with encrypted payload, andmcr2007-11-221-6/+27
| | | | emit length from transform payload.
* fully convert print-isakmp.c to NETDISSECT.mcr2007-08-291-52/+53
|
* fixes for -Wall.mcr2007-08-291-36/+26
|
* preliminary patch to support decoding IKEv2 packets.mcr2007-08-291-358/+1293
| | | | | Only payloads commonly seen in PARENT_SAs are presently decoded. Encrypted payload support will come later, aka print-esp.c
* adjust count of items to reflect new additions.mcr2006-08-271-3/+3
|
* added additional modp groups to definition.mcr2006-08-271-5/+31
|
* use new ip_print_demux() routine in ISAKMP UDP-ESP encapmcr2005-04-071-3/+16
| | | | printer.
* added ESP-in-UDP printer from RFC3948.mcr2005-04-061-5/+56
|
* From Gisle Vanem: if NPFUNC(np) is known not to be null, we can safelyguy2004-11-041-2/+2
| | | | | use npfunc[np[ (and if it's not known to be null, we can't safely use NPFUNC(np)), so do so.
* cleaned up warning.mcr2004-03-251-34/+39
|
* Add payload length checking.guy2004-03-241-16/+40
|
* From Bill Fenner: add checks to make sure we don't run past the end ofguy2004-03-121-21/+95
| | | | | | | | the captured data in the packet. Have "rawprint()" return a success-or-failure indication and have its callers (if they don't know that it can't fail) print a truncation indication if it fails.
* Pass the length from the payload header to the print routines forguy2004-03-121-70/+74
| | | | | | | | | | | various payload types. Use that in those routines rather than getting the length ourselves (which fixes a case where we were getting it incorrectly, forgetting to "ntohs()" it). In "isakmp_id_print()", if the item length is less than the size of the fixed-length portion of the payload, don't subtract the latter from the former and use it as the length of the variable-length portion, just set the length in question to 0.
* Put a null statement after a label that had no statement after it, toguy2004-03-121-2/+2
| | | | squelch a compiler warning.
* Print unsigned values with %u, not %d.guy2004-01-231-2/+2
|
* bugfix from Jonathan Heusser <jonny@drugphish.ch>hannes2004-01-071-1/+9
| | | | | | | | | | | The first critical piece of code is found in print-isakmp.c:332. The function rawprint() does not check its arguments thus it's easy for an attacker to pass a big 'len' or a bogus 'loc' leading to a segmentation fault in the for loop. The second bug is located in print-radius.c:471. The for loop of print_attr_string() is written in an unsafe manner. 'length' and 'data' should be checked.
* As per George Bakos' suggestion, only print the ":" separator betweenguy2003-12-201-2/+3
| | | | the flags and the payload if we're printing the payload.
* From George Bakos: only print multi-line output with "-v".guy2003-12-201-23/+23
|
* From George Bakos: catch bogus payload lengths even if we have a routineguy2003-12-151-13/+18
| | | | to process the payload type.
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | appropriately, and that GNUmakefile and the MSVC++ project file define it apppriately, as we do with libpcap, rather than defining it in "interface.h". Undo the rcsid-shuffling and addition of extra #includes, as we no longer need to arrange that "interface.h" be included before using _U_ in an RCS ID or copyright.
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | use "_U_" in the definitions of "rcsid[]", to eliminate complaints about those variables being unused; move the definitions after the include of "interface.h", or add an include of "interface.h", so that "_U_" is defined. Include "config.h" before including "tcpdump-stdinc.h" in "missing/datalinks.c".
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | compile with Sun C, as "interface.h" isn't being included before the structures are being declared. Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun C to generate code that's safe with unaligned accesses, as "__attribute__" is defined as a do-nothing macro with compilers that don't support it. Therefore, we get rid of that tag on the structures to which it was added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch 16-bit and 32-bit big-endian quantities from packets. We also fix some other references to multi-byte quantities to get rid of code that tries to do unaligned loads on platforms that don't support them. We also throw in a hack that makes those macros use "__attribute__((packed))" on structures containing only one 16-bit or 32-bit integer to get the compiler to generate unaligned-safe code rather than doing it by hand. (GCC on SPARC produces the same code that doing it by hand does; I don't know if GCC on any other big-endian strict-alignment processor generates better code for that case. On little-endian processors, as "ntohs()" and "ntohl()" might be functions, that might actually produce worse code.) Fix some places to use "%u" rather than "%d" to print unsigned quantities.
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-24/+34
| | | | | | | | | | | | | | | unused-parameter problems reported by GCC. Add an _U_ tag to label parameters as unused if the function is called through a pointer (so that you can't change its signature by removing parameters) or if there are unused parameters only because the function isn't complete. Add some additional bounds checks the necessity for which was revealed while cleaning up unused-parameter problems. Make some routines static. "lcp_print()", defined in "print-lcp.c", isn't called anywhere - "print-ppp.c" has the code to dissect LCP. Get rid of "print-lcp.c".
* Constify.guy2002-09-051-123/+151
| | | | | | | | | | | Check for zero-length items in "isakmp_sub0_print()", and return NULL if one is seen. Have "isakmp_sub_print()" check for that and break out of the loop and return NULL if "isakmp_sub0_print()" returns NULL, so we don't loop forever printing the same item. Have callers of "isakmp_sub_print()" check for NULL and return NULL as well. Have "isakmp_sub_print()" take the depth as an argument, rather than have it as a static variable, for cleanliness.
* Add a few more GCC warnings on GCC >= 2 for ".devel" builds.guy2002-09-051-47/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Neil T. Spring: fixes for many of those warnings: addrtoname.c, configure.in: Linux needs netinet/ether.h for ether_ntohost print-*.c: change char *foo = "bar" to const char *foo = "bar" to appease -Wwrite-strings; should affect no run-time behavior. print-*.c: make some variables unsigned. print-bgp.c: plen ('prefix len') is unsigned, no reason to validate by comparing to zero. print-cnfp.c, print-rx.c: use intoa, provided by addrtoname, instead of inet_ntoa. print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to be false, so check for (u_int)-1, which represents failure, explicitly. print-isakmp.c: complete initialization of attrmap objects. print-lwres.c: "if(x); print foo;" seemed much more likely to be intended to be "if(x) { print foo; }". print-smb.c: complete initialization of some structures. In addition, add some fixes for the signed vs. unsigned comparison warnings: extract.h: cast the result of the byte-extraction-and-combining, as, at least for the 16-bit version, C's integral promotions will turn "u_int16_t" into "int" if there are other "int"s nearby. print-*.c: make some more variables unsigned, or add casts to an unsigned type of signed values known not to be negative, or add casts to "int" of unsigned values known to fit in an "int", and make other changes needed to handle the aforementioned variables now being unsigned. print-isakmp.c: clean up the handling of error/status indicators in notify messages. print-ppp.c: get rid of a check that an unsigned quantity is >= 0. print-radius.c: clean up some of the bounds checking. print-smb.c: extract the word count into a "u_int" to avoid the aforementioned problems with C's integral promotions. print-snmp.c: change a check that an unsigned variable is >= 0 to a check that it's != 0. Also, fix some formats to use "%u" rather than "%d" for unsigned quantities.
* Added support for Win32, based on WinPcap.risso2002-08-011-8/+7
|
* whitespace cleanupitojun2002-06-111-3/+3
|
* Get rid of unneeded incomplete definitions of "struct mbuf" and "structguy2002-06-011-4/+1
| | | | | rtentry", and unneded includes of <sys/uio.h>, <sys/file.h>, and <sys/ioctl.h>.
* do not subtract size of the field twice. from kameitojun2001-10-261-2/+1
|
* Use [encrypted %s] instead of the truncation notation [|%s] to notefenner2001-02-201-2/+2
| | | | that we have a packet of type %s that we can't print.
* use safeputchar() instead of cook up on its own.itojun2001-01-281-7/+3
|
* do not try to pass pointer to data-on-stack. broken during align-friendly fix.itojun2000-12-121-11/+14
|
* put stripped-down version of ip6.h and icmp6.h into tcpdump tree.itojun2000-10-071-5/+4
| | | | | | | | ip6.h is almost normal RFC2292 header. icmp6.h has couple of extensions (not covered by RFC2292), like MLD, ICMPv6 nodeinfo, and router renumber. XXX how to synchronize with future kame changes?
* add AES and SHA2-*itojun2000-10-041-5/+7
|
* don't try to chase unaligned pointer.itojun2000-10-031-120/+163
| | | | | XXX memcpy() can be optimized in wacky way. not sure if the use of safememcpy() is enough...
* always use u_intXX_t for protocol format declaration. char/short/int may notitojun2000-10-031-3/+3
| | | | | | come with exact size. while at it, correct signedness of ip/udp header field. nuke most of the use of bitfield. TODO: bitfield in namser.h
* Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy2000-09-291-2/+1
| | | | "n_long", and "n_time", defined in that file, with other types.
* Get rid of unneeded includes of <net/if.h>.guy2000-09-281-2/+1
|
* tcpdump requires a C compiler that supports prototypes, as they're usedguy2000-09-241-34/+34
| | | | | | | | throughout it; get rid of the use of the "__P()" macro, as, at least on some platforms with some compilers, that macro doesn't expand to its argument, causing the functions not to be declared with function prototypes, which then causes the compiler to warn about the prototype declaration and the function definition disagreeing.
* Add an "ip.h" header, to declare the IP stuff needed by dissectors, andguy2000-09-231-3/+3
| | | | | | | | | | | have dissectors include them rather than <netinet/ip.h> or <netinet/ip_var.h>, if they actually need that stuff. Put the declarations of the ICMP stuff directly into "print-icmp.c". Remove all unnecessary includes of <netinet/ip*.h> files. Copy the byte-order stuff from "nameser.h" into "tcp.h".
* Add "tcp.h" and "udp.h" headers, to declare the TCP and UDP stuff neededguy2000-09-231-4/+1
| | | | | | | | | by dissectors, and have dissectors include them rather than <netinet/udp.h>, <netinet/udp_var.h>, or <netinet/tcp.h>, if they actually need that stuff. Remove all unnecessary includes of <netinet/udp*.h> or <netinet/tcp*.h> files.
* Add definitions of Ethernet types fromguy2000-09-231-2/+1
| | | | | | | | | | | | | | | | "linux-includes/netinet/if_ether.h" to "ethertype.h". Move other stuff used by dissectors from <netinet/if_ether.h> to "ether.h", along the lines of "fddi.h" and "token.h". Move ARP declarations from BSD include files to "print-arp.c". Remove from dissectors includes of <netinet/if_ether.h>, and add includes of "ethertype.h" and/or "ether.h" as necessary. Get rid of configuration options that test declarations now made in "ether.h" or "print-arp.c", as those declarations are now under our control, not the OS's control.
* add a function to decode CR payload.itojun2000-09-231-2/+27
|