aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
Commit message (Collapse)AuthorAge
* Command-line option to dump SHA1 digests of all source files.Nick Mathewson2009-04-29
| | | | | | | | | Now, when you call tor --digests, it dumps the SHA1 digest of each source file that Tor was built with. We support both 'sha1sum' and 'openssl sha1'. If the user is building from a tarball and they haven't edited anything, they don't need any program that calculates SHA1. If they _have_ modified a file but they don't have a program to calculate SHA1, we try to build so we do not output digests.
* Actually use tor_sscanf() to parse untrusted input.Nick Mathewson2009-03-03
| | | | svn:r18761
* Add a simple locale-independent no-surprises sscanf replacement.Nick Mathewson2009-03-03
| | | | | | | | | | tor_sscanf() only handles %u and %s for now, which will make it adequate to replace sscanf() for date/time/IP parsing. We want this to prevent attackers from constructing weirdly formed descriptors, cells, addresses, HTTP responses, etc, that validate under some locales but not others. svn:r18760
* Support 64-bit time_t. Patch from Matthias Drochner. Partial backport ↵Nick Mathewson2009-01-22
| | | | | | candidate. svn:r18234
* Add a better (non-locale-having) ctypes implementation to avoid protocol and ↵Nick Mathewson2009-01-20
| | | | | | parsing mismatches on different platforms. svn:r18189
* OpenBSD malloc.h believes that you should be able to detect headers with ↵Nick Mathewson2009-01-04
| | | | | | autoconf, or build without warnings, but not both. So never include malloc.h on OpenBSD. Backport candidate. svn:r17891
* Remove svn $Id$s from our source, and remove tor --version --version.Nick Mathewson2009-01-04
| | | | | | | | The subversion $Id$ fields made every commit force a rebuild of whatever file got committed. They were not actually useful for telling the version of Tor files in the wild. svn:r17867
* Document most undocumented variables.Nick Mathewson2008-12-23
| | | | svn:r17754
* Make freelist_len in memarea.c static; document a few variables.Nick Mathewson2008-12-22
| | | | svn:r17741
* Add DOCDOC entries for undocumented static and global variables.Nick Mathewson2008-12-22
| | | | svn:r17739
* Fix most DOCDOCs remaining and/or added by redox.Nick Mathewson2008-12-22
| | | | svn:r17734
* Add DOCDOC comments for all undocumented functions. Add missing *s to other ↵Nick Mathewson2008-12-22
| | | | | | comments so that they will get recognized as doxygen. svn:r17729
* Fix all of the doxygen warnings not pertaining to missing documentation.Nick Mathewson2008-12-22
| | | | svn:r17727
* Expose hex_decode_digit from util.cNick Mathewson2008-12-19
| | | | svn:r17706
* Replace calls to time(NULL) that occur on the order of once per read, one ↵Nick Mathewson2008-12-18
| | | | | | per write, or once per cell with calls to a function that looks at a cached value of time. This is tricksy to benchmark, since it will only help on systems where time() is a syscall and syscalls are relatively slow. svn:r17690
* Downlgrade tweak, and answer lots of XXX021s. No actual code fixes in this ↵Nick Mathewson2008-12-18
| | | | | | patch. svn:r17686
* Log an error on win32 if directory listing fails.Nick Mathewson2008-12-18
| | | | svn:r17684
* Do not use O_APPEND on fd-based operations that do not really want it; have ↵Nick Mathewson2008-12-02
| | | | | | them just lseek instead. svn:r17460
* make read_all and write_all return ssize_t.Nick Mathewson2008-11-05
| | | | svn:r17194
* Fix freebsd 7 compile by adding malloc_np.h header. Fix bug 850.Nick Mathewson2008-11-05
| | | | svn:r17190
* Add a new memcmpstart to use instead of strcmpstart when the thing we are ↵Nick Mathewson2008-11-03
| | | | | | comparing is not nul-terminated. svn:r17187
* Document some dmalloc stuff and some stupid C tricks.Nick Mathewson2008-10-27
| | | | svn:r17161
* This patch changes some of the code in util.c to refactor calls toJacob Appelbaum2008-10-26
| | | | | | | | | | dmalloc_malloc, dmalloc_realloc and dmalloc_strdup. It only calls those functions if we're using the magic USE_DMALLOC macro. If we're not doing that, we call the normal malloc, realloc and strdup. This is my first night at malloc disambiguation club, so I had to disambiguate. Also, first commit, I have my commit bit now. Huzzzah!!! svn:r17157
* remove a code path that should never happen (and if it did, we'd beRoger Dingledine2008-08-29
| | | | | | | complaining about an errno set from some arbitrary previous problem). svn:r16684
* r17358@pc-10-8-1-079: nickm | 2008-07-25 16:41:03 +0200Nick Mathewson2008-07-25
| | | | | | | Split out the address manipulation functions from compat and util: they were about 21% of the total of those, and spread out too much. svn:r16208
* r17346@aud-055: nickm | 2008-07-24 15:37:19 +0200Nick Mathewson2008-07-24
| | | | | | | Make generic address manipulation functions work better. Switch address policy code to use tor_addr_t, so it can handle IPv6. That is a good place to start. svn:r16178
* r16689@tombo: nickm | 2008-07-03 11:03:14 -0400Nick Mathewson2008-07-03
| | | | | | | Fix for bug 742: do not use O_CREAT on 2-option version of open(). Especially do not use it on /dev/null. Fix from Michael Scherer. Bugfix on 0.0.2pre19 (wow). svn:r15626
* r16127@tombo: nickm | 2008-06-10 14:03:01 -0400Nick Mathewson2008-06-10
| | | | | | | Improved code for counting clients by country: support recording by number of directory status requests in addition to number of IPs seen. svn:r15097
* New code to implement proposal for local geoip stats. Only enabled with ↵Nick Mathewson2008-05-29
| | | | | | --enable-geoip-stats passed to configure. svn:r14802
* r19795@catbus: nickm | 2008-05-16 14:54:24 -0400Nick Mathewson2008-05-16
| | | | | | | Rename tor_addr_t manipulation functions for a consistent style. svn:r14639
* r15120@tombo: nickm | 2008-04-08 18:01:58 -0400Nick Mathewson2008-04-08
| | | | | | | Add very short 0.2.1.x list based on discussion from arma. needs fleshing out and merging with other lists. svn:r14324
* r18929@catbus: nickm | 2008-03-18 12:08:16 -0400Nick Mathewson2008-03-18
| | | | | | | Detect errors from directory listing correctly on win32. Bug found by lodger. svn:r14102
* r18890@catbus: nickm | 2008-03-17 13:19:29 -0400Nick Mathewson2008-03-17
| | | | | | | Clarify documentation for file_status a little svn:r14079
* r18878@catbus: nickm | 2008-03-17 00:11:02 -0400Nick Mathewson2008-03-17
| | | | | | | Clean up an overwide line. svn:r14072
* I wonder what the DISGARD service isPeter Palfrader2008-03-13
| | | | svn:r13999
* be a little bit more helpful than "Error reading directory."Roger Dingledine2008-02-28
| | | | | | | make a note to try to be more helpful still. svn:r13776
* r14374@tombo: nickm | 2008-02-21 16:57:39 -0500Nick Mathewson2008-02-21
| | | | | | | Fix all remaining shorten-64-to-32 errors in src/common. Some were genuine problems. Many were compatibility errors with libraries (openssl, zlib) that like predate size_t. Partial backport candidate. svn:r13665
* r14373@tombo: nickm | 2008-02-21 16:29:18 -0500Nick Mathewson2008-02-21
| | | | | | | Apply warnings about implicit 64-to-32 conversions; some from Sebastian Hahn; some not. svn:r13664
* r18336@catbus: nickm | 2008-02-21 09:33:15 -0500Nick Mathewson2008-02-21
| | | | | | | Patch from Sebastian Hahn: remove obsolete timeval manipulation functions. svn:r13653
* r14185@tombo: nickm | 2008-02-15 18:05:54 -0500Nick Mathewson2008-02-15
| | | | | | | Replace the hefty tor_strpartition with a simple function to replace its only (trivial) use. svn:r13532
* doxygen and other cleanupsRoger Dingledine2008-02-09
| | | | svn:r13440
* r17967@catbus: nickm | 2008-02-07 11:44:51 -0500Nick Mathewson2008-02-08
| | | | | | | Fix some warnings identified by building with -D_FORTIFY_SOURCE=2. Remove a redundant (and nuts) definition of _FORTIFY_SOURCE from eventdns.c. svn:r13424
* Update some copyright notices: it is now 2008.Nick Mathewson2008-02-07
| | | | svn:r13412
* r17947@catbus: nickm | 2008-02-06 11:57:53 -0500Nick Mathewson2008-02-06
| | | | | | | Fix a bunch of DOCDOC items; document the --quiet flag; refactor a couple of XXXX020 items. svn:r13405
* r17903@catbus: nickm | 2008-02-05 14:40:03 -0500Nick Mathewson2008-02-05
| | | | | | | Remove some dead code; fix some XXX020s; turn some XXX020s into XXXX_IP6s (i.e., "needs to be fixed when we add ipv6 support"). svn:r13382
* r13971@tombo: nickm | 2008-01-30 14:25:25 -0500Nick Mathewson2008-01-30
| | | | | | | Write a new autoconf macro to test whether a function is declared. It is suboptimal and possibly buggy in some way, but it seems to work for me. use it to test for a declaration of malloc_good_size, so we can workaround operating systems (like older OSX) that have the function in their libc but do not deign to declare it in their headers. Should resolve bug 587. svn:r13339
* r17624@catbus: nickm | 2008-01-15 00:42:01 -0500Nick Mathewson2008-01-15
| | | | | | | Fixes to more anonymously-reported typos and logic errors. svn:r13136
* <tup> tor segfaults when reading a config value that contains a malformedRoger Dingledine2008-01-09
| | | | | | | escape sequence; this patch fixes it svn:r13086
* r17472@catbus: nickm | 2008-01-05 22:10:19 -0500Nick Mathewson2008-01-06
| | | | | | | Another test for the increasingly bad check-spaces style checker to check: #else\n#if is almost a sure sign of a failure to use #elif. Fortunately, we only did that 3 times. svn:r13039
* r17467@catbus: nickm | 2008-01-05 19:54:20 -0500Nick Mathewson2008-01-06
| | | | | | | fix whitespace svn:r13035