Commit Graph

50 Commits

Author SHA1 Message Date
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Anders Broman eb618abad9 From Bill Parker:
Explicitly declare/cast 'unsigned <variable>' as 'unsigned int <variable>'

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7810

svn path=/trunk/; revision=45418
2012-10-09 08:40:02 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Chris Maynard 86cbd0b559 #include <epan/crypt/crypt-*.h> => #include <epan/crypt/*.h>
svn path=/trunk/; revision=40570
2012-01-18 21:20:50 +00:00
Alexis La Goutte 09e95bda3f Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
Try to compile with cmake in Ubuntu 11.10

svn path=/trunk/; revision=40410
2012-01-09 16:32:53 +00:00
Anders Broman fa7ea2ea34 fix [-Wunused-but-set-variable]
svn path=/trunk/; revision=39803
2011-11-12 12:37:38 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier e2996ceabe Convert 'encoding' parameter of certain proto_tree_add_item() calls in asn1 dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39294
2011-10-06 16:50:13 +00:00
Bill Meier e18e2694c6 Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
     FT_BYTES
     FT_IPV6
     FT_IPXNET
     FT_OID
Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|1|0|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN
 

svn path=/trunk/; revision=39263
2011-10-05 02:39:04 +00:00
Stig Bjørlykke 632dcd0d77 Add changes in r35384 to template file.
svn path=/trunk/; revision=36009
2011-02-20 15:03:09 +00:00
Gerald Combs 622f07b95e Initialize MechType_oid in the right place.
svn path=/trunk/; revision=33396
2010-07-01 00:44:21 +00:00
Jeff Morriss ed75cdd99c Make a variable a guint8* instead of a char* since it a) holds TVB data and b) matches what tvb_new_child_real_data() wants for its 2nd argument. This cleans up a warning from the Sun compiler.
svn path=/trunk/; revision=32599
2010-04-29 15:23:10 +00:00
Bill Meier f8b92f8d0b #include <stdio.h> not needed.
svn path=/trunk/; revision=32405
2010-04-06 17:01:14 +00:00
Ronnie Sahlberg ad66a89c3a From: Stefan Metzmacher <metze@samba.org>
Date: Thu, 27 Aug 2009 10:51:34 +0200
Subject: [PATCH 3/7] packet-spnego: fix decryption of DCERPC packets in 
decrypt_gssapi_krb_cfx_wrap()

There the checksum and the encrypted data are no 2 different buffers
and we need to combine them before we try to rotate and decrypt them.

metze


svn path=/trunk/; revision=31794
2010-02-04 23:16:08 +00:00
Stig Bjørlykke c4441c8b43 Use proto_spnego for protocol tree item.
svn path=/trunk/; revision=31418
2010-01-03 14:50:36 +00:00
Stig Bjørlykke 5c0369ba97 Apply r30376 to asn1 template files.
svn path=/trunk/; revision=30767
2009-10-30 10:21:35 +00:00
Anders Broman bc9a809b65 From Didier Gautheron:
ep memory can't be used for tvbs defined as data_source.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4054

svn path=/trunk/; revision=30376
2009-10-06 19:15:58 +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
Bill Meier cb7dac7100 Initialize several ett_... variables to -1
svn path=/trunk/; revision=29295
2009-08-04 18:52:01 +00:00
Ronnie Sahlberg f8cf2d2c83 When we passed the crytobuffer to krb5_c_decrypt() we never actually
verified that we did have enough data in the buffer/tvb, which could 
lead to a SEGV.
(for example if we enable KRB5 decryption but we do NOT use TCP 
reassembly, and the encrypted data goes beyong the end of the current 
segment)


Change the signature to decrypt_krb5_data() to take a TVB instead of a 
buffer+length.
Actually check that we do have the entire encrypted PDU before calling 
out to the kerberos libraries.



