summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2010-09-14Add a simple integer-ceiling-division macro before we get it wrongNick Mathewson
2010-09-06Merge remote branch 'public/win_unicode_fixes'Nick Mathewson
2010-08-31Fix some issues in rate-limiting noticed by SebastianNick Mathewson
2010-08-20Make the windows build succeed with or without -DUNICODE enabled.Nick Mathewson
This should keep WinCE working (unicode always-on) and get Win98 working again (unicode never-on). There are two places where we explicitly use ASCII-only APIs, still: in ntmain.c and in the unit tests. This patch also fixes a bug in windoes tor_listdir that would cause the first file to be listed an arbitrary number of times that was also introduced with WinCE support. Should fix bug 1797.
2010-08-18Add a generic rate-limited log mechanism, and use it in a few placesNick Mathewson
Incidentally fixes bug 1042.
2010-08-03Merge commit 'sebastian/mlockall'Nick Mathewson
2010-07-27whitespace fixSebastian Hahn
2010-07-26Fix compilation with mingw and OpenSSL 0.9.8m+mingw-san
2010-07-26Make sure we don't warn for libevent versions like 1.4.14b-stableSebastian Hahn
2010-07-09Rename log.h to torlog.hNick Mathewson
This should make us conflict less with system files named "log.h". Yes, we shouldn't have been conflicting with those anyway, but some people's compilers act very oddly. The actual change was done with one "git mv", by editing Makefile.am, and running find . -name '*.[ch]' | xargs perl -i -pe 'if (/^#include.*\Wlog.h/) {s/log.h/torlog.h/; }'
2010-06-29Merge remote branch 'public/rand_double2'Nick Mathewson
2010-06-25Make cbt_generate_sample use crypto_rand_double()Nick Mathewson
Possible workaround for bug 1139, if anybody cares.
2010-06-25Merge branch 'bug1526-v2'Nick Mathewson
2010-06-25Fix a compile error when building with Libevent before 1.4.5-stableNick Mathewson
Older versions of Libevent forgot to declare enough function arguments constant.
2010-06-25Use Libevent 2.0's periodic timers where available.Nick Mathewson
These timers behave better with non-monotonic clocks than our old ones, and also try harder to make once-per-second events get called one second apart, rather than one-plus-epsilon seconds apart. This fixes bug 943 for everybody using Libevent 2.0 or later.
2010-06-22Fix zlib macro brokenness on osx with zlib 1.2.4 and higher.Nick Mathewson
From the code: zlib 1.2.4 and 1.2.5 do some "clever" things with macros. Instead of saying "(defined(FOO) ? FOO : 0)" they like to say "FOO-0", on the theory that nobody will care if the compile outputs a no-such-identifier warning. Sorry, but we like -Werror over here, so I guess we need to define these. I hope that zlib 1.2.6 doesn't break these too. Possible fix for bug 1526.
2010-06-22Log an error if openssl fails to copy a key for usNick Mathewson
This should never happen unless openssl is buggy or some of our assumptions are deeply wrong, but one of those might have been the cause of the not-yet-reproducible bug 1209. If it ever happens again, let's get some info we can use.
2010-06-22Add a function to return a double in range [0,1).Nick Mathewson
2010-06-14Save a couple characters' allocation in esc_for_logFlorian Zumbiehl
2010-06-07Reinstate warning when HOME isn't set.Nick Mathewson
Having ~/.tor expand into /.tor is, after all, almost certainly not what the user wanted, and it deserves a warning message. Also, convert a guess-and-malloc-and-sprintf triple into an asprintf.
2010-06-07Treat unset $HOME like empty $HOMESebastian Hahn
This means Tor no longer dies when it doesn't have a $HOME.
2010-05-24Make pointer types correct in WinCE patchNick Mathewson
2010-05-24moved wince related includes and defs to compat.h where possible, removed ↵valerino
unused/redundant wince includes
2010-05-24Port Tor to work on Windows CEvalerino
Most of the changes here are switches to use APIs available on Windows CE. The most pervasive change is that Windows CE only provides the wide-character ("FooW") variants of most of the windows function, and doesn't support the older ASCII verions at all. This patch will require use of the wcecompat library to get working versions of the posix-style fd-based file IO functions. [commit message by nickm]
2010-04-20Demote a warning about missing client ciphersSebastian Hahn
2010-04-20minor cleanupsRoger Dingledine
2010-04-19Fix a compilation warning on compat_libevent.c on some versions of windows ↵Nick Mathewson
libevent
2010-04-19Fix two compile-blockers in tor_vasprintf().Nick Mathewson
1) mingw doesn't have _vscprintf(); mingw instead has a working snprintf. 2) windows compilers that _do_ have a working _vscprintf spell it so; they do not spell it _vcsprintf().
2010-04-15Merge commit 'origin/maint-0.2.1'Nick Mathewson
2010-04-13Fix renegotiation on OpenSSL versions that backport RFC5746.Nick Mathewson
Our code assumed that any version of OpenSSL before 0.9.8l could not possibly require SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION. This is so... except that many vendors have backported the flag from later versions of openssl when they backported the RFC5476 renegotiation feature. The new behavior is particularly annoying to detect. Previously, leaving SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION unset meant that clients would fail to renegotiate. People noticed that one fast! Now, OpenSSL's RFC5476 support means that clients will happily talk to any servers there are, but servers won't accept renegotiation requests from unpatched clients unless SSL_OP_ALLOW_etc is set. More fun: servers send back a "no renegotiation for you!" error, which unpatched clients respond to by stalling, and generally producing no useful error message. This might not be _the_ cause of bug 1346, but it is quite likely _a_ cause for bug 1346.
2010-04-02Merge branch 'asprintf'Nick Mathewson
2010-03-05commit my annotations while i was hunting down the host order bugRoger Dingledine
2010-02-28better handle the case where *strp is in asprintf argsNick Mathewson
2010-02-28Remove the request for current memlock limitsSebastian Hahn
The getrlimit call didn't have any effect. Also make some logging less verbose on default log level, and refactor a bit.
2010-02-27Update copyright dates for files not in maint-0.2.1Nick Mathewson
2010-02-27Merge remote branch 'origin/maint-0.2.1'Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2010-02-27Update Tor Project copyright yearsNick Mathewson
2010-02-26Zero a cipher completely before freeing itSebastian Hahn
We used to only zero the first ptrsize bytes of the cipher. Since cipher is large enough, we didn't zero too many bytes. Discovered and fixed by ekir. Fixes bug 1254.
2010-02-25Add the MIN and MAX macros for platforms that lack themNick Mathewson
2010-02-25Fix 64-bit printf issues in consensus-bw-weights5-merge.Nick Mathewson
For my 64-bit Linux system running with GCC 4.4.3-fc12-whatever, you can't do 'printf("%lld", (int64_t)x);' Instead you need to tell the compiler 'printf("%lld", (long long int)x);' or else it doesn't believe the types match. This is why we added U64_PRINTF_ARG; it looks like we needed an I64_PRINTF_ARG too.
2010-02-25Add a tor_asprintf() function, and use it in a couple of places.Nick Mathewson
asprintf() is a GNU extension that some BSDs have picked up: it does a printf into a newly allocated chunk of RAM. Our tor_asprintf() differs from standard asprintf() in that: - Like our other malloc functions, it asserts on OOM. - It works on windows. - It always sets its return-field.
2010-02-22Remove misc unnecessary newlines found by new check.Mike Perry
2010-02-22Add %lld compat defines.Mike Perry
2010-02-22Merge remote branch 'sebastian/bug1254'Nick Mathewson
2010-02-22Make expand_filename into a tor_strdup() alias on windows.Nick Mathewson
On Windows, we don't have a notion of ~ meaning "our homedir", so we were deliberately using an #ifdef to avoid calling expand_filename() in multiple places. This is silly: The right place to turn a function into a no-op on a single platform is in the function itself, not in every single call-site.
2010-02-22Zero a cipher completely before freeing itSebastian Hahn
We used to only zero the first ptrsize bytes of the cipher. Since cipher is large enough, we didn't zero too many bytes. Discovered and fixed by ekir. Fixes bug 1254.
2010-02-21fix typo and garbage grammarRoger Dingledine
2010-02-19Merge remote branch 'sebastian/bug1143'Nick Mathewson
2010-02-19Make the DNSPort option work with libevent 2.xSebastian Hahn
We need to use evdns_add_server_port_with_base() when configuring our DNS listener, because libevent segfaults otherwise. Add a macro in compat_libevent.h to pick the correct implementation depending on the libevent version. Fixes bug 1143, found by SwissTorExit
2010-02-18Merge remote branch 'origin/maint-0.2.1'Nick Mathewson
Conflicts: ChangeLog configure.in contrib/tor-mingw.nsi.in src/win32/orconfig.h