Commit Graph

45 Commits

Author SHA1 Message Date
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Bill Meier bb14288a52 From Evan Huus:
CppCheck found a bunch of redundant assignments to the variable
 'operand_address'.

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

svn path=/trunk/; revision=42457
2012-05-07 01:27:36 +00:00
Jörg Mayer 2097912587 Rename crypt-xxx to xxx
svn path=/trunk/; revision=40511
2012-01-15 12:29:44 +00:00
Stig Bjørlykke 5359494b1f Second try to move crc routines to libwsutil.
This time keep the tvb routines in epan.

Now we can use common crc routines outside epan.

svn path=/trunk/; revision=38810
2011-08-31 09:00:54 +00:00
Stig Bjørlykke 71f903b956 Revert r38800, as the crc routines contains some tvb functions.
svn path=/trunk/; revision=38803
2011-08-30 14:17:40 +00:00
Stig Bjørlykke 4132d40e50 Move all crc routines to libwsutil.
This way we can use the crc routines in wiretap.

svn path=/trunk/; revision=38800
2011-08-30 13:46:42 +00:00
Bill Meier 4f420ef6cd Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings
svn path=/trunk/; revision=37600
2011-06-07 22:28:55 +00:00
Gerald Combs 5f932275b0 Make sure our addresses are modulo 2^16 in a lot of places. Fixes a
crash found while fuzzing, and hopefully fixes bug 4867.

In sigcomp_init_udvm() initialize the first 8 bytes of our buffers,
which squelches a valgrind complaint.

svn path=/trunk/; revision=33321
2010-06-25 17:14:41 +00:00
Guy Harris 82d5079c41 Fix comments.
svn path=/trunk/; revision=33090
2010-06-04 19:29:26 +00:00
Gerald Combs cfe5890af7 According to RFC 3220 section 7 the max UDVM message size is 65536,
not 65535. Hopefully fixes bug 4837.

svn path=/trunk/; revision=33087
2010-06-04 18:28:02 +00:00
Guy Harris 96d478e006 Sorry, I forgot that 8.6. UDVM Cycles says
Note that the number of UDVM cycles MUST NOT be increased if a
	request for additional compressed data fails.

so we *shouldn't* increase the cycle count further when
SIGCOMP_INSTR_INPUT_BYTES fails.  That does *NOT* of course, mean that
we shouldn't increase the cycle count by 1 for a failed INPUT-BYTES
instruction - that would leave UDVM vulnerable to infinite loops (as per
bug 4826), and I *really* doubt that was their intent; presumably, it
means it should not be increased *by the number of cycles for the
additional data*:

	Additionally, if the UDVM successfully requests n bits of
	compressed data using one of the INPUT instructions then the
	number of available UDVM cycles is increased by n *
	cycles_per_bit once the instruction has been executed.

if the attempt to get that additional data fails.

svn path=/trunk/; revision=33065
2010-06-03 01:22:18 +00:00
Gerald Combs 19e13130d2 Increment the cycle count no matter what. Increase the cycle count
further when SIGCOMP_INSTR_INPUT_BYTES fails. Fixes the infinite loop
found in bug 4826.

svn path=/trunk/; revision=33061
2010-06-02 22:16:49 +00:00
Bill Meier 9d663d7081 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31720
2010-01-28 18:45:46 +00:00
Kovarththanan Rajaratnam 0cc4720cb8 Allocate 64K buffer from heap
svn path=/trunk/; revision=30339
2009-10-05 18:07:59 +00:00
Stig Bjørlykke 14d5fe6c49 Print correct destination for SIGCOMP_INSTR_COPY_LITERAL.
svn path=/trunk/; revision=30206
2009-09-29 20:59:30 +00:00
Anders Broman bec2875b2b Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28365
2009-05-14 20:12:43 +00:00
Bill Meier ea2d615dd7 Fix some typos and spelling (mostly in text strings)
svn path=/trunk/; revision=27068
2008-12-20 01:01:28 +00:00
Stephen Fisher 8fd3ee0560 Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it.


svn path=/trunk/; revision=21253
2007-03-28 21:55:11 +00:00
Stephen Fisher 46b8669566 Fix a bunch more warnings. Add -Werror when using --with-warnings-as-errors
under gcc to tools/lemon, plugins/mate and epan/