svn path=/trunk/; revision=29213
2009-07-28 13:01:41 +00:00
Stig Bjørlykke 4d8dd01e8e Changed flags_set_truth -> tfs_set_notset
svn path=/trunk/; revision=28989
2009-07-07 14:54:15 +00:00
Stig Bjørlykke 1a3432a0e0 tvb_child_new_real_data() -> tvb_new_child_real_data()
svn path=/trunk/; revision=28845
2009-06-26 03:20:12 +00:00
Anders Broman 2b72ed9f26 tvb_new_real_data()->tvb_child_new_real_data()
svn path=/trunk/; revision=28843
2009-06-25 05:59:04 +00:00
Stig Bjørlykke e3ef20f3ea From Kovarththanan Rajaratnam:
Clean up header field info in asn1/*-template.c files.

From me:
Fixed a few typos in the patch.

svn path=/trunk/; revision=28817
2009-06-23 06:02:12 +00:00
Anders Broman c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Bill Meier f35324d0fd Minor cleanup mostly related to proto_reg_handoff
Remove code for unused handles;
 Localize handles (in proto_reg_handoff) which need not be global;
 Localize (in proto_reg_handoff) "saved prefs";
 Use find_dissector instead of create_dissector_handle as appropriate;
 Use gboolean for "initialized" flag in proto_reg_handoff.

svn path=/trunk/; revision=26693
2008-11-04 21:42:02 +00:00
Ronnie Sahlberg 2b739fc611 use g_malloc/g_free instead of malloc/free
svn path=/trunk/; revision=26353
2008-10-05 08:41:44 +00:00
Ronnie Sahlberg 54716f411b change u_char to unsigned char to make the osx compiler happy
svn path=/trunk/; revision=26351
2008-10-05 00:51:28 +00:00
Ronnie Sahlberg d83b8b0336 kerberos/gss enhancements
add a parameter *datalen to decrypt_krb5_data() so that we can pass back 
the length of the decrypted blob back to the caller.
This is useful for when there are "junk" at the end of the blob and thus 
the decrypted data is not the same size as the encrypted blob.
GSS CFX is one such example.
(we should have done this earlier since it might have made some other 
stuff easier to imlement...)


make the preference setting krb_decrypt a globally visible variable so 
we can see its value and act on it from callers of krb decryption from 
outside of packet-kerberos.c    i.e.   from GSS CFX


Make keytype == -1  a wildcard that when passed to decrypt_krb5_data() 
will try any/all encryption keys.
This since GSS CFX does not provide the enctype in the GSS layer.
(The GSS CFX enctype is only negotiated during the AP-REQ/REP  so we 
should later pick this value up and store it in a CFX session variable.
That is for a later enhancement.
)


Enhance the GSS decryption (that for hitorical reasons are implemented 
in packet-spnego.c  and not packet-gssapi.c :-)  )
to also handle decryption of GSS CFX

This should make wireshark able to decrypt any/all GSSAPI  RFC4121 
packets, if the keytab file is provided.


I have successfully decrypted LDAP using GSS CFX with AES encryption 
with this.




svn path=/trunk/; revision=26350
2008-10-05 00:28:36 +00:00
Gerald Combs d2821ce8c0 We always use start_offset, so don't wrap it in "#ifdef HAVE_KERBEROS".
svn path=/trunk/; revision=26301
2008-09-30 02:55:42 +00:00
Ronnie Sahlberg 687b0422d3 from Metze
add dissection of RFC4121 krb5 blobs



svn path=/trunk/; revision=26294
2008-09-29 18:44:10 +00:00
Guy Harris 1e7c1bc036 Add a cast to squelch an MSVC warning.
svn path=/trunk/; revision=21944
2007-05-25 21:50:12 +00:00
Guy Harris 88f69b80c0 Make SND_SEQ an array of 2 guint32's, rather than an array of 8
guint8's, to squelch some compiler warnings (and clean up some
comparisons).

svn path=/trunk/; revision=21941
2007-05-25 19:39:35 +00:00
Anders Broman f08cd1e5e3 actx in the rest of dissect_ber..()l
svn path=/trunk/; revision=21773
2007-05-15 05:49:43 +00:00
Anders Broman c01f382974 Second step in introducing asn context to BER dissectors just like in PER.
svn path=/trunk/; revision=21753
2007-05-13 20:58:29 +00:00
Anders Broman 4c692a62b6 Start introducing actx to ber functions.
svn path=/trunk/; revision=21705
2007-05-06 22:34:05 +00:00
Jeff Morriss 43e550c754 Fix bug 1380:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1380

by registering the spnego dissector by name (e.g., call 'register_dissector()').


svn path=/trunk/; revision=20837
2007-02-18 10:18:53 +00:00
Graeme Lunt 1864da87a8 This patch looks for a confounder in GSSWrap for DES_MAC_MD5 algorithm.
This is purely empirical as I can find no standard that says it should be there.
However successful LDAP/SASL/GSSAPI between AD and Java client shows it seems to be present.
If the confounder is not dissected, the LDAPMessage to fail to be decoded.


svn path=/trunk/; revision=20833
2007-02-17 11:16:52 +00:00
Gerald Combs 9d5858f635 Move cryptography code to epan/crypt.
svn path=/trunk/; revision=20359
2007-01-09 22:14:07 +00:00
Gerald Combs 53689800e6 Move epan/crypt-md5.[ch] to epan/crypt. Remove
epan/crypt/airpdcap_md5.[ch].  Fix up whitespace.

svn path=/trunk/; revision=20277
2007-01-02 22:49:57 +00:00
Tomas Kukosa 55600fb60a Ethereal -> Wireshark
asn2eth -> asn2wrs

svn path=/trunk/; revision=18214
2006-05-23 15:17:14 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ronnie Sahlberg 2975ff835b microsoft does not use a confounder for spnego when using DNS/TSIG
they use an additional confounder everywhere else  (as it seems)   but not for DNS/TSIG


svn path=/trunk/; revision=16894
2005-12-25 11:43:47 +00:00
Tomas Kukosa 3b770d5c7c - dissect_ber_object_identifier() returns value as tvb
- new dissect_ber_object_identifier_str() function
 - BER dissectors adapted and regenerated

svn path=/trunk/; revision=16501
2005-11-14 10:02:31 +00:00
Guy Harris 4e09b5e0b3 Some compilers don't allow a static declaration of a function inside
another function, so move the declaration of
dissect_spnego_PrincipalSeq() to the top of the file.

svn path=/trunk/; revision=15938
2005-09-21 18:27:28 +00:00
Guy Harris 0fb81e221e An InnerContextToken comes with an OID for the mechanism, which is what
we use to determine how to interpret the token; don't bother fetching
the OID attached to the frame or conversation, as we're not using it.

Indent code in the .cnf file to match the code generated by asn2eth.

The mechListMIC in a NegTokenInit is sometimes a sequence containing a
string; check the header of the mechListMIC and dissect it as such a
sequence or as a regular item depending on whether it's a sequence or
not.

If we see a supportedMech in a NegTokenTarg, save next_level_value for
that OID with the conversation.

Dissect a responseToken in a NegTokenTarg, and a mechListMIC in a
NegTokenTarg, appropriately.

Get rid of "gssapi_dissector_handle()", and just use
next_level_value->handle - it was never being called if next_level_value
was null.

When we're dissecting a KRB5 blob, just use get_ber_identifier() to get
the header, so we don't report an ASN.1 error if there isn't a BER
identifier there; dissect the identifier and length only if we know we
have them.

svn path=/trunk/; revision=15937
2005-09-21 17:42:11 +00:00
Guy Harris f91d140cc9 Don't use u_char - not all platforms define it, and even those that do
might require other files to be included to get it.

svn path=/trunk/; revision=15828
2005-09-15 23:39:08 +00:00
Anders Broman 0060eaf390 Replace the spnego dissector with an asn2eth generated one.
svn path=/trunk/; revision=15810
2005-09-15 05:38:37 +00:00