Commit Graph

52 Commits

Author SHA1 Message Date
Jaap Keuter f7ed15f39e From John Fitzgibbon:
When specifying SA keys for AES-CTR, Wireshark expects a key length of 160, 224
or 288 bits, (i.e. 128, 192 or 256 bits, followed by the 32 bit nonce value),
but gcry_cipher_setkey() in packet_ipsec.c fails, as it expects 128, 192 or 256
bits.

Omitting the nonce won't work -- even if Wireshark liked those key lengths,
gcrypt wouldn't be able to decrypt without it.

svn path=/trunk/; revision=33105
2010-06-05 09:22:45 +00:00
Guy Harris 85fccb7f91 Constify, clean up indentation.
svn path=/trunk/; revision=32019
2010-02-27 00:43:44 +00:00
Bill Meier de4c6ff515 Fix a number of gcc _Wshadow warnings
svn path=/trunk/; revision=31557
2010-01-18 21:49:47 +00:00
Gerald Combs 8fc1491a60 Switch to using a bundled version of the openSUSE Build Service packages
for GNUTLS since they provide 32-bit and 64-bit Windows packages. We no
longer have winposixtype.h, so remove its #includes and add a ssize_t
typedef to config.h.win32.

svn path=/trunk/; revision=31341
2009-12-21 21:06:01 +00:00
Anders Broman 88bb44a51e From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=30691
2009-10-25 11:43:30 +00:00
Jaap Keuter fe03355556 From Harald Welte:
Errors occur which means decrypted_len - esp_iv len will render a negative value and thus
cause the problem. This patch prevents the crash. Not sure if this is a proper fix. At least it 
looks like a sane check to do.

svn path=/trunk/; revision=29979
2009-09-18 06:29:00 +00:00
Bill Meier 7081039a23 Reformat some long lines for readability....
svn path=/trunk/; revision=29570
2009-08-26 19:30:44 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam 0a5b014cec Don't guard col_clear with col_check
svn path=/trunk/; revision=29344
2009-08-09 07:36:13 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Jaap Keuter 05babef3b4 From David Dahlberg:
As for now, Wireshark supports only 96-bit (or 0-bit for NULL authentication)
integrity control values (ICVs) for IPsec ESP. While the autentication field is
of variable length, this may lead to situations where the whole packet is not
parsable.

To solve this, I added generic classes (not checked) for 128, 192 and 256 bit
ICVs to the ESP dissector. I also split the HMAC-SHA-256 autentication
algorithm to HMAC-SHA-256-128 (128 bit as defined in RFC 4868) and
HMAC-SHA-256-96 (from the very first draft, nevertheless unpatched Linux and
BSDs do it this way).

svn path=/trunk/; revision=29121
2009-07-16 19:57:15 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Anders Broman 4ec2c4ff47 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28363
2009-05-14 19:28:07 +00:00
Jaap Keuter 11de07c75c From Reinhard Speyerer:
This patch fixes several misspellings/typos in Wireshark SVN revision 28201.

svn path=/trunk/; revision=28213
2009-05-01 07:11:56 +00:00
Balint Reczey 974074c316 Fix ESP Initialization Vector dissection.
svn path=/trunk/; revision=27850
2009-03-26 14:40:18 +00:00
Balint Reczey 124533ce95 From Frederic Roudaut:
Add CAST5-CBC and HMAC-RIPEMD160-96 support.


svn path=/trunk/; revision=27847
2009-03-25 18:04:30 +00:00
Balint Reczey 40fd250351 Removed code duplication in ASCII key computation.
svn path=/trunk/; revision=27839
2009-03-24 11:54:56 +00:00
Balint Reczey 59fd8b7d32 Fix ASCII key computation.
This fixes bug 2943 thus allows ESP decoding again, which was 
broken since r25264.

svn path=/trunk/; revision=27835
2009-03-23 18:14:28 +00:00
Bill Meier 61465d4141 Fix some of the Errors/warnings detected by checkapi
svn path=/trunk/; revision=25274
2008-05-11 17:27:41 +00:00
Guy Harris 8d1a5fd0bd Redo the loops a bit; that fixes an uninitialized variable, and moves
the increments a bit closer to the point of use.

(XXX - is there more than one place where we turn a sequence of hex
digits into a string?  If so, we should make it a common utility.)

svn path=/trunk/; revision=25268
2008-05-09 18:45:22 +00:00
Guy Harris 4567d72fdc Null-terminate the hex-to-text-converted string.
svn path=/trunk/; revision=25266
2008-05-09 16:30:05 +00:00
Guy Harris 69efaa363d sprintf() and strtoul() are massive overkill for turning a string of hex
digits into a string of characters; use g_ascii_xdigit_value() to
convert individual hex digit characters to their hex value - and check
whether it succeeds or not, so we catch invalid hex digits! - and just
append the resulting byte value to the string.

