aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
AgeCommit message (Collapse)AuthorFilesLines
2017-08-05Further cleanups.Guy Harris1-11/+32
If a variable is initialized in a loop body or an if clause or a switch clause, declare it inside the loop body/clause, and de-initialize it before leaving the loop body/clause. De-initialize the gnutls_pkcs12_t before leaving rsa_load_pkcs12(), so as not to leak it. Always leave the per-bag loop by "goto done", even if we're not within an inner loop, to make it clearer what we're doing. We initialize the bag structure at the beginning of that loop body; de-initialize it at the end. If we leave the loop without a private key, and we don't have an error message, the error is "we didn't find a PKCS8 key"; report that. Change-Id: I87cf296876c8f1879f69d01ce67ca2829b4f8d16 Reviewed-on: https://code.wireshark.org/review/22958 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-08-05rsa.c: strerror -> g_strerrorMichael Mann1-2/+2
Pacify checkAPIs.pl Change-Id: I637a6cd678b99d05cd1b26fd3cba6ad4dd19e8d2 Reviewed-on: https://code.wireshark.org/review/22957 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-04Fix up indentation.Guy Harris1-1/+1
Change-Id: I99445d9934dbb4c97c4c41192c8fe908441f2843 Reviewed-on: https://code.wireshark.org/review/22942 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-08-04Clean up private key file error reporting.Guy Harris1-13/+48
Ensure that rsa_load_pem_key() and rsa_load_pkcs12() always return an error message string if they fail, so that 1) they don't return NULL without supplying an error string; 2) they don't supply an error string if they succeed. If either of them fails, report the error; if there's no error string, report an unknown error (that shouldn't happen, but the wsutil/rsa.c code needs more cleanup before I'll believe it can't happen). While we're at it, clean up some of those error strings, return NULL rather than 0 as the failure case from rsa_load_pkcs12() as we do in rsa_load_pem_key() (they mean the same thing, but NULL makes it a bit clearer), and de-initialize the private key structure in rsa_load_pem_key() if we fail (so that we don't leak memory). Change-Id: Id9dd331800d87b017a500a6f579df446057f555b Reviewed-on: https://code.wireshark.org/review/22941 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-08-04SNMP: add support for USM SHA-2 algorithms (RFC 7860)Olivier Verriest1-2/+6
Generlize the USM handling and add support for HMAC-SHA-2 authentication protocols. Change-Id: I7cca2f24db61620423fded078c680322aff86400 Reviewed-on: https://code.wireshark.org/review/22846 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-01Use g_build_filename() instead, fix indentationJoão Valverde1-6/+3
Change-Id: I459208eed4a76b104bc28aa44ab05374e57043de Reviewed-on: https://code.wireshark.org/review/22873 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-05xtea[.ch] (wsutil): Add Modelines infoAlexis La Goutte2-0/+26
Change-Id: I32823df7a6ad543fd7912f64169050534b6ff3a4 Reviewed-on: https://code.wireshark.org/review/22532 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-22wsutil: Back out profile_write_info_fileStig Bjørlykke2-55/+0
Change-Id: I89a9aaeeba1689cce04f239dafdc9003492aba16 Reviewed-on: https://code.wireshark.org/review/22346 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-22wsutil: Return error from profile_write_info_fileStig Bjørlykke2-6/+22
Change-Id: I1d91cef01ced6cceaa75d1618ffcb59eae5b8e6f Reviewed-on: https://code.wireshark.org/review/22325 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21wsutil: Check return from ws_writeStig Bjørlykke1-2/+3
Change-Id: I73f65222dc23ebcb484f2598a12f43b284654420 Reviewed-on: https://code.wireshark.org/review/22321 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-21wsutil: Ignore return from ws_writeStig Bjørlykke1-2/+2
Change-Id: Idad4dd84538e3ccb7b258775704db8b6bd6c301e Reviewed-on: https://code.wireshark.org/review/22319 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-21[filesystem.c] Add a cast to aviod a warning with VisualStudio 2017.Anders1-1/+1
Change-Id: I95186bd54ae487e112fcb533c62bb8f9b210dc24 Reviewed-on: https://code.wireshark.org/review/22309 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21wsutil: Free files in reset_default_profileStig Bjørlykke1-0/+1
This plugs a memory leak. Change-Id: Ic989a89353d10de6f8f07df6a734d2b912facb7e Reviewed-on: https://code.wireshark.org/review/22305 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21Qt: Write a list of profile files at startupStig Bjørlykke2-0/+39
This file will contain all personal config files which will be fetched from a profile. Change-Id: I430ca84ccefc17f0e21c8efb93a92602ab8d5661 Reviewed-on: https://code.wireshark.org/review/22303 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-20Qt: Create the user profiles dir at startupStig Bjørlykke2-25/+46
Ensure the user profiles directory is created at startup so that users can put downloaded profiles without creating the directory. Change-Id: Ib06bb3055daef8fd9e78d7887ce56f8fe50e48bf Reviewed-on: https://code.wireshark.org/review/22275 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-16Fix SURROGATE_VALUE() to match what RFC 2781 says.Guy Harris1-1/+1
While we're at it, note in the comment for get_utf_16_string() the "decoding UTF-16" algorithm in RFC 2781. Change-Id: I5d7dc5c09af0474c055796e49e0c7b94fa87d2ad Reviewed-on: https://code.wireshark.org/review/22171 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-16Change some names to reflect Apple's new UNIX-for-Macs name.Guy Harris3-8/+8
{OS_X,os_x} -> {MACOS,macos}. Change-Id: Icebea6ab566c65996ee97bacb88fac7e84ec32de Reviewed-on: https://code.wireshark.org/review/22161 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-16Rename a routine to match the OS name.Guy Harris1-2/+5
It's now "macOS". While we're at it, note that the property list from which it fetches version information still calls it "Mac OS X". Change-Id: I438ef9dc65c2619d7378b0deb5efc84734a2ac6d Reviewed-on: https://code.wireshark.org/review/22159 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-10Fix indentation.Guy Harris1-5/+5
Change-Id: I9ea3947a4100d4d566c0d6815de5336214f9f581 Reviewed-on: https://code.wireshark.org/review/22062 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-10Put the non-filter part of epan/color_filters.h into wsutil/color.h.Guy Harris2-0/+63
Places that only need color_t, such as certain preferences, don't need the color filter stuff. Change-Id: I88fc2858454d04e659b323a8bc28b21d362ca3fb Reviewed-on: https://code.wireshark.org/review/22060 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-06rsa.h: include <stdio.h>Michael Mann1-0/+1
Pacify OS/X buildbot Change-Id: Icbf49b747473adfa16c1a08c81489b68a88d9a93 Reviewed-on: https://code.wireshark.org/review/21979 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-05Move RSA key loading and decryption functions to wsutilAhmad Fatoum6-1/+490
Loading PEM and PKCS#11 keys was being done in static functions in packet-ssl-utils.c. These were moved to wsutil, with prototypes in a new <wsutil/rsa.h> header. This adds gnutls as optional dependency to wsutil. The RSA decryption helper was also moved and is now provided in <wsutil/wsgcrypt.h>. This allows more dissectors to access this functionality. Change-Id: I6cfbbf5203f2881c82bad721747834ccd76e2033 Reviewed-on: https://code.wireshark.org/review/21941 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-05wsutil: Add XTEA block cipherAhmad Fatoum3-2/+113
XTEA is a 64-bit block Feistel cipher with a 128-bit key and a suggested 64 rounds. It's used by the MMORPG Tibia for encrypting game server traffic. Usual XTEA treats the blocks as big-endian. Tibia treats them as little endian, therefore both versions are provided. Change-Id: I9ad0c8e066f848b20772ce4e1d3df19deff307b8 Reviewed-on: https://code.wireshark.org/review/21942 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-05-11Put the HAVE_REMOTE hack into wsutil/wspcap.h, and include that file.Guy Harris2-1/+49
Have a header file that defines HAVE_REMOTE if HAVE_PCAP_REMOTE is defined, and then includes pcap.h. Replace all other includes of pcap.h, and the definition of HAVE_REMOTE, with includes of that file. Check for anything other than wspcap.h including pcap.h in checkAPIs.pl. Change-Id: I3cbee8208944ad6f006f568b3fe3134e10b2a883 Reviewed-on: https://code.wireshark.org/review/21605 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Add g_get_monotonic_time() to glib-compat and useMartin Mathieson2-0/+15
Change-Id: If41dab19692516270e8b4bcf1a8a954bb8dc3ccc Reviewed-on: https://code.wireshark.org/review/21480 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-19Fix memory leak in create_persconffile_profileMax Dmitrichenko1-0/+3
found by valgrind Change-Id: I15aef9d78dffac44e36849349dc57b4b36f23de1 Reviewed-on: https://code.wireshark.org/review/21228 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-18Check the result of localtime().Guy Harris1-2/+6
Unlikely to fail, but it squelches CID 1398220. Change-Id: I0e40146f0a32c1082e84052c6b3e382fe6a15ae7 Reviewed-on: https://code.wireshark.org/review/21177 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris7-122/+146
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05A bunch of "{Mac} OS X" -> "macOS" changes.Guy Harris6-11/+11
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X 10.0", for example. It was "Mac OS X" until 10.8 (although 10.7 was sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS X" from 10.8 to 10.11. Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3 Reviewed-on: https://code.wireshark.org/review/20933 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-28wsutil: fix a NULL pointer dereference when there is a single plugin registeredPascal Quantin1-16/+6
Rework loop to avoid dereferencing a NULL pointer. Bug introduced in g6d79055 Change-Id: I88a9f2d045b633cc2365ff6ce939f3315e7d42cc Reviewed-on: https://code.wireshark.org/review/20751 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-16Add support for verifying CIP Safety CRC values.Michael Mann6-0/+281
Change-Id: I44f7ff6980f27b1a0d4199a91f9b217aec7e4652 Reviewed-on: https://code.wireshark.org/review/20557 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-10Replace aes.c and des.c by Libgcrypterikdejong8-1831/+33
Follow-up of https://code.wireshark.org/review/20095 Rewritten functions: - crypt_des_ecb crypt_des_ecb verified against previous crypt_des_ecb implementation with 4294967295 random keys and input buffers from /dev/random as I cannot find a suitable pcap which uses DES Change-Id: I21ec2572451e0ded4299ffadd8dd687817bc6318 Reviewed-on: https://code.wireshark.org/review/20429 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-03-02Rewrite dissectors to use Libgcrypt functions.Erik de Jong14-1734/+70
As discussed on the mailinglist, rewriting dissectors to use Libgcrypt functions as Libgcrypt will be mandatory after change 20030. Removal of following functions: - crypt_md4 - crypt_rc4* - aes_cmac_encrypt_* - md5_* - sha1_* - sha256_* Further candidates: - aes_* - rijndael_* - ... Added functions: - ws_hmac_buffer Added const macros: - HASH_MD5_LENGTH - HASH_SHA1_LENGTH Changes on epan/crypt/* verified with captures from https://wiki.wireshark.org/HowToDecrypt802.11 Changes on packet-snmp.c and packet-radius.c verified with captures from https://wiki.wireshark.org/SampleCapture Changes on packet-tacacs.c verified with capture from http://ccie-in-3-months.blogspot.nl/2009/04/decoding-login-credentials-regardless.html Change-Id: Iea6ba2bf207cf0f1bf2117068fb1abcfeaafaa46 Link: https://www.wireshark.org/lists/wireshark-dev/201702/msg00011.html Reviewed-on: https://code.wireshark.org/review/20095 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-02-26wsutil: fix bugs in plugins_cleanup().Dario Lombardo1-11/+10
If plugin_list was NULL, plugin_types didn't get cleaned. Add test and set of open_info_arr. Change-Id: I7669e3ba86039fb2b26ff2da64f51896053c5e68 Reviewed-on: https://code.wireshark.org/review/20195 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-25Fix compilation without plugins:Jakub Zawadzki1-0/+2
filesystem.c: In function ‘free_progdirs’: filesystem.c:2209:12: error: ‘plugin_dir’ undeclared (first use in this function) g_free(plugin_dir); Change-Id: Ib52b86d41be79b8ed7e42f5fdfaddcae6b0ca5c8 Reviewed-on: https://code.wireshark.org/review/20270 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-22Only do save_errno = errno and errno = save_errno around g_free();Guy Harris1-7/+5
There is *no* need to do it around an assignment statement. (We *probably* don't need to do it around g_free(), but better safe than sorry - maybe some memory allocator makes system calls to hand regions of the address space back.) Change-Id: Ib57540cc36b505aadf4a5e8885b9a744a35b1f75 Reviewed-on: https://code.wireshark.org/review/20236 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-21Fix a double free.Gerald Combs1-1/+3
In create_persconffile_profile, pf_dir_path_copy needs to be allocated separately since the subsequent call to get_dirname is destructive. Add back a call to g_strdup. This should hopefully fix a crash in the Win32 buildbot. Change-Id: I591b5845032c9b8a5324bf6ac60fc43d1e92ac2e Reviewed-on: https://code.wireshark.org/review/20231 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-20Add some glib functions not available in older glibsAndersBroman4-0/+112
Change-Id: I6526d799447a3b6c0b9bb42f8d0f8c3415299ed0 Reviewed-on: https://code.wireshark.org/review/20158 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-02-19Clean up some memory leaks in wsutil/filesystem.cMichael Mann2-49/+54
The fixes involve functions always returning a string that needs to be freed by the caller. That way the static string pointers within the functions don't end up leaking at program end. Change-Id: I35a8dc37536c2927d88f33217887f62efafcc8ca Reviewed-on: https://code.wireshark.org/review/20175 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-18plugins: free list on cleanup.Dario Lombardo1-0/+9
Change-Id: Idff606297f72238f8539cb00ea394ee80fcb502c Reviewed-on: https://code.wireshark.org/review/20074 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-18epan/wsutil: free memory on exit.Dario Lombardo1-1/+11
Change-Id: I1cf3a4ce3b21b2e10887cbef5576e5e028e55bab Reviewed-on: https://code.wireshark.org/review/20052 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-18wsutil: remove leaks from filesystem and plugins code.Dario Lombardo4-1/+44
Change-Id: Iac2805c0130bd2ba6cdb3c9dd997050274d58d99 Reviewed-on: https://code.wireshark.org/review/20020 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-14Qt: Reset Default profile supportStig Bjørlykke1-0/+34
Add support for resetting the Default profile by deleting it in the Profile Dialog. All profile files will be deleted and all other files will be kept. Change-Id: I795a6db3ee7b2c29e7aba461183e6cc411798b75 Reviewed-on: https://code.wireshark.org/review/20097 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-02-14wiretap: add cleanup routine.Dario Lombardo2-0/+12
The cleanup routine has been added to exit section of the applications. Those which required a exit restyle have been patched as well. Change-Id: I3a8787f0718ac7fef00dc58176869c7510fda7b1 Reviewed-on: https://code.wireshark.org/review/19949 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-02-13Make Libgcrypt a mandatory dependencyPeter Wu2-6/+0
Removed all guards for HAVE_LIBGCRYPT, change autotools and CMake to error out if it is not available. Update release notes, developer documentation and README with the new status. Clarify relation with GnuTLS in macosx-setup.sh. Install Libgcrypt via brew script. Motivation for this change is that many dissectors depend on Libgcrypt and having it optional increases the maintenance burden (there have been several compile issues in the past due to the optional status). Furthermore, wsutil has crypto code that can be replaced by Libgcrypt. Change-Id: Idf0021b8c4cd5db70b8766f7dcc2a8b3acbf042f Link: https://www.wireshark.org/lists/wireshark-dev/201702/msg00011.html Reviewed-on: https://code.wireshark.org/review/20030 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-02-07Make sure pid_t is defined.Guy Harris1-0/+3
Just as we include <windows.h> on Windows to get HANDLE defined, include <sys/types.h> on UN*X to get pid_t defined. We don't seem to need this (yet) on the master and 2.2 branches, but it looks as if it might be necessary on the 2.0 branch. Do it everywhere. Change-Id: I9535fa9944265746d332f8dc337e42a020b503d3 Reviewed-on: https://code.wireshark.org/review/19998 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-05pint(.h): Add Modelines and fix indent (use spaces)Michael Mann1-10/+23
Change-Id: Icadbf65ad186c775b2a0ca8596d5bf4ba66e4c68 Reviewed-on: https://code.wireshark.org/review/19873 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-02wsutil/sober128: remove unused macros and functionsPeter Wu2-429/+4
Removed unused macros/functions that are apparently imported from LibTomCrypt, only LOAD32L and STORE32L are needed. Remove code that tries to distinguish between little/big endian, since WORDS_BIGENDIAN was never defined, this would never have worked on big endian anyway. Remove the special ROR "optimization" for GCC on i386, modern compilers are able to optimize it to exactly the same thing. The generic LOAD32L/STORE32L macros are less optimized (as can be seen in the generated code), but this was not noticable in the mean running time. Tested with the packet capture from bug 3232, the result is the same: tshark -ocorosync_totemnet.private_keys:example.com -r corosync-totemsrp--key:example.com--2nodes.pcap -Vx Bug: 13368 Change-Id: I59bf27d7dd990bbcd5ad34a1797f4a6c8a04512d Reviewed-on: https://code.wireshark.org/review/19894 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-01-29(D)TLS: fix type of record sequence numberPeter Wu1-0/+11
The record sequence number is 64-bit, not 32-bit. This applies to all SSLv3/TLS/DTLS versions. Without this fix, after about four million records, the wrong MAC is calculated (for TLS 1.2) or decryption will fail (for TLS 1.3). Change-Id: I05e5e8bc4229ac443a1b06c5fe984fb885eab1ca Reviewed-on: https://code.wireshark.org/review/19824 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-01-26Clean up some UN*X-vs-Windows socket issues.Guy Harris2-0/+82
Have a wsutil/socket.h file, for inclusion by everything that uses sockets, that contains the UN*X-vs-Windows #includes and #defines to hide some UN*X-sockets vs. Winsock API differences. That stuff mostly comes from from extcap/extcap-base.h; have that file just include wsutil/socket.h rather than defining that stuff itself. Include it in sharkd_daemon.c. Use socklen_t for the size of things to pass to bind() as the last argument; wsutil/socket.h defines it as int on Windows. Ignore sharkd in Git. Change-Id: I3f2171b7aa613717f52305f62bfd7d43e0172dc6 Reviewed-on: https://code.wireshark.org/review/19796 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>