svn path=/trunk/; revision=21204
2007-03-26 06:10:52 +00:00
Gerald Combs f67fdf4865 Move sha1.[ch] to epan/crypt/crypt-sha1.[ch]. Remove duplicate code.
svn path=/trunk/; revision=20399
2007-01-12 00:33:32 +00:00
Anders Broman 2f849c368a From Cristian Constantin:
As a workarond for the problem that accsessing a state with a state id > the stored
minimum access length fail,  only store and compare the state with the minimum access
lengt specified in the standard of 6 bytes.

svn path=/trunk/; revision=20041
2006-12-05 06:43:47 +00:00
Anders Broman 996d4db495 Ethereal->Wireshark
svn path=/trunk/; revision=18234
2006-05-28 19:49:07 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Anders Broman 84b00c55d1 Fix a bug reported by coverity.
svn path=/trunk/; revision=17490
2006-03-07 06:15:06 +00:00
Jörg Mayer f9a57f08d1 Bill Meier:
Spelling fixes.

svn path=/trunk/; revision=16956
2006-01-05 13:01:08 +00:00
Guy Harris e3482b0576 I think this is the check that was intended....
svn path=/trunk/; revision=15919
2005-09-21 01:39:00 +00:00
Gerald Combs 775906a73f Be more paranoid about buffer overruns.
svn path=/trunk/; revision=15901
2005-09-20 17:26:43 +00:00
Gerald Combs bb45165680 Throw an exception instead of trying to read past the end of a buffer.
Fixes bug 455.

svn path=/trunk/; revision=15876
2005-09-19 20:50:10 +00:00
Gerald Combs a67948bac7 Add bounds checking in several places to the SigComp UDVM. Use memset()
instead of while loops to initialize variables.  Use a define instead
of magic numbers.  Don't use guint8s for counters.  Add a corresponding
entry to the release notes.

svn path=/trunk/; revision=15715
2005-09-07 20:09:40 +00:00
Anders Broman 59829053fb udvm: initialise a variable
sigcomp: implement RFC 4077

svn path=/trunk/; revision=15640
2005-08-31 19:51:24 +00:00
Anders Broman 557df81507 From Timo Metsala
Changes:

o Implemented CRC and SHA-1 (sort operations are still missing)

o After state acccess, the execution start is not necessarily the
  beginning of the bytecode; start IP is now a new parameter to
  decompress_sigcomp_message()

o Removed some hard-coded assumptions about bytecode starting at offset
   128