Handle the case where compute_ascii_key() fails.

svn path=/trunk/; revision=25265
2008-05-09 16:15:22 +00:00
Anders Broman 63c5c71cf8 Remove:
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
#endif

svn path=/trunk/; revision=24859
2008-04-09 05:36:08 +00:00
Guy Harris 9c89cdaaa3 strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
est.  Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our
own versions if they're missing from GLib (as is the case with GLib
1.x).

In the code to build the list of named fields for Diameter, don't use
g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping
in the hash function and use g_ascii_strcasecmp() in the compare
function.

We do this because there is no guarantee that toupper(), tolower(), and
functions that use them will, for example, map between "I" and "i" in
all locales; in Turkish locales, for example, there are, in both
upper case and lower case, versions of "i" with and without a dot, and
the upper-case version of "i" is "I"-with-a-dot and the lower-case
version of "I" is "i"-without-a-dot.  This causes strings that should
match not to match.

This finishes fixing bug 2010 - an earlier checkin prevented the crash
(as there are other ways to produce the same crash, e.g. a bogus
dictionary.xml file), but didn't fix the case-insensitive string matching.

svn path=/trunk/; revision=23623
2007-11-27 18:52:51 +00:00
Anders Broman 90753a169e Apply yet another set of the optimization patches:
When offset parameter is 0 replace tvb_bytes_exist() with the faster tvb_length().
non heuristic dissectors

svn path=/trunk/; revision=23405
2007-11-08 22:40:20 +00:00
Gerald Combs 90975ad053 Move packet-ipsec.c to CLEAN_DISSECTOR_SRC.
svn path=/trunk/; revision=22287
2007-07-11 18:23:54 +00:00
Guy Harris 2361eb46de The data field of an address structure is now a void *; convert it as
appropriate.

svn path=/trunk/; revision=21566
2007-04-25 21:37:15 +00:00
Sebastien Tandel 68ad2f4b9b fix MacOSX gcc-3.3 warnings about unused tfs/value_string variables
most have been tagged unused (few have been deleted if dissector has not been
modified since a long time)

move packet-ssl-utils.c to DISSECTOR_SRC


svn path=/trunk/; revision=21431
2007-04-14 14:01:53 +00:00
Gerald Combs 536dd665a4 Fix a mis-labeled field reported in Ethereal bug 1101. Update all
of the short descriptions and fill in all of the long descriptions.
Fix up whitespace.

svn path=/trunk/; revision=21401
2007-04-13 05:44:57 +00:00
Martin Mathieson 315327f79d When key length wrong, show expected value.
Fix Preference label where %d was missing from specifier.

svn path=/trunk/; revision=19714
2006-10-27 10:16:22 +00:00
Gerald Combs b07b29f711 Simplify the preference string allocation code. Shorten the comments,
which (as Ulf pointed out) reduces the size of the prefs file
significantly.

svn path=/trunk/; revision=19486
2006-10-10 22:46:58 +00:00
Ronnie Sahlberg a92d1dc783 put the ah and esp payload as its own top level expansion in the tree instead of as an expansion inside the ah/esp layer.
since source/dest/protocol/info is updated by the content of the payload    it doesnt make sense to hide the actual payload inside esp/ah
it just would look confusing



svn path=/trunk/; revision=19206
2006-09-12 10:04:11 +00:00
Ronnie Sahlberg a67f7da9d7 prettify dissection of ESP
show the IV as a hexadecimal
show the protocol name for the Next header field inside ESP



svn path=/trunk/; revision=19204
2006-09-12 09:53:10 +00:00
Anders Broman 505465d5a4 From Frédéric Roudaut:
as requested  here is a patch  in order to take into account  Encryption 
and Authentication keys for ESP in hexa. 
You only have to write your key with 0x first. In this case if the key 
is not in 8-bit unit, it will be considered as starting with a "0" (4 bits). Excepted this case, the key should be completely written, even if it 
starts with "0x00".

svn path=/trunk/; revision=19181
2006-09-08 07:32:13 +00:00
Gerald Combs 0e5e0c4453 Fix two remaining off-by-one errors. Remove a static buffer.
svn path=/trunk/; revision=18943
2006-08-18 00:22:48 +00:00
Gerald Combs a0f21609b8 Fix CIDs 204 - 208.
svn path=/trunk/; revision=18915
2006-08-15 19:28:07 +00:00
Gerald Combs f6802d35c8 Put protocol preferences in a scrolled window, in case a particular
protocol has a lot of preference items.  Change the number of
configurable ESP SAs to 16 (in case someone needs do decrypt many
sessions in a single trace file).  Fix up whitespace.

svn path=/trunk/; revision=18903
2006-08-14 22:34:46 +00:00
Gerald Combs 4f16b6b178 Point to the newest (1.5.0-1) GnuTLS package. Since it contains
libgcrypt, enable it in the Windows build.

In packet-ipsec.c:

  - Remove non-constants from variable declaration initializations.
  - Use ep_alloc() in a couple of places.
  - Fix an off-by-one error.
  - Reduce the number of SAs in the preferences from 4 to 2.  4 made the
    preferences window absolutely enormous.  This is probably the wrong
    way to fix this.
  - Fix up whitespace.

svn path=/trunk/; revision=18856
2006-08-09 02:00:05 +00:00
Jörg Mayer 49e50f70d0 configure.in:
Check for libgcrypt 1.1.0 (note: I don't know which version
        is required, so maybe the version number needs to be changed
        for this test to work reliably).

packet-ipsec.c:
        - Replace __USE_LIBGCRYPT__ by HAVE_LIBGCRYPT to follow
          conventions.
        - Warning fixes: signedness in sscanf (%i -> %u)
        - Warning fixes: mixed declaration and code


svn path=/trunk/; revision=18460
2006-06-14 08:04:43 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Guy Harris e5001116f1 Do the ESP payload decoding, and pass it to the subdissector, regardless
of whether we're building a protocol tree or not - you have to call
subdissectors in either case.

svn path=/trunk/; revision=18078
2006-05-02 19:58:19 +00:00
Anders Broman 93e95ca62b From Frederic Roudaut:
I updated my previous patch of ESP :

* It now check authentication for (similar to the ICMP checksum):

- NULL Authentication
- HMAC-SHA1-96 [RFC2404]
- HMAC-SHA256
- HMAC-MD5-96 [RFC2403] (2)

I put aside AES-XCBC-MAC-96 [RFC3566] because I did not succeed to have 
a working implementation.
I added a field for any authenticator of 12bytes length (without 
authentication process)

* I also correct the printing of this authenticator field which was 
decrypted :-[ .


Thus, with this patch  if libgcrypt is linked withe ethereal you should 
have the availability to :
- decrypt packets
- check authentication
 at the same time or not.
If noone of these options are set (or libgcrypt is not available) you 
also may use the previous heuristic.

svn path=/trunk/; revision=17858
2006-04-13 22:26:13 +00:00
Luis Ontanon cb24ac2121 Some compilers do not handle very long lines...
Shouldn't this  preference description be somewhere else?


svn path=/trunk/; revision=17748
2006-03-27 22:37:11 +00:00
Anders Broman 4facedb3ee From Frederic Roudaut:
With a change :

#ifdef HAVE_LIBCRYPT
#define __USE_LIBGCRYPT__ 
#endif

>> > finally, I have updated my dissector using libgcrypt.
>> > It does not use openssl anymore.
>> > If gnutls is installed, all should work.
>> > Thus, now it should decrypt and dissect (transport/tunnel/several 
>> > encapsulations ...) :
>> >
>> > - NULL Encryption Algorithm
>> > - TripleDES-CBC [RFC2451] : keylen 192 bits.
>> > - AES-CBC with 128-bit keys [RFC3602] : keylen 128 and 192/256 
>> > bits.
>> > - AES-CTR [RFC3686] : keylen 160/224/288 bits. The remaining
>> > 32 bits will be used as nonce.
>> > - DES-CBC [RFC2405] : keylen 64 bits
>> >
>> > I also have added :
>> >
>> > - BLOWFISH-CBC : keylen 128 bits.
>> > - TWOFISH-CBC : keylen 128/256 bits.
>> >
>> > You have to indicate the Authentication algorithm even if all 
>> > Algorithms since it uses 12 bytes in the Auth field should work 
>> > (have a look to the README to understand why I put it
>> > ;-) ). If you consider I have to throw it away please tell me.
>> >
>> > HMAC-SHA1-96 [RFC2404]
>> > NULL
>> > AES-XCBC-MAC-96 [RFC3566]
>> > HMAC-MD5-96 [RFC2403]

svn path=/trunk/; revision=17734
2006-03-27 16:25:35 +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
Ulf Lamping bb8006d371 bugfix: prevent a negative length, if ah.ah_len is zero
svn path=/trunk/; revision=13902
2005-03-25 21:19:18 +00:00
Ulf Lamping 78ff68d4b5 a lot of warnings removed, most of them about pointer to int casts without using the appropriate GLib macros
svn path=/trunk/; revision=12832
2004-12-25 13:49:30 +00:00
Guy Harris 5289391300 From Mark Phillips: optionally support decoding the payload of ESP
packets using null encryption (with a heuristic to detect null
encryption).

svn path=/trunk/; revision=12513
2004-11-12 10:03:53 +00:00
Guy Harris eaadcc4c62 Move various tables into the epan directory.
svn path=/trunk/; revision=12130
2004-09-29 00:52:45 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00