svn path=/trunk/; revision=15531
2005-08-25 19:23:15 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Anders Broman 681f2bbdef From Paul Ollis:
epan/sigcomp_state_hdlr.c epan/sigcomp_state_hdlr.h
  ---------------------------------------------------

    Function udvm_state_access:

        1. Removed the state_vars_valid parameter. It is no longer used.

        2. The function now correctly updates each of state_length,
           state_address and state_instruction with saved state value.

           [Previously this was only done for state referenced in the SigComp
            message header.]

        3. Removed code that (incorrectly) read byte_copy_left from UDVM memory
           within the loop that writes the state to UDVM memory.

        4. Removed the code that set the useful values in UDVM memory. This
           should only be done for state referenced in the SigComp message
           header. (The decompress_sigcomp_message function, sets the useful
           values.)


  epan/sigcomp-udvm.c epan/sigcomp-udvm.h
  ---------------------------------------

    Function decompress_sigcomp_message:

        1. Added three new parameters; header_len, byte_code_state_len,
           byte_code_id_len.  The byte_code_state_len and byte_code_id_len
           are used to set the useful values in UDVM memory. The
           header_len is required to calculate the cycles available
           for decompression.

        2. Various minor corrections to spellings, etc in generated
           messages.

        3. Reduced the number of lines of output for print_level_1. Now
           the execution trace shows the instruction name and parameter
           values on one line.

           [This was done because, we found that even at the lowest
           level of detail ethereal became unusably slow; running on
           a 500 MHz SPARC. This seems to be related to the number of
           lines produced by the SigComp trace, which can easily be over
           1000 with the modified code.]

        4. Removed the used of some floating point functions. In all
           cases they were unnecessary and could potentially cause the
           code to produce the wrong results on some platforms (although
           this is unlikely).

        5. The useful values are now set correctly, using the new
           byte_code_state_len and byte_code_id_len parameters.

        6. The message header length is now included in the calculation of
           maximum_UDVM_cycles. Previously, the calculation could underestimate
           the value, resulting in the (small) chance that some legitimate
           messages might fail to decompress.

           Note: The calculation might now slightly over-estimate the cycles
           but this is a reasonable thing to do.

        7. Implemented the PUSH, POP, CALL and RETURN instructions.

           Note: The two SORT instructions and the CRC and SHA-1 instructions
           are still not implemented.

        8. The COPY and COPY-LITERAL instructions now apply the
           byte-copying-rules to the source address as well as the destination
           address.

        9. The COPY-LITERAL and COPY-OFFSET now correctly handle the
           destination operand. Previously, it was possible for the destination
           to be left at byte_copy_right when it should be left at
           byte_copy_left.

        10. All three COPY instructions will now behave correctly if the source
            or destination start at byte_copy_right; i.e. they read/write to
            byte_copy_right, byte_copy_right+1, etc. Previously the parameters
            would wrap to byte_copy_left.

        11. The COPY-OFFSET instruction now correctly calculates the source
            address for all values of offset. Previously a very large offset
            (greater than the circular buffer size) could cause the starting
            position to be mis-calculated.

        12. Modulo 65536 arithmetic has been added in some places where it was
            missing.

            [Only when noticed, we have not been able to check all the code.]

        13. Some redundant code was removed for the INPUT-BITS instruction.
            Also, INPUT-BITS (0, x, x) now correctly discards spare bits when
            the P-bit, has changed.

        14. Corrected the cycles used calculation for the INPUT-BITS
            instruction.

        15. Corrected some minor cases where the used_udvm_cycles was not
            incremented.

            [Not really a problem, but it allowed us to verify correctness with
            some of the SigComp torture tests.]

        16. Removed some redundant code in INPUT-HUFFMAN (and reorganised some
            comments to keep them making sense).


    Function decomp_dispatch_get_bits:

        1. This has been rewritten. The original version could not correctly
           handle requests for more than 8 bits. The new version is cleaner and
           correctly handles all cases.

svn path=/trunk/; revision=14666
2005-06-16 21:15:12 +00:00
Anders Broman 9247acd7f5 Bugfixes
svn path=/trunk/; revision=12613
2004-11-28 19:39:19 +00:00
Anders Broman cddc8624c3 Somethimes its difficult to get it right *sigh
svn path=/trunk/; revision=12600
2004-11-24 21:55:30 +00:00
Jörg Mayer 8d5348b250 The code didn't even compile: removed a superfluous (
svn path=/trunk/; revision=12598
2004-11-24 16:37:38 +00:00
Jörg Mayer 751aacb3b1 Set svn properties - without them, compilation with gcc would fail on Unix
svn path=/trunk/; revision=12597
2004-11-24 16:30:52 +00:00
Anders Broman 88a0557aea Fix a faulty IF statement, deflate should work now.
svn path=/trunk/; revision=12596
2004-11-24 13:53:27 +00:00
Anders Broman 91c42c8655 Don't free string that don't need it. Added filter possibillity on Partial state
svn path=/trunk/; revision=12582
2004-11-23 22:02:00 +00:00
Anders Broman 214d684823 Fix some memmory leaks
svn path=/trunk/; revision=12579
2004-11-22 22:18:18 +00:00
Anders Broman ca2b359041 Implemented state-create, handling of g_hash_table at redesection needs more work.
svn path=/trunk/; revision=12531
2004-11-16 22:15:14 +00:00
Anders Broman 38ed258bc5 Fix (hopefully) a compiler varning
svn path=/trunk/; revision=12268
2004-10-11 21:19:12 +00:00
Guy Harris bb6dfa0232 Use "%%" in format strings if you want to print a %.
Get rid of an extra argument to a format string.

svn path=/trunk/; revision=12240
2004-10-08 16:56:16 +00:00
Anders Broman 136da6ad35 Add sigcomp Universal Decompressor Virtual Machine (UDVM) and state handler, for decompression of
sigcomp messages. Currently states are or not saved so only messages with bytecode can be decompressed.

svn path=/trunk/; revision=12236
2004-10-08 15:54:06 +00:00