Commit Graph

1420 Commits

Author SHA1 Message Date
Nick Mathewson
42172829ce r16016@catbus: nickm | 2007-10-21 20:44:19 -0400
Check a platform assumption we have made without checking for too long: "Characters are represented in ascii."


svn:r12088
2007-10-22 00:44:42 +00:00
Nick Mathewson
722c7bdff4 r15997@catbus: nickm | 2007-10-21 20:25:40 -0400
New code (disabled for now) to use the SSL context's cert store instead of using its "extra chain cert" list to get our identity certificate sent.  This is a little close to what OpenSSL expects people to do, and it has the advantage that we should be able to keep the id cert from being sent by setting the NO_CHAIN_CERT bit.  I have tried turning new code on, and it seemed to work fine.


svn:r12086
2007-10-22 00:26:02 +00:00
Nick Mathewson
9f93d48697 r15989@catbus: nickm | 2007-10-20 19:48:29 -0400
Fix implementation of sdmap_size and rimap_size() and eimap_size().  Nobody was using them, so no backport needed.


svn:r12068
2007-10-20 23:48:35 +00:00
Nick Mathewson
b0a18d1bfa r15967@catbus: nickm | 2007-10-19 14:14:47 -0400
Change meaning of "freefn" argument to smartlist_uniq so that we can remove duplicates from a list without freeing them.


svn:r12053
2007-10-19 18:56:28 +00:00
Nick Mathewson
e3113502ad r15882@catbus: nickm | 2007-10-17 15:23:05 -0400
oprofile was telling me that a fair bit of our time in openssl was spent in base64_decode, so replace base64_decode with an all-at-once fairly optimized implementation.  For decoding keys and digests, it seems 3-3.5x faster than calling out to openssl.  (Yes, I wrote it from scratch.)


svn:r12002
2007-10-17 19:23:56 +00:00
Nick Mathewson
2e131e31b5 r15861@catbus: nickm | 2007-10-16 13:10:22 -0400
Fix example use of hash table iterators


svn:r11991
2007-10-16 17:21:05 +00:00
Nick Mathewson
7f9e9c816c r15790@catbus: nickm | 2007-10-15 11:38:28 -0400
Fix bug 528: fix memory leak in base32_decode().  While there, also make base32_decode() accept upper-case inputs.


svn:r11946
2007-10-15 15:38:44 +00:00
Nick Mathewson
3de8158b16 r15702@catbus: nickm | 2007-10-11 17:29:20 -0400
Remove a bunch of redundant includes in crypto.c


svn:r11885
2007-10-11 21:40:32 +00:00
Roger Dingledine
bab60e5ade bugfix on r11301:
Fix a minor memory leak whenever we wrote out a file. Bugfix on
0.2.0.7-alpha.


svn:r11863
2007-10-11 03:10:52 +00:00
Roger Dingledine
900ddcb8fd bugfix on r11298:
Fix a minor memory leak whenever we parse guards from our state
file. Bugfix on 0.2.0.7-alpha.


svn:r11862
2007-10-11 02:03:53 +00:00
Nick Mathewson
6f7847b378 r15530@catbus: nickm | 2007-10-04 12:16:27 -0400
Add a bunch of function documentation; clean up a little code; fix some XXXXs; tag the nonsensical EXTRAINFO_PURPOSE_GENERAL as nonsesnse; note another bit of "do not cache special routers" code to nuke.


svn:r11761
2007-10-04 16:21:58 +00:00
Nick Mathewson
8439c4ec2f r15512@catbus: nickm | 2007-10-02 16:27:43 -0400
Make some functions static; remove some dead code.


svn:r11750
2007-10-02 20:35:23 +00:00
Nick Mathewson
38ac9f6005 r14682@Kushana: nickm | 2007-09-28 15:23:38 -0400
From little acorns: redo our string and digest hashing code to be faster, since this stuff may be critical-path.


svn:r11700
2007-09-28 19:23:54 +00:00
Nick Mathewson
fc5dd0cdbb r15231@catbus: nickm | 2007-09-20 16:04:30 -0400
Patch from karsten: remove cbc and make unit tests handle aes-ctr-with-iv.


svn:r11538
2007-09-20 20:08:47 +00:00
Nick Mathewson
f0634bb7ca r14532@Kushana: nickm | 2007-09-20 13:25:38 -0400
Clean up some macros in aes.c


svn:r11537
2007-09-20 17:28:07 +00:00
Nick Mathewson
262d5ab0a8 r15210@catbus: nickm | 2007-09-20 13:04:05 -0400
Re-optimize counter-mode: save about 15% on my core2 by (1) not regenerating the entire counter buffer every time we encrypt a block of keystream (2) using the platform-optimized htonl to convert to big-endian (It's a single instruction on 486 and later ) and (3) not even keeping a separate "counter" and "buffer" when the platform is big-endian. The third still needs testing.


svn:r11536
2007-09-20 17:07:45 +00:00
Roger Dingledine
d4e950ccc8 poke at svn until it compiles. nick, you should decide if this
is what you meant to do.


svn:r11529
2007-09-20 03:06:45 +00:00
Nick Mathewson
5f7950e874 r15172@catbus: nickm | 2007-09-19 11:50:02 -0400
New (untested) code to implement AES-with-IV.  Currently, IVs are generated randomly.  Once tested, should be (almost) a drop-in replacement for the CBC functions.


svn:r11519
2007-09-19 15:53:41 +00:00
Nick Mathewson
7e93139a85 r15171@catbus: nickm | 2007-09-19 11:44:54 -0400
Switch our AES implementation from "128 bit counter with to 64 bits set to 0" to a proper implementation of counter mode.  Also, add an aes_set_iv function to initialize the counter to a nonzero value.


svn:r11518
2007-09-19 15:53:38 +00:00
Roger Dingledine
1a930cfc70 minor style tweaks
svn:r11490
2007-09-18 17:18:14 +00:00
Roger Dingledine
f15a4c8bd7 add some crypto/util functions from karsten, as the first
step of integrating his new hidden service stuff


svn:r11489
2007-09-18 17:07:56 +00:00
Nick Mathewson
8c13967803 r14448@Kushana: nickm | 2007-09-17 14:26:56 -0400
Unify all of the divergent median/nth-percentile code in container.[ch]


svn:r11457
2007-09-17 18:27:49 +00:00
Nick Mathewson
565f5f32c5 r14363@Kushana: nickm | 2007-09-08 16:25:45 -0400
Another round of whitespeace fixes.


svn:r11407
2007-09-08 20:25:57 +00:00
Nick Mathewson
509bc3b4a0 r14359@Kushana: nickm | 2007-09-08 15:07:17 -0400
Add some generic skew-and-tolerance functions so we can handle time more sanely.


svn:r11406
2007-09-08 19:08:46 +00:00
Nick Mathewson
c341bc090e r14869@catbus: nickm | 2007-08-31 08:49:26 -0400
Fix a segfault in expand_filename("~").  Found by lindi.


svn:r11332
2007-08-31 12:51:52 +00:00
Nick Mathewson
f189ecbf20 r14832@catbus: nickm | 2007-08-29 15:00:27 -0400
Use (and debug) new file-writing functions in order to simplify code that formerly built big strings in RAM.


svn:r11301
2007-08-29 19:02:43 +00:00
Nick Mathewson
8408122222 r14831@catbus: nickm | 2007-08-29 14:17:42 -0400
Refactor write_chunks_to_file_impl: break out the "pick a temporary name if it makes sense, and open the right filename" logic and the "close the file and unlink or rename if necessary" logic.  This will let us write big files in a smarter way than "Build a big string" or "make a list of chunks", once we get around to using it.


svn:r11300
2007-08-29 19:02:37 +00:00
Nick Mathewson
d3224bad42 r14227@Kushana: nickm | 2007-08-27 11:33:28 -0400
Add a new ClientDNSRejectInternalAddresses option (default: on) to refuse to believe that any address can map to or from an internal address.  This blocks some kinds of potential browser-based attacks, especially on hosts using DNSPort.  Also clarify behavior in some comments.  Backport candiate?


svn:r11287
2007-08-27 15:33:58 +00:00
Roger Dingledine
05f12bffe9 Handle unexpected whitespace better in malformed descriptors. Bug
found using Benedikt Boss's new Tor fuzzer! Bugfix on 0.2.0.x.


svn:r11229
2007-08-20 20:05:56 +00:00
Nick Mathewson
a237f25f9a r14651@catbus: nickm | 2007-08-17 21:37:03 -0400
Another attempt to confirm to msvc for bug 482.


svn:r11162
2007-08-18 01:38:11 +00:00
Peter Palfrader
0713606469 redefine BITARRAY_MASK as a function of BITARRAY_SHIFT
svn:r11160
2007-08-17 22:43:00 +00:00
Nick Mathewson
1f244d3943 r14639@catbus: nickm | 2007-08-17 17:45:28 -0400
Compile without warnings on MinGW, even with --enable-gcc-warnings enabled.


svn:r11157
2007-08-17 21:46:34 +00:00
Nick Mathewson
f8b3927e07 r14634@catbus: nickm | 2007-08-17 16:43:49 -0400
Try to fix bug 482: do not rely on s6_addr16 or s6_addr32 on MSVC.  How ugly.


svn:r11155
2007-08-17 20:44:54 +00:00
Nick Mathewson
181ba71a90 r14051@Kushana: nickm | 2007-08-15 15:55:36 -0400
Fix an XXXX020 and a few DOCDOCs.


svn:r11127
2007-08-15 19:56:01 +00:00
Nick Mathewson
3fc04529d4 r14093@catbus: nickm | 2007-08-08 01:49:54 -0400
Include fewer redundant headers; use the compiler search paths better.


svn:r11060
2007-08-08 05:50:31 +00:00
Nick Mathewson
50f5f63678 r14091@catbus: nickm | 2007-08-08 01:13:17 -0400
Fix an annoying warning on OpenBSD: only include malloc.h if we are using it.


svn:r11059
2007-08-08 05:14:03 +00:00
Nick Mathewson
652d4e0248 r13926@Kushana: nickm | 2007-08-03 00:55:23 -0700
Fix compilation with HAVE_GETADDRINFO unset


svn:r11042
2007-08-03 07:57:31 +00:00
Nick Mathewson
ba28346f2f r13907@Kushana: nickm | 2007-08-02 10:29:13 -0700
Try (once again) to fix mingw build wrt detecting ipv6 types.


svn:r11037
2007-08-02 17:30:42 +00:00
Nick Mathewson
d5c78593d2 r13873@Kushana: nickm | 2007-07-31 10:54:05 -0700
Split over-optimized digestmap_set code into a generic part and a digestmap-specific part.


svn:r11012
2007-08-01 15:57:48 +00:00
Nick Mathewson
484c8b776d r13872@Kushana: nickm | 2007-07-31 08:27:54 -0700
Rename IN4_ADDR and IN6_ADDR to try to avoid conflicting with Windows definitions.  This may fix the windows build.


svn:r11011
2007-08-01 15:57:34 +00:00
Nick Mathewson
2872a43386 r13871@Kushana: nickm | 2007-07-31 08:10:58 -0700
Fix warning aobut unused parameter on platforms without mallinfo.


svn:r11010
2007-08-01 15:57:07 +00:00
Nick Mathewson
45c82b1d85 r14024@catbus: nickm | 2007-07-30 14:13:58 -0400
Glibc (and maybe others) define a mallinfo() that can be used to see how the platform malloc is acting inside.  When we have it, dump its output on dumpmemusage().


svn:r10996
2007-07-30 18:14:14 +00:00
Nick Mathewson
23a345b3c2 r14015@catbus: nickm | 2007-07-30 13:18:05 -0400
Add missing code documentation in src/common


svn:r10991
2007-07-30 17:46:12 +00:00
Nick Mathewson
759ed3ce3f r13988@catbus: nickm | 2007-07-29 16:32:36 -0400
Cheesy attempt to break some censorware.  Not a long-term fix, but it will be intersting to watch the epidemiology of the workarounds as the censors apply them.


svn:r10975
2007-07-29 23:11:42 +00:00
Nick Mathewson
25bd4204d0 r13964@catbus: nickm | 2007-07-28 22:55:10 -0400
Change "IN_ADDR" macro to "IN4_ADDR" in an attempt to fix mingw compilation


svn:r10963
2007-07-29 02:55:24 +00:00
Nick Mathewson
a5477c7bb9 r13944@catbus: nickm | 2007-07-27 15:52:35 -0400
Fix warnings on platforms where rlim values can be signed.
 Add an 8k buffer freelist.
 


svn:r10948
2007-07-27 19:53:29 +00:00
Nick Mathewson
35561a542c r13934@catbus: nickm | 2007-07-27 10:41:00 -0400
Fix spelling; add a comment.


svn:r10943
2007-07-27 14:41:08 +00:00
Peter Palfrader
49db52abe6 Maybe fix #471. Compute the size of bitfields more correctly. Nick, please check.
svn:r10941
2007-07-27 04:45:42 +00:00
Nick Mathewson
b1c873182d r13926@catbus: nickm | 2007-07-26 17:21:06 -0400
Add a bit-array type with reasonably fast inline functions.


svn:r10938
2007-07-26 21:26:53 +00:00
Nick Mathewson
189bc7cf9f r13920@catbus: nickm | 2007-07-26 16:25:25 -0400
whitespace fixes


svn:r10935
2007-07-26 20:26:53 +00:00
Nick Mathewson
701fce8e5c r13858@catbus: nickm | 2007-07-22 18:44:02 -0400
Fix/note some relatively trivial mem usage issues


svn:r10905
2007-07-22 22:49:49 +00:00
Nick Mathewson
8e50aa7341 r13856@catbus: nickm | 2007-07-20 14:30:44 -0400
slightly smarter heuristic about when to use obsolete ::a.b.c.d format.


svn:r10893
2007-07-20 18:30:47 +00:00
Nick Mathewson
8ba42a3bde r13850@catbus: nickm | 2007-07-20 12:25:24 -0400
Fix some bugs in ntop/pton.


svn:r10891
2007-07-20 16:25:27 +00:00
Nick Mathewson
6223160ab7 r13848@catbus: nickm | 2007-07-19 16:47:16 -0400
Use our own version of inet_ntop and inet_pton everywhere, to avoid partitioning attacks.


svn:r10888
2007-07-19 20:47:18 +00:00
Nick Mathewson
a1f4644a94 r13840@catbus: nickm | 2007-07-19 16:00:43 -0400
Apparently, this problem can occur on the whole BSD family. "Yay."


svn:r10884
2007-07-19 20:00:45 +00:00
Nick Mathewson
b2772f93cb r13838@catbus: nickm | 2007-07-19 15:50:16 -0400
Apparently, OSX does not define s6_addr32 or s6_addr16. How silly.


svn:r10883
2007-07-19 19:50:20 +00:00
Nick Mathewson
679b55eb1f r13836@catbus: nickm | 2007-07-19 15:43:04 -0400
Some older GCCs think that iph4 could be used uninitialized. Fix that.


svn:r10882
2007-07-19 19:43:08 +00:00
Nick Mathewson
4a240552c4 r13834@catbus: nickm | 2007-07-19 15:40:42 -0400
Another patch from croup: drop support for address masks that do not correspond to bit prefixes.  Nobody has used this for a while, and we have given warnings for a long time.


svn:r10881
2007-07-19 19:40:45 +00:00
Nick Mathewson
bbbf504281 r13827@catbus: nickm | 2007-07-19 14:42:25 -0400
Merge in some generic address manipulation code from croup.  Needs some work.


svn:r10880
2007-07-19 18:46:09 +00:00
Nick Mathewson
ad45ddfb07 r13788@catbus: nickm | 2007-07-16 14:26:25 -0400
Patch from croup: rewrite the logic of get_next_token() to do the right thing with input that ends at weird places, or aligns with block boundaries after mmap.  should fix bug 455.  Needs fuzzing.


svn:r10847
2007-07-16 18:26:31 +00:00
Roger Dingledine
6d2cb32d10 free some more memory on exit
svn:r10837
2007-07-16 04:33:47 +00:00
Nick Mathewson
7e20fdbefb r13687@catbus: nickm | 2007-07-10 16:08:14 -0400
Possible partial fix for bug 455: use eos logic everywhere.


svn:r10786
2007-07-10 20:08:18 +00:00
Nick Mathewson
73b4428a8b r13631@catbus: nickm | 2007-07-06 10:17:22 -0400
Try to fix win32 build again.


svn:r10750
2007-07-06 14:17:30 +00:00
Nick Mathewson
bbc7cf86d5 r13600@Kushana: nickm | 2007-07-05 23:49:47 -0400
try to fix mingw compile


svn:r10743
2007-07-06 03:49:57 +00:00
Nick Mathewson
a9469098ca r13596@kushana: nickm | 2007-07-05 10:53:22 -0400
Argh, re-enable CRITICAL_SECTION code in win32.


svn:r10741
2007-07-05 14:53:27 +00:00
Nick Mathewson
5c9c420111 svn:r10740 2007-07-05 14:51:10 +00:00
Nick Mathewson
ae4ab0f617 r13454@kushana: nickm | 2007-06-20 14:22:44 -0400
Switch windows locking implementation to CRITICAL_SECTION, not Mutex: Mutex is heavier-weight, and meant for multi-process situations.


svn:r10739
2007-07-05 14:51:01 +00:00
Peter Palfrader
f274c1413e Make it build with -O0 as well
svn:r10722
2007-07-02 17:50:57 +00:00
Peter Palfrader
adff891463 Make DEBUG_SMARTLIST work
svn:r10721
2007-07-02 17:48:56 +00:00
Nick Mathewson
1bdcfd9203 r13570@catbus: nickm | 2007-06-30 20:41:05 -0400
Implement conditions in compat.c; switch windows to use "critical sections" instead of mutexes.  Apparently, mutexes are for IPC and critical sections are for multithreaded.


svn:r10716
2007-07-01 16:22:45 +00:00
Nick Mathewson
5adfa09fce r13477@catbus: nickm | 2007-06-17 14:22:03 -0400
Sun CC likes to give warnings for the do { } while(0) construction for making statement-like macros.  Define STMT_BEGIN/STMT_END macros that do the right thing, and use them everywhere.


svn:r10645
2007-06-17 18:22:39 +00:00
Nick Mathewson
93f32db438 r13476@catbus: nickm | 2007-06-17 14:04:41 -0400
Build with fewer compiler warnings on Sun.  (This and previous Sun patches are thanks to the tremendously handy services of unix-center.net.)


svn:r10644
2007-06-17 18:22:35 +00:00
Nick Mathewson
a8e88adba4 r13410@catbus: nickm | 2007-06-13 18:39:05 -0400
Fix compilation on compilers that do not allow you to typedef the same type twice.


svn:r10598
2007-06-13 22:39:10 +00:00
Nick Mathewson
546209a4de r13384@catbus: nickm | 2007-06-13 13:53:26 -0400
make test_* functions stop conflicting with variables named v1 and v2.


svn:r10584
2007-06-13 18:15:56 +00:00
Nick Mathewson
3637ee0e59 r13383@catbus: nickm | 2007-06-13 13:53:04 -0400
Expose a function to parse a private key from a string as CRYPTO_PRIVATE.  For testing.


svn:r10583
2007-06-13 18:15:53 +00:00
Nick Mathewson
399890307d r13362@catbus: nickm | 2007-06-11 19:00:23 -0400
Fix a warning on platforms where sizeof(size_t)==8, but sizeof(unsigned long)<8.


svn:r10566
2007-06-11 23:00:26 +00:00
Nick Mathewson
dddf065e62 r13358@catbus: nickm | 2007-06-11 18:46:24 -0400
Fix some dumb copypasta in r10562.


svn:r10565
2007-06-11 22:46:35 +00:00
Nick Mathewson
f45732513e r13354@catbus: nickm | 2007-06-11 18:17:40 -0400
Add typechecking wrappers to digestmap, so we can work with "map from digest to [FOO]" for arbitrary FOOs and still have some typesafety.


svn:r10562
2007-06-11 22:19:37 +00:00
Nick Mathewson
6673d445f5 r13283@catbus: nickm | 2007-06-06 01:43:44 -0400
Fix up a couple of loops flagged by -Wunsafe-loop-optimizations so that they are more readable (and more amenable to compilation)


svn:r10513
2007-06-06 13:02:22 +00:00
Nick Mathewson
bb6f53d60c r13243@catbus: nickm | 2007-06-04 15:17:15 -0400
Start of code to compute consensus network-status stuff from a bunch of votes.  Strangely, it does not yet feel like an enormous ugly hack. 


svn:r10489
2007-06-04 19:19:01 +00:00
Nick Mathewson
6faa9e2641 r13239@catbus: nickm | 2007-06-04 11:30:37 -0400
Fix the fix for bug 445: set umask properly.  Also use open+fdopen rather than just umask+fopen, and create authority identity key with mode 400.


svn:r10485
2007-06-04 15:30:40 +00:00
Nick Mathewson
cb0324c400 r13191@catbus: nickm | 2007-06-03 19:38:18 -0400
Set umask(0700) when starting tor-gencert; resolves bug 445.


svn:r10475
2007-06-03 23:38:20 +00:00
Nick Mathewson
aee7f01624 r13154@catbus: nickm | 2007-06-02 11:26:44 -0400
Server-side support for If-Modified-Since in HTTP requsts for v1 stuff, and for network-status documents.


svn:r10451
2007-06-02 15:26:57 +00:00
Nick Mathewson
5b6d7f10f3 r13143@catbus: nickm | 2007-06-01 16:43:40 -0400
Try to fix some mipspro compiler warnings. There will still be some left.


svn:r10444
2007-06-02 12:44:54 +00:00
Roger Dingledine
b1ee20f0e8 trivial changes from my sandbox
svn:r10429
2007-05-31 23:57:46 +00:00
Nick Mathewson
534c55f531 r13111@catbus: nickm | 2007-05-31 15:03:41 -0400
Cleanup whitespace.


svn:r10425
2007-05-31 19:03:49 +00:00
Nick Mathewson
71c0a13703 r13110@catbus: nickm | 2007-05-31 15:03:24 -0400
Fix windows build.


svn:r10424
2007-05-31 19:03:46 +00:00
Nick Mathewson
4061b2cbd1 r13101@catbus: nickm | 2007-05-31 12:57:42 -0400
Unit tests [and debugging] for tor_inet_ntop() and tor_inet_pton()


svn:r10420
2007-05-31 18:48:25 +00:00
Nick Mathewson
e11a92bd54 r13058@catbus: nickm | 2007-05-29 14:39:53 -0400
Note that the fix for bug 222 should technically be turned into a real fix, not a kludge, one of these days.


svn:r10397
2007-05-29 18:39:59 +00:00
Nick Mathewson
e5ed434c42 r13054@catbus: nickm | 2007-05-29 14:20:50 -0400
An even better workaround for the probably-already-fixed bug 222.


svn:r10395
2007-05-29 18:21:00 +00:00
Nick Mathewson
f89a3b1448 r13050@catbus: nickm | 2007-05-29 13:31:11 -0400
Resolve all but 3 DOCDOCs.


svn:r10393
2007-05-29 17:31:13 +00:00
Nick Mathewson
916e98d3fa r13042@catbus: nickm | 2007-05-29 10:41:10 -0400
oops; use tor_inet_aton rather than inet_aton in tor_inet_ntop.  Spotted by Li-Hui Zhou.


svn:r10389
2007-05-29 14:41:24 +00:00
Roger Dingledine
0c047b87f5 polish r9933-r9994
svn:r10335
2007-05-25 19:41:31 +00:00
Nick Mathewson
bb524e99c9 r12955@catbus: nickm | 2007-05-25 13:17:30 -0400
First bare stubs of ipv6 work: commit some (untested, hence doublessly broken) implementations of inet_ntop/pton for systems that lack them.


svn:r10326
2007-05-25 18:22:37 +00:00
Nick Mathewson
a312afd67e r12936@catbus: nickm | 2007-05-24 14:12:34 -0400
Review XXXX comments without a version; upgrade some to XXXX020.


svn:r10315
2007-05-24 18:12:52 +00:00
Nick Mathewson
79707437d9 r12933@catbus: nickm | 2007-05-24 14:10:28 -0400
Optimize digestmap_set, since it sometimes shows up in profiles.  Seems to work so far, but it isnt the prettiest thing ever.


svn:r10312
2007-05-24 18:12:38 +00:00
Nick Mathewson
d3d86b17a7 r12916@catbus: nickm | 2007-05-24 12:43:45 -0400
Add math functions to round values to the nearest power of 2.  Make mempools more careful about making sure that the size of their chunks is a little less than a power of 2, not a little more.


svn:r10304
2007-05-24 17:12:57 +00:00
Nick Mathewson
c9fa4e6583 r12898@catbus: nickm | 2007-05-22 13:11:04 -0400
More v3 directory code: have authorities load certificates; have everybody store certificates to disk and load them; provide a way to configure v3 authorities.


svn:r10293
2007-05-22 17:58:25 +00:00
Nick Mathewson
e935d73b34 r12852@catbus: nickm | 2007-05-22 11:00:27 -0400
Use svn revisions consistently throughout all log messages.


svn:r10291
2007-05-22 15:48:46 +00:00
Nick Mathewson
4ec5e139c8 r12850@catbus: nickm | 2007-05-21 22:20:42 -0400
Partial backport candidate: do not rely on finding a \0 after an mmaped() router/extrainfo file.  Also, set journal length correctly when starting up.


svn:r10248
2007-05-22 02:20:52 +00:00
Nick Mathewson
5364833be0 r13017@Kushana: nickm | 2007-05-20 13:40:45 -0400
Address points in r10227.


svn:r10229
2007-05-20 17:43:55 +00:00
Roger Dingledine
ddd0054a85 point out two remote crash bugs, a memory leak, and a few other
items we should probably look into.


svn:r10227
2007-05-20 14:15:23 +00:00
Nick Mathewson
5f58bee0b0 r12812@catbus: nickm | 2007-05-19 16:17:36 -0400
Fix compilation with -O0; add unit tests for swap and shuffle.


svn:r10223
2007-05-19 20:17:37 +00:00
Nick Mathewson
7a61357250 r12790@catbus: nickm | 2007-05-18 17:24:26 -0400
Fix build on gcc 4.2


svn:r10212
2007-05-18 21:24:37 +00:00
Nick Mathewson
a187704872 r12980@Kushana: nickm | 2007-05-18 14:11:05 -0400
Add a "swap" function to smartlist, add a "shuffle" function for smartlist to crypto.c, and make appropriate hashtable functions be more const.


svn:r10208
2007-05-18 21:19:14 +00:00
Nick Mathewson
836328be2e r12777@catbus: nickm | 2007-05-16 21:52:23 -0400
Fix dumb bug introduced in r10199


svn:r10202
2007-05-17 01:52:26 +00:00
Nick Mathewson
807adfc879 r12769@catbus: nickm | 2007-05-16 17:32:01 -0400
Fix warnings from -Wunsafe-loop-optimizations, which incidentally turned up a logic bug in connection_or_flush_from_first_active_circuit that would overcount the number of cells flushed.


svn:r10199
2007-05-16 22:15:48 +00:00
Nick Mathewson
e043b86f47 r12764@catbus: nickm | 2007-05-15 17:17:39 -0400
Enable (and cope with) more GCC 4.2 warnings.


svn:r10196
2007-05-15 21:17:48 +00:00
Roger Dingledine
440b7f0c70 polish r9726-r9903
svn:r10182
2007-05-13 09:25:06 +00:00
Nick Mathewson
a7696a936d r12700@catbus: nickm | 2007-05-09 17:22:53 -0400
[Backport candidate] On windows, open cached-routers with the sharing mode "FILE_SHARE_READ so that other processes can read it while Tor is running. (Reported by Janbar). 


svn:r10148
2007-05-09 21:22:56 +00:00
Roger Dingledine
d112e7b1ad fix some code comments, a wrapper, and add a todo item
svn:r10111
2007-05-04 07:24:01 +00:00
Nick Mathewson
9279c1d5fe r12638@catbus: nickm | 2007-05-02 17:37:30 -0400
Remove the "RSA keys are 128-bits" assumption from crypto.c


svn:r10096
2007-05-02 21:37:53 +00:00
Nick Mathewson
fa39336e65 r12607@catbus: nickm | 2007-04-30 21:36:28 -0400
More attempt to fix win32 building.  This time, with extra linking.


svn:r10080
2007-05-01 01:36:32 +00:00
Nick Mathewson
6a27dd8284 r12595@catbus: nickm | 2007-04-30 18:32:34 -0400
Move private function declarations from crypto.c into a new #ifdef CRYPTO_PRIVATE block in crypto.h


svn:r10074
2007-04-30 22:42:50 +00:00
Nick Mathewson
105d782109 r12546@catbus: nickm | 2007-04-29 21:27:43 -0400
Correctly report win98se and win95osr2 versions.


svn:r10047
2007-04-30 01:27:47 +00:00
Nick Mathewson
2f4784cbd8 r12499@catbus: nickm | 2007-04-23 10:42:23 -0400
Keep a freelist of unused 4k buffer chunks, rather than wasting 8k for every inactive connection_t.


svn:r10006
2007-04-23 14:42:27 +00:00
Nick Mathewson
227b2e0226 r12759@Kushana: nickm | 2007-04-20 08:47:20 -0400
Track the number of connection_t separately from the number of open sockets.  It is already possible to have connections that do not count: resolving conns, for one.  Once we move from socketpairs to linked conns, and once we do dns proxying, there will be lots of such connections.


svn:r9994
2007-04-21 17:24:18 +00:00
Nick Mathewson
6ee5bef092 r12458@catbus: nickm | 2007-04-19 15:52:23 -0400
Fix a bug in displaying memory pool usage.  Also dump cell allocation, and track padded_cell_ts as they are allocated and freed, to make sure we are not leaking cells.


svn:r9992
2007-04-19 19:52:30 +00:00
Nick Mathewson
7392464b88 r12456@catbus: nickm | 2007-04-19 14:47:01 -0400
Make dumpmemusage() dump cell pool usage information.


svn:r9991
2007-04-19 18:47:04 +00:00
Nick Mathewson
362fbc79d2 r12414@catbus: nickm | 2007-04-16 17:37:17 -0400
More proposal-104 stuff: actually remember extra-info stuff.


svn:r9975
2007-04-16 21:37:21 +00:00
Nick Mathewson
7467c35249 r12353@catbus: nickm | 2007-04-11 15:58:46 -0400
Apparently some compilers think that anonymous unions are bad C.  Technically, they're right, so let's name the union in mempool.c.


svn:r9946
2007-04-11 19:58:51 +00:00
Nick Mathewson
38a5f09502 r12349@catbus: nickm | 2007-04-11 09:18:15 -0400
Add code to shrink the cell memory pool by discarding empty chunks that have been empty for the last 60 seconds.  Also, instead of having test.c duplicate declarations for exposed functions, put them inside #ifdef foo_PRIVATE blocks in the headers.  This prevents bugs where test.c gets out of sync.


svn:r9944
2007-04-11 13:18:25 +00:00
Nick Mathewson
1c8f9b319b r12344@catbus: nickm | 2007-04-10 21:27:25 -0400
Fix documentation and usage of 2nd argument to mp_pool_new.


svn:r9942
2007-04-11 01:27:33 +00:00
Nick Mathewson
51e4b8d706 r12338@catbus: nickm | 2007-04-10 20:29:05 -0400
Document memory pool implementation, and tweak it even mor.  See? Programming is fun.


svn:r9940
2007-04-11 00:30:34 +00:00
Nick Mathewson
28de06b8e6 r12337@catbus: nickm | 2007-04-10 17:55:26 -0400
Add support for using memory pools to allocate queued cell; pass --disable-cell-pool to configure to disable this.


svn:r9939
2007-04-11 00:30:29 +00:00
Nick Mathewson
6ba0b0e9f4 r12336@catbus: nickm | 2007-04-10 17:34:25 -0400
Unit tests and debugging for memory pool implementation.


svn:r9938
2007-04-11 00:30:25 +00:00
Nick Mathewson
d7359eb996 r12335@catbus: nickm | 2007-04-10 16:53:48 -0400
Initial version of memory pool logic. Needs unit tests.  Made to be easily separable from Tor.


svn:r9937
2007-04-11 00:30:22 +00:00
Nick Mathewson
d1ad950ca8 Turn bool_neq and bool_eq into macros.
svn:r9914
2007-03-29 02:37:06 +00:00
Nick Mathewson
f8f5ea10de r12191@catbus: nickm | 2007-03-15 15:33:37 -0400
Check return values from pthread_mutex functions.


svn:r9862
2007-03-17 21:09:49 +00:00
Roger Dingledine
d374616301 clean up some minor typos and log confusions
svn:r9832
2007-03-15 22:47:21 +00:00
Nick Mathewson
f25e2167f5 r12533@Kushana: nickm | 2007-03-11 05:01:15 -0400
Oh. Tor was supposed to compile?


svn:r9797
2007-03-11 09:05:17 +00:00
Nick Mathewson
02ce8e6b12 r12474@Kushana: nickm | 2007-03-06 16:10:05 -0500
We have a PATH_SEPARATOR macro.  How about we use it?


svn:r9782
2007-03-09 21:39:30 +00:00
Nick Mathewson
d62e37b4a9 r12473@Kushana: nickm | 2007-03-06 15:49:45 -0500
Excise PREDICT and PREDICT_FALSE in favor of PREDICT_LIKELY and PREDICT_UNLIKELY.


svn:r9781
2007-03-09 21:39:19 +00:00
Nick Mathewson
5d1bee87ff r12468@Kushana: nickm | 2007-03-06 15:24:00 -0500
More unit tests: gcov is fun.


svn:r9748
2007-03-06 20:25:44 +00:00
Nick Mathewson
4a6e29b029 r12076@catbus: nickm | 2007-03-04 15:41:04 -0500
oops; remove spurious argument from _log_prefix.


svn:r9734
2007-03-04 21:08:26 +00:00
Nick Mathewson
7fcceb2c25 r12074@catbus: nickm | 2007-03-04 15:11:43 -0500
Make all LD_BUG log messsages get prefixed with "Bug: ".  Remove manually-generated "Bug: "s from log-messages.  (Apparently, we remembered to add them about 40% of the time.)


svn:r9733
2007-03-04 20:11:46 +00:00
Nick Mathewson
dec9e4f0d8 r12011@catbus: nickm | 2007-02-28 18:13:32 -0500
Back out insufficiently evidenced FULL_UNROLL in aes.c


svn:r9693
2007-03-01 00:41:25 +00:00
Nick Mathewson
e2b1a77c3e r12006@catbus: nickm | 2007-02-28 16:06:24 -0500
On mingw, use "%I64u" to printf/scanf 64-bit integers, instead of the usual GCC "%llu".  This prevents a bug when saving 64-bit int configuration values on mingw; the high-order 32 bits would get truncated.  If the value was then reloaded, disaster would occur. (Fixes bug 400 and maybe also bug 397.)  Backport candidate.


svn:r9691
2007-02-28 21:07:19 +00:00
Nick Mathewson
f38240435a r12001@catbus: nickm | 2007-02-28 15:24:12 -0500
Try to build without warnings on mingw with verbose warnings on.  First attempt.


svn:r9688
2007-02-28 20:24:27 +00:00
Nick Mathewson
dfbced7499 r11998@catbus: nickm | 2007-02-28 13:56:55 -0500
Correct an MSC_VER check.


svn:r9685
2007-02-28 18:57:03 +00:00
Nick Mathewson
e1176ece5a r11992@catbus: nickm | 2007-02-28 12:46:32 -0500
compile fix on mingw: mingw does not define _MSC_VER.


svn:r9682
2007-02-28 17:46:36 +00:00
Nick Mathewson
dae5fc7982 r11981@catbus: nickm | 2007-02-28 11:55:27 -0500
Clamp declarable bandwidth at INT32_MAX, not INT_MAX.


svn:r9677
2007-02-28 16:56:07 +00:00
Nick Mathewson
d6368fd075 r11976@catbus: nickm | 2007-02-27 19:35:59 -0500
Add some missing (redundant but helpful in most cases) static declarations, and remove a function nobody was calling.


svn:r9672
2007-02-28 00:36:03 +00:00
Nick Mathewson
16f1008d01 Add a missing paren, and the results of an experiment.
svn:r9664
2007-02-27 06:00:11 +00:00
Nick Mathewson
9d714e6258 r11959@catbus: nickm | 2007-02-26 22:53:36 -0500
try to make aes encryption of cells about 30-40% faster where applicable.  offer not available for all architectures or all versions of openssl.


svn:r9663
2007-02-27 03:53:45 +00:00
Nick Mathewson
230fbd95c0 r11956@catbus: nickm | 2007-02-26 13:33:49 -0500
Add a quick-and-dirty AES benchmark function to the bottom of aes.c so I can go collecting data.


svn:r9660
2007-02-26 18:33:55 +00:00
Nick Mathewson
82e2d6001a r11954@catbus: nickm | 2007-02-26 13:01:19 -0500
Note some optimizations that are probably not worth it for 0.1.2.x based on preliminary profiling.


svn:r9659
2007-02-26 18:01:23 +00:00
Roger Dingledine
522a97098b more cleanups; getting closer
svn:r9655
2007-02-26 05:36:02 +00:00
Roger Dingledine
50f22e858a doc pedant
svn:r9634
2007-02-24 07:50:38 +00:00
Nick Mathewson
f599adf40a r11909@catbus: nickm | 2007-02-24 02:37:40 -0500
Move tricky "delete the member of the smartlist currently under iteration" logic into its own happyfun macro.


svn:r9633
2007-02-24 07:37:45 +00:00
Roger Dingledine
9946bb7fbd cosmetic, comment, and todo fixes
svn:r9627
2007-02-24 01:12:53 +00:00
Nick Mathewson
0fb179aa2e r11860@catbus: nickm | 2007-02-21 00:56:15 -0500
Another optimization suggested by Shark output: shave off >90% of uses of logv by cutting down on calls to log_debug when log actually debugging.  This is showing up in some profiles bug not others, and might be as much as 2.5%.


svn:r9612
2007-02-21 05:57:12 +00:00
Nick Mathewson
275ce1d2a4 r11852@catbus: nickm | 2007-02-20 17:25:17 -0500
Reverse arguments in memset() call in no-mmap version of tor_munmap_file().  Resolves bug 392.  Spotted by "fookoowa"--thanks!


svn:r9604
2007-02-20 22:25:20 +00:00
Nick Mathewson
b6e6b7101b r11850@catbus: nickm | 2007-02-20 13:34:13 -0500
Apply patch from coderman: have posix subthreads mask out signals.  This could prevent some kinds of crashes when subthreads try to handle SIGPIPEs and die in the attempt.  Backport candidate.


svn:r9603
2007-02-20 18:34:18 +00:00
Nick Mathewson
d2893398f6 r11832@catbus: nickm | 2007-02-16 15:31:59 -0500
Fix 35 remaining DOCDOC comments. Yowza.


svn:r9596
2007-02-16 20:39:37 +00:00
Nick Mathewson
11e5656ab7 r11826@catbus: nickm | 2007-02-16 14:58:38 -0500
Resolve 56 DOCDOC comments.


svn:r9594
2007-02-16 20:01:02 +00:00
Nick Mathewson
d4aaffc6e7 r11824@catbus: nickm | 2007-02-16 13:16:47 -0500
Move all struct-offset-manipulation macros into util.h, and use them consistently.  Because there are days when "SUBTYPE_P(handle, subtype, _base)" is just easier to read and write than "(basetp*)(((handle) - STRUCT_OFFSET(subtype, _base))".


svn:r9592
2007-02-16 20:00:43 +00:00
Nick Mathewson
1c8a9d37b6 r11791@catbus: nickm | 2007-02-13 11:36:07 -0500
Try to fix mingw compile error reported by Li-Hui Zhou.


svn:r9578
2007-02-13 16:36:14 +00:00
Nick Mathewson
3c691b9da6 r11785@catbus: nickm | 2007-02-12 20:27:48 -0500
Node-picking fixes: Never warn when a down node is listed in a config option (bug 348); always warn when a node in a config option is unnamed.  Also, when entrynodes is configured, then build the guard list as: (parts of EntryNodes that were guards before), (the rest of EntryNodes), (the rest of the old guards).  This last point ensures that EntryNode users will get the EntryNodes they want with the minimum change to their guard list.


svn:r9574
2007-02-13 01:27:55 +00:00
Nick Mathewson
759c58151e r11775@catbus: nickm | 2007-02-12 16:39:09 -0500
Update copyright dates.


svn:r9570
2007-02-12 21:39:53 +00:00
Nick Mathewson
30e7c05075 r11774@catbus: nickm | 2007-02-12 16:31:47 -0500
Handle errors on opening cached-routers* more uniformly and sanely: log not-found errors at level INFO, and all other errors at level WARN.  Needs testing on win32.


svn:r9569
2007-02-12 21:39:44 +00:00
Nick Mathewson
0c40a080a4 r11773@catbus: nickm | 2007-02-12 15:18:48 -0500
Implement proposal 106: stop requiring clients to have certificates, and stop checking for nicknames in certificates.  [See proposal 106 for rationale.]  Also improve messages when checking TLS handshake, to re-resolve bug 382.


svn:r9568
2007-02-12 21:39:33 +00:00
Roger Dingledine
4ba57f68e4 more changes. i'm all caught up now.
svn:r9495
2007-02-06 02:49:07 +00:00
Nick Mathewson
f02be02356 r11639@catbus: nickm | 2007-02-05 13:33:38 -0500
Add documentation to src/common/*.h; improve documentation for SMARTLIST_FOREACH; remove never-used options and corresponding tests from tor_strpartition.


svn:r9483
2007-02-05 18:33:52 +00:00
Nick Mathewson
fefba95363 r11629@catbus: nickm | 2007-02-02 15:06:17 -0500
Removing the last DOCDOC comment hurt so much that I had to use Doxygen to identify undocumented macros and comments, and add 150 more DOCDOCs to point out where they were.  Oops.  Hey, kids!  Fixing some of these could be your first Tor patch!


svn:r9477
2007-02-02 20:06:43 +00:00
Nick Mathewson
8507699256 r11624@catbus: nickm | 2007-02-01 13:17:35 -0500
Note a few questionable bits pointed out by RATS.  (And no, RATS, I'm not about to stop having fixed-sized local buffers for you.  I know how to use them, thankyouverymuch.)


svn:r9474
2007-02-01 18:33:02 +00:00
Nick Mathewson
5cb99857bc r11620@catbus: nickm | 2007-02-01 13:06:27 -0500
Call stat() slightly less often; use fstat() when possible.


svn:r9472
2007-02-01 18:09:27 +00:00
Nick Mathewson
76f896e714 r11607@catbus: nickm | 2007-01-30 17:19:27 -0500
Audit non-const char arguments; make a lot more of them const.


svn:r9466
2007-01-30 22:19:41 +00:00
Nick Mathewson
ef0720f909 r9689@catbus: nickm | 2007-01-19 22:34:20 -0500
And remove another strcpy.


svn:r9375
2007-01-20 03:35:03 +00:00
Nick Mathewson
c57ef84fc5 r11987@Kushana: nickm | 2007-01-19 14:57:28 -0500
Implement SOCKS_BAD_HOSTNAME status event. Defer remaining status events.  Clean up control-spec.txt a little, and fill in recommendations for events.


svn:r9374
2007-01-19 21:25:32 +00:00
Nick Mathewson
39e50cbb48 r9776@totoro: nickm | 2007-01-18 14:37:01 -0500
Yes, apparently saying strcpy in front of openbsd is like saying "intellectual property" in front of RMS.  They both have a point, I guess, even though they extend it to contexts where it is completely irrelevant.


svn:r9370
2007-01-18 19:37:23 +00:00
Nick Mathewson
093d71762c r11978@Kushana: nickm | 2007-01-15 18:54:25 -0500
Apparently, the OpenBSD linker thinks it knows C better than I do, and gets to call me names for having strcat and strcpy and sprintf in my code--whether I use them safely or not.  All right, OpenBSD.  You win... this round.


svn:r9360
2007-01-15 23:56:38 +00:00
Nick Mathewson
380f8983c7 r11966@Kushana: nickm | 2007-01-15 16:12:17 -0500
Tidy up ORCONN reason patch from Mike Perry.  Changes: make some of the handling of TLS error codes less error prone.  Enforce house style wrt spaces.  Make it compile with --enable-gcc-warnings.  Only set or_conn->tls_error in the case of an actual error.  Add a changelog entry.


svn:r9355
2007-01-15 21:21:05 +00:00
Nick Mathewson
ead35ef944 r11957@Kushana: nickm | 2007-01-15 15:25:57 -0500
Patch from Mike Perry: Track reasons for OR connection failure; display them in control events. Needs review and revision.


svn:r9354
2007-01-15 21:13:37 +00:00
Roger Dingledine
254005fc1b apparently i think of comments with no whitespace around them as
"read this if you don't understand the code and want some help."
which is not the same as "hey, you think you understand this code,
but you don't."


svn:r9307
2007-01-09 00:57:36 +00:00
Roger Dingledine
1d8a4cb989 Fix an assert error introduced in 0.1.2.5-alpha: if a single TLS
connection handles more than 4 gigs in either direction, we assert.


svn:r9306
2007-01-09 00:50:50 +00:00
Roger Dingledine
658c09c06f more progress and cleanups
svn:r9269
2007-01-05 06:03:10 +00:00
Nick Mathewson
6fbf17e7b0 r11749@Kushana: nickm | 2006-12-29 00:51:42 -0500
Remove dead code; make targets of addressmap commands/configs use AllowNonRFC953Hostnames


svn:r9211
2006-12-29 05:51:50 +00:00
Nick Mathewson
361998d0f3 r11741@Kushana: nickm | 2006-12-28 22:41:29 -0500
Count TLS bytes accurately: previously, we counted only the number of bytes read or transmitted via tls, not the number of extra bytes used to do so.  This has been a lonstanding wart.  The fix "Works for me".


svn:r9207
2006-12-29 03:42:46 +00:00
Nick Mathewson
4cd302a1eb r11722@Kushana: nickm | 2006-12-28 13:51:42 -0500
Add a helper function for case-insensitive search through a smartlist


svn:r9198
2006-12-28 21:29:03 +00:00
Nick Mathewson
94d7d8d88f r11670@Kushana: nickm | 2006-12-21 12:23:55 -0500
Clean up logic in parse_port_range(); accept 0 on low end and 65536 on high end for people who are bad at math.


svn:r9169
2006-12-21 17:38:15 +00:00
Nick Mathewson
ca516311e3 r11668@Kushana: nickm | 2006-12-20 22:22:53 -0500
Fix bug found by Keith Skinner: Treat malformed max-ports in address ranges as an error, and dont ignore errors with min-ports even if a max-port is present.


svn:r9168
2006-12-21 03:22:59 +00:00
Nick Mathewson
078aab810b r11597@Kushana: nickm | 2006-12-15 15:49:27 -0500
Add a rudimentary line-wrapping function for use in dumping comments in config files.


svn:r9132
2006-12-15 21:26:23 +00:00
Nick Mathewson
309c579452 r11581@Kushana: nickm | 2006-12-15 00:12:24 -0500
Make PIDFile work on windows.  Reported by Arrakis.


svn:r9116
2006-12-15 05:12:52 +00:00
Nick Mathewson
43e06eba8b r11566@Kushana: nickm | 2006-12-13 17:46:24 -0500
Try to fix an assert failure in new write limiting code: make buffers.c aware of previous "forced" write sizes from tortls.


svn:r9105
2006-12-13 22:46:42 +00:00
Roger Dingledine
8cf8b8087a when we decide not to mmap, because the file is empty or isn't
there at all, don't yell so loud.


svn:r9065
2006-12-11 04:21:10 +00:00
Nick Mathewson
e8dc71ade4 r11444@Kushana: nickm | 2006-12-07 09:38:52 -0500
Fix a couple of obvious bugs in tor_mmap_file on Windows: first, fix a boolean error when checking the return value of CreateFileMapping.  Second, CreateFileMapping is documented to return NULL on failure.


svn:r9035
2006-12-07 14:39:42 +00:00
Roger Dingledine
936f075f11 help ftello find its prototype
svn:r9016
2006-12-02 23:08:55 +00:00
Roger Dingledine
c5b90daf86 cleanups, bump to 0.1.2.4-alpha
svn:r9015
2006-12-02 22:47:46 +00:00
Nick Mathewson
facc49cf6f r9371@totoro: nickm | 2006-11-21 10:59:28 -0500
Fix a trivial comment.


svn:r8979
2006-11-21 23:50:21 +00:00
Nick Mathewson
d6cc235eba r9315@totoro: nickm | 2006-11-13 22:40:59 -0500
Fix a build warning on angela-sid


svn:r8949
2006-11-14 03:41:05 +00:00
Nick Mathewson
9243e54177 r9313@totoro: nickm | 2006-11-13 20:07:41 -0500
Try to compile with fewer warnings on irix64's MIPSpro compiler /
 environment, which apparently believes that:
   - off_t can be bigger than size_t.
   - only mean kids assign things they do not subsequently inspect.
 
 I don't try to fix the "error" that makes it say:
 
 cc-3970 cc: WARNING File = main.c, Line = 1277
   conversion from pointer to same-sized integral type (potential portability
           problem)
 
     uintptr_t sig = (uintptr_t)arg;
 
 Because really, what can you do about a compiler that claims to be c99
 but doesn't understand that void* x = NULL; uintptr_t y = (uintptr_t) x;
 is safe?
 


svn:r8948
2006-11-14 01:07:52 +00:00
Roger Dingledine
3d6b97399f Avoid assert failure when our cached-routers file is empty on startup.
(reported by revstray)


svn:r8928
2006-11-12 07:09:22 +00:00
Nick Mathewson
50771a6b48 r9380@Kushana: nickm | 2006-10-24 21:25:07 -0400
Add string.h include to compat.h so that strlcpy() and strlcat() will always be defined after including compat.h.  This should resolve warnings on centos.


svn:r8824
2006-10-25 01:25:17 +00:00
Roger Dingledine
0459db2c0d checkpoint some changes as i read diffs
svn:r8780
2006-10-20 19:11:12 +00:00
Nick Mathewson
c8c36dd227 r9304@dhcp-18-188-67-85: nickm | 2006-10-20 12:22:46 -0400
Change HT_INIT from a special-case to a macro-calling-a-function like the rest of ht.h.  This might prevent errors if somebody did, I dunno, "HT_INIT(tp, hashtable++)". Based on a patch from Watson Ladd.


svn:r8776
2006-10-20 16:22:53 +00:00
Roger Dingledine
dcd33ef599 i saw somebody on #tor paste a string where these were
null. better safe than sorry.


svn:r8767
2006-10-20 00:12:02 +00:00
Nick Mathewson
7551c44a53 r9274@Kushana: nickm | 2006-10-19 16:16:58 -0400
Add unit tests for tor_mmap_file(); make tor_mmap_t.size always be the size of the file (not the size of the mapping); add an extra argument to read_file_to_str() so it can return the size of the result string.


svn:r8762
2006-10-19 23:05:02 +00:00
Nick Mathewson
17abfa6a6a r8971@totoro: nickm | 2006-10-09 10:16:23 -0400
Move definition of ssize_t to torint.h


svn:r8670
2006-10-09 15:47:08 +00:00
Nick Mathewson
e618c15aff r8967@totoro: nickm | 2006-10-08 23:38:50 -0400
Fix some test and warn failures in last commit


svn:r8665
2006-10-09 03:39:06 +00:00
Nick Mathewson
c6f2d725d0 r8957@totoro: nickm | 2006-10-08 22:35:17 -0400
The otherwise regrettable MIPSpro C compiler warns about values set but never used, and about mixing enums and ints; these are good warnings, and so should be fixed.  This removes some dead code and some potential bugs. Thanks to pnx.


svn:r8664
2006-10-09 02:35:51 +00:00
Andrew Lewman
563be121c2 Add missing return so this builds on mingw.
svn:r8649
2006-10-08 18:24:31 +00:00
Nick Mathewson
f07f7a7a12 r8923@totoro: nickm | 2006-10-07 11:44:33 -0400
More doxygen comments


svn:r8637
2006-10-07 16:25:28 +00:00
Roger Dingledine
f2bd0e2f16 more minor cleanups
svn:r8630
2006-10-07 06:28:50 +00:00
Roger Dingledine
881d23847a fix something that looked scary to me. i believe this won't
change any behavior currently, but it will avoiding calling
noop code that might change for the worse some time.

nick, please confirm.


svn:r8623
2006-10-07 00:52:23 +00:00
Roger Dingledine
06e5b2283c minor cleanups
svn:r8622
2006-10-07 00:50:39 +00:00
Nick Mathewson
29fa9eb216 r8860@totoro: nickm | 2006-10-03 14:48:33 -0400
Use ANSI-style definition syntax in strlcat.c and strlcpy.c so that gcc stops barfing with -Wold-style-definition


svn:r8591
2006-10-03 19:00:07 +00:00
Nick Mathewson
4c56ac93ca r8851@totoro: nickm | 2006-10-02 18:13:27 -0400
Remove/clarify some XXXs for no longer being accurate; for begin things we do not indend to fix; for already being parts of big todo issues (like "/* XXX ipv6 */"); etc. Also fix some spaces.


svn:r8580
2006-10-02 22:13:42 +00:00
Nick Mathewson
bff83b666c r8846@totoro: nickm | 2006-10-02 16:59:57 -0400
Move is_local_IP to config.c; have it check for same-/24; make it used only for reachability (not for banwidth, because that is probably not what we want). Fixes an XXX.


svn:r8578
2006-10-02 21:00:35 +00:00
Nick Mathewson
d75edc35cc r8845@totoro: nickm | 2006-10-02 16:34:58 -0400
Fix an XXXX: make path_is_relative work on windows even though we never use it there.


svn:r8577
2006-10-02 21:00:24 +00:00
Nick Mathewson
36adc7cdd9 r8844@totoro: nickm | 2006-10-02 16:32:44 -0400
Resolve an XXXX: make sure that we are actually on 2s-complement hardware.


svn:r8576
2006-10-02 21:00:20 +00:00
Nick Mathewson
219ad6395c r8825@totoro: nickm | 2006-10-01 17:41:27 -0400
Add function to return a random uint64_t.


svn:r8570
2006-10-01 21:59:05 +00:00
Nick Mathewson
c2d304366b r9032@Kushana: nickm | 2006-09-29 18:51:42 -0400
Now, all log messages should be distinct.


svn:r8545
2006-09-29 22:51:47 +00:00
Nick Mathewson
7d366f61cb r9025@Kushana: nickm | 2006-09-29 18:33:13 -0400
Differentiate more duplicated log entries


svn:r8542
2006-09-29 22:33:40 +00:00
Nick Mathewson
8308a37908 r9023@Kushana: nickm | 2006-09-29 17:27:24 -0400
Make distinct all non-bug messages at notice or higher that appear 3 or more times.


svn:r8541
2006-09-29 22:33:34 +00:00
Nick Mathewson
87648bdcf8 r9008@Kushana: nickm | 2006-09-29 13:50:10 -0400
Doxygen comments for code in common.  Also simplify a few code paths to be more clear/speedy/correct.


svn:r8536
2006-09-29 18:13:37 +00:00
Nick Mathewson
05604c60d4 r9006@Kushana: nickm | 2006-09-29 10:48:23 -0400
Omit function names from NOTICE, WARN and ERR messages unless they are in LD_BUG.


svn:r8534
2006-09-29 18:13:29 +00:00
Nick Mathewson
d3a06684bc r8974@Kushana: nickm | 2006-09-28 17:05:59 -0400
Improvement to last entry guards patch: track when we last attempted to connect to a node in our state file along with how long it has been unreachable.  Also clarify behavior of parse_iso_time() when it gets extra characters.


svn:r8520
2006-09-28 23:57:49 +00:00
Nick Mathewson
95132f836a r8750@totoro: nickm | 2006-09-27 20:52:01 -0400
Fix some warnings on mingw; hopefully this should let us build on mingw without warnings.


svn:r8509
2006-09-28 00:53:02 +00:00
Nick Mathewson
0f8491a254 Backport candidate: remove dangerous free(0) on hashtable init
svn:r8499
2006-09-25 16:06:09 +00:00
Nick Mathewson
78c068397a add missing paren in dmalloc tor_free
svn:r8498
2006-09-25 15:44:40 +00:00
Nick Mathewson
7c21dabef1 r8878@Kushana: nickm | 2006-09-21 17:15:47 -0400
Trivial whitespace cleanups.


svn:r8443
2006-09-21 21:48:55 +00:00
Nick Mathewson
b2cc52fa02 Speed up eat_whitespace by a lot.
svn:r8434
2006-09-19 23:55:35 +00:00
Nick Mathewson
6b716fdfb9 NEEDS REVIEW. Act on previous comment, and handle named servers differently: now, we allow multiple servers with the same name in the routerlist even if that name is reserved, but we check whether names are reserved when we try to look up routers by nickname. This is a minor security fix. This makes router_add_to_routerlist O(1). This is a backport candidate.
svn:r8433
2006-09-19 23:48:14 +00:00
Nick Mathewson
2d4950c837 Malloc and friends are critical-path: Thus, add an it-wont-happen branch prediction for NULL returns, and skip the malloc(0) check on platforms where malloc(0) returns a pointer.
svn:r8431
2006-09-19 22:36:48 +00:00
Nick Mathewson
7b0ec744bc Switch routerlist.c to using memcmp on digests rather than crypto_pk_cmp_keys(); speed up find_whitespace a lot (8x for me) by using a switch statement. This should speed parsing a lot of routers at once by a lot.
svn:r8430
2006-09-19 22:20:09 +00:00
Nick Mathewson
93beeac01d Merge in some bsockets calls, all wrapped inside #if defined(USE_BSOCKETS)
svn:r8427
2006-09-19 20:41:31 +00:00
Nick Mathewson
e58b9c1151 r8819@Kushana: nickm | 2006-09-15 00:27:45 -0400
Implement a smartlist_uniq() that will with luck not end the world.


svn:r8396
2006-09-15 04:27:58 +00:00
Peter Palfrader
28cac25d7e r9749@danube: weasel | 2006-09-14 06:53:12 +0200
Do not graciously increase the size to be mmaped if the current size already is
 at a page_size boundary.  This is important since if a file has a size of zero
 and we mmap() it with length > 0, then accessing the mmaped memory area causes
 a bus error.  However, if we pass a length of 0 to mmap() it will return with -1
 and things work from there.


svn:r8387
2006-09-14 04:53:42 +00:00
Roger Dingledine
9af3175687 parameterize the loudness of get_interface_address()
svn:r8358
2006-09-09 19:20:27 +00:00
Roger Dingledine
5f6351ceb3 fix typo, add log message
svn:r8357
2006-09-09 19:16:07 +00:00
Nick Mathewson
365ccf0742 r8725@Kushana: nickm | 2006-09-06 04:39:29 -0400
spawn_func fixes: have cpuworker_main and dnsworker_main confirm to the right interfaces [casting func to void* is icky].  Also, make pthread_create() build without warnings.


svn:r8327
2006-09-06 08:42:20 +00:00
Nick Mathewson
000b7b287c r8724@Kushana: nickm | 2006-09-06 04:32:28 -0400
Fix spaces; restore support for mapping files over 4GB on win32 (?)


svn:r8326
2006-09-06 08:42:16 +00:00
Mike Chiussi
6ec9c1092a - made configure check if we are building for win32
- made configure link to required system dll's if building for win32
- added diffs for libevent 1.1b
- forced user to turn off eventdns if win32 is set 
- cleaned up tor_mmap_file()_win32 (not sure if it's stable)
- cleaned up some warnings and typos




svn:r8322
2006-09-06 01:49:55 +00:00
Nick Mathewson
c4ac4bcba3 r8696@Kushana: nickm | 2006-08-31 14:43:44 -0400
Try to appease some warnings with newer gccs that believe that ignoring a return value is okay, but casting a return value and then ignoring it is a sign of madness.


svn:r8312
2006-08-31 18:47:54 +00:00
Nick Mathewson
f170e5798f r8692@Kushana: nickm | 2006-08-31 13:38:07 -0400
Fix bug 327 (part 2): Cast char to unsigned char before passing to toupper/tolower.  (Follow the same idiom as with isupper and friends, in case we run into the same problem on SGI or whereever it was.)


svn:r8310
2006-08-31 17:39:51 +00:00
Nick Mathewson
bc0c39f85d r8691@Kushana: nickm | 2006-08-31 13:30:46 -0400
Fix bug 327 (part 1): Use correct macro to test for GCC 3 or later.


svn:r8309
2006-08-31 17:39:47 +00:00
Nick Mathewson
fee33d2ff1 r8682@Kushana: nickm | 2006-08-29 17:58:59 -0400
Fix compilation on GCC2 by disabling fun attributes unless __GNUC_MAJOR__ >= 3.


svn:r8303
2006-08-29 21:59:20 +00:00
Nick Mathewson
6fcdcc7fc7 r8626@Kushana: nickm | 2006-08-27 23:45:46 -0400
Aw, crap.  Non-gcc bug.  We need regular windows builds.


svn:r8259
2006-08-28 03:46:21 +00:00
Roger Dingledine
9f5856c03d stop three memory leaks. nick, fix these if i'm wrong.
svn:r8235
2006-08-27 02:07:54 +00:00
Nick Mathewson
b050ecf86c r7404@Kushana: nickm | 2006-08-16 09:32:19 -0400
Pass hints to getaddrinfo; fix bug 280 (?)


svn:r7069
2006-08-16 18:47:19 +00:00
Roger Dingledine
4b94dabb53 note a compile warning that we should investigate one day.
svn:r7052
2006-08-14 09:44:54 +00:00
Nick Mathewson
b68ffcc193 r7341@Kushana: nickm | 2006-08-11 00:51:05 -0700
Amazing how much difference adding a ! to all your asserts can make.


svn:r7029
2006-08-11 07:51:34 +00:00
Nick Mathewson
33fc829273 r7337@Kushana: nickm | 2006-08-11 00:42:04 -0700
Only use __builtin_offsetof with gcc 4 or later


svn:r7028
2006-08-11 07:42:11 +00:00
Nick Mathewson
42a5d7a4ba r7335@Kushana: nickm | 2006-08-11 00:13:03 -0700
fix wide lines


svn:r7025
2006-08-11 07:17:16 +00:00
Nick Mathewson
ffab3b48a8 r7326@Kushana: nickm | 2006-08-10 23:50:49 -0700
And another GCC change: predict that tor_frees() are usually real frees, and tor_asserts() usually wont happen. Other test should wait till -fprofile-arcs


svn:r7022
2006-08-11 07:09:35 +00:00
Nick Mathewson
4eddbcf262 r7325@Kushana: nickm | 2006-08-10 23:37:31 -0700
Use gcc offsetof where available.


svn:r7021
2006-08-11 07:09:28 +00:00
Nick Mathewson
09a895e222 r7324@Kushana: nickm | 2006-08-10 23:23:15 -0700
Add more warnings to the list of those we tolerate. Start using GCC attributes more, for better error checking and better code generation.


svn:r7020
2006-08-11 07:09:17 +00:00
Nick Mathewson
1b7ad5aed3 r7030@Kushana: nickm | 2006-08-04 14:46:52 -0700
Close an fd leak on failed mmap()


svn:r6988
2006-08-05 17:53:32 +00:00
Nick Mathewson
7c596c166b r7029@Kushana: nickm | 2006-08-04 14:08:41 -0700
Remove now-spurious size and data arguments from tor_mmap_file


svn:r6987
2006-08-05 17:53:21 +00:00
Nick Mathewson
dbac3fb481 r7028@Kushana: nickm | 2006-08-04 13:10:16 -0700
Make data and size fields visible in tor_mmap_t; hide win magic differently.


svn:r6986
2006-08-05 17:53:08 +00:00
Nick Mathewson
db72fb9cdc r7025@Kushana: nickm | 2006-08-04 12:03:22 -0700
Finish (I hope) windows mmap impl.


svn:r6981
2006-08-04 19:03:40 +00:00
Nick Mathewson
bf72878cad r7012@Kushana: nickm | 2006-08-03 19:21:25 -0700
Add an "mmap handle" type to encapsulate bookkeeping elements of mmap issues; add prelim win32 impl


svn:r6980
2006-08-04 18:32:43 +00:00
Roger Dingledine
e64825126b turn future seg faults into asserts
svn:r6970
2006-08-03 04:23:45 +00:00
Nick Mathewson
80282d8f55 r6993@Kushana: nickm | 2006-07-31 16:19:21 -0400
Interesting how much a ! can change the behavior of an assert.


svn:r6962
2006-07-31 20:19:58 +00:00
Nick Mathewson
ea0f5ec8ad r6980@Kushana: nickm | 2006-07-31 13:18:22 -0400
Add a utility function to verify that a string has been through strlower.


svn:r6959
2006-07-31 18:01:37 +00:00
Nick Mathewson
d934607069 r6979@Kushana: nickm | 2006-07-31 13:16:58 -0400
Add assert_ok functions for strmap and digestmap; use them in unit test code.


svn:r6958
2006-07-31 18:01:27 +00:00
Nick Mathewson
3843b1b3d0 r6978@Kushana: nickm | 2006-07-31 13:16:14 -0400
Add isupper and islower wrappers to compat.h


svn:r6957
2006-07-31 18:01:22 +00:00
Nick Mathewson
2fe537c57a r6958@Kushana: nickm | 2006-07-29 18:54:15 -0400
Looks like we might need a priority queue.


svn:r6953
2006-07-31 17:59:37 +00:00
Nick Mathewson
8786b4b88e Fix a bug in HT_REMOVE.
svn:r6925
2006-07-27 18:35:25 +00:00
Nick Mathewson
45c3a4365f Get better numbers out of HT_REP_OK
svn:r6924
2006-07-27 17:37:37 +00:00
Peter Palfrader
521c006fd5 Remove .cvsignore files from trunk
svn:r6891
2006-07-25 01:00:48 +00:00
Nick Mathewson
6d2eb77555 Whitespace fix
svn:r6816
2006-07-23 07:19:49 +00:00
Nick Mathewson
35960e1162 Add a mem_is_zero function (I think we will need this) and a STRUCT_OFFSET macro (we already need this).
svn:r6810
2006-07-23 05:32:35 +00:00
Nick Mathewson
08a4114abf Another MSVC6 fix. Grnk.
svn:r6802
2006-07-21 14:53:23 +00:00
Nick Mathewson
77c28d112b Hm. We probably should define INT64_MAX if we really want it. (Especially since we only want it on one platform, where, coincidentally, it is not defined.)
svn:r6784
2006-07-18 02:01:32 +00:00
Nick Mathewson
e572d5990c MSVC6 is apparently terrified of unnatural cross-breeding between uint64_t and double, and needs more persuasion than usual to cast one to the other. Issue identified by Frediano Ziglio; patch revised for minimal impact on non-MSVC6 compilers.
svn:r6768
2006-07-17 00:39:05 +00:00
Roger Dingledine
3d79eb52ab stick to nick's nul/null convention
svn:r6763
2006-07-15 19:21:30 +00:00
Nick Mathewson
28a7c8a64c Make compilation work on old MSVCs without GetVertsionEx magic. Patch from Frediano Ziglio.
svn:r6749
2006-07-09 22:29:12 +00:00
Roger Dingledine
fad85f173a when an exit node gets a malformed begin cell, don't complain to
the node operator, since he can't do anything about it.


svn:r6733
2006-07-06 02:44:07 +00:00
Roger Dingledine
12cc290a7d ok, i'm not allowed to say that there. oh well.
svn:r6720
2006-07-04 16:11:35 +00:00
Roger Dingledine
579849f600 fix a misleading function comment
svn:r6717
2006-07-04 15:52:22 +00:00
Roger Dingledine
5dc1e6f788 if we're the server-side of the tls and there are problems,
don't yell as loudly.


svn:r6716
2006-07-04 15:51:59 +00:00
Roger Dingledine
35e95d7783 minor fixes
svn:r6710
2006-07-04 03:25:07 +00:00
Nick Mathewson
05eff35ac6 Harmless: Z_OK is not an acceptable answer to Z_FINISH.
svn:r6701
2006-06-29 11:17:36 +00:00
Nick Mathewson
1cd04abf1a Actually enable mmap. That should improve matters.
svn:r6694
2006-06-28 08:54:32 +00:00
Nick Mathewson
06e09cdd47 Apparently, zlib sometimes reports Z_BUF_ERROR on input exhaustion as well as on running out of output space. This could well fix the assert bug reported by weasel and arma.
svn:r6682
2006-06-24 02:06:52 +00:00
Nick Mathewson
06ffee3b67 Ooh, that could have been bad. Sort digests as digests, not strings.
svn:r6679
2006-06-22 07:29:14 +00:00
Nick Mathewson
e2697a62ac When requesting or serving resources via fingerprint/digest, request and respond in-order, removing duplicates.
svn:r6673
2006-06-21 04:57:12 +00:00
Nick Mathewson
73ada60d64 remove non-germane comment
svn:r6640
2006-06-18 07:37:21 +00:00
Nick Mathewson
f83a628a76 perhaps the reason I rail against cut-and-paste programming so vehemently is that I am so bad at it.
svn:r6638
2006-06-18 07:32:31 +00:00
Nick Mathewson
630e9cd510 Add some incremental encryption wrappers to torgzip code
svn:r6636
2006-06-18 07:24:29 +00:00
Nick Mathewson
af8096815e Add a memdup function to util
svn:r6635
2006-06-18 07:22:36 +00:00
Nick Mathewson
78428dccdb Add smartlist_reverse and smartlist_pop_last.
svn:r6634
2006-06-18 07:21:35 +00:00
Nick Mathewson
1f585987c4 Another escape() fix, for picky sprintfs.
svn:r6579
2006-06-09 17:07:22 +00:00
Nick Mathewson
2936da4c28 Override our notion of printability for esc_for_log. 127 and up are never printable. Take that, locales.
svn:r6578
2006-06-09 15:57:58 +00:00
Roger Dingledine
85d408a573 Bandaid for a seg fault i just got in 0.1.1.20.
More generally, i reopened bug 222. Whee.


svn:r6571
2006-06-09 06:35:45 +00:00
Roger Dingledine
8cf45df230 and now the exciting part: there is now no such thing as doing
a client-only tls, that is, one with no certs.


svn:r6558
2006-06-07 06:21:11 +00:00
Roger Dingledine
0bfef523df simplify the tortls api: we only support being a "server", that
is, even tor clients do the same sort of handshake.

this has been true for years, so it's best to get rid of the
stale code.


svn:r6557
2006-06-07 06:10:54 +00:00
Roger Dingledine
7512be0b65 looks like we missed a piece of the 0.1.1.9 paranoia code.
hopefully this change is a no-op.


svn:r6556
2006-06-07 02:57:23 +00:00
Roger Dingledine
45065f1466 simplify code now that libevent considers all sockets pollable.
what we really mean now is ">= 0", which is clearer to test for.


svn:r6543
2006-06-05 09:08:10 +00:00
Roger Dingledine
266afcd7d5 bandaid for bug 299. this is still a bug, since we don't
initialize for hardware acceleration in certain configurations;
but not critical until that is supported.


svn:r6536
2006-06-05 04:29:03 +00:00
Nick Mathewson
853e2d99b6 Add a new warning to our "warn a lot" list: unused parameters. This means we have to explicitly "use" unuseds, but it can catch bugs. (It caught two coding mistakes so far.)
svn:r6532
2006-06-04 22:42:13 +00:00
Nick Mathewson
c660a0f6a2 More DNS fixes. Send meaningful TTLs back to the client when
possible.  Cache at the server side independently from the TTL, to
prevent attackers from probing the server to see who has been asking
for what hostnames.  (Hi, Dan Kaminski!)

Also, clean some whitespace.


svn:r6526
2006-06-03 21:41:14 +00:00
Nick Mathewson
86da3e0a0a Patch based on post by Mike C to or-dev; special-case based on use of MSVC, rather than on MS_WINDOWS, so that mingw builds.
svn:r6523
2006-06-03 18:52:31 +00:00
Nick Mathewson
64d487a2d6 Add a basic mmap function, with a "fake-it" wrapper to do read_file_from_str instead. Based on code from Michael Mohr.
svn:r6510
2006-05-28 16:54:39 +00:00
Roger Dingledine
7f611f4732 if we're a server and some peer has a broken tls certificate, don't
shout about it unless we want to hear about protocol violations.


svn:r6507
2006-05-26 16:32:16 +00:00
Roger Dingledine
731f4086c0 resolve an unused variable
svn:r6503
2006-05-26 13:51:45 +00:00
Roger Dingledine
a4cdb834b9 Stop being picky about what the arguments to mapaddress look like.
we were refusing names that had $ in them, which people who specify
$key.exit will be sad about. There are likely other examples.
If people can think of reasons why we should be picky, let me know.


svn:r6496
2006-05-25 20:06:09 +00:00
Roger Dingledine
36712a443b Stop initializing the hardware accelerator engines simply because
we overloaded the meaning of the argument to crypto_global_init().


svn:r6490
2006-05-24 00:37:38 +00:00
Roger Dingledine
67a885ecac Claim a commonname of Tor, rather than TOR, in tls handshakes.
Maybe this will help us win the war of names.


svn:r6489
2006-05-24 00:21:55 +00:00
Nick Mathewson
89a8411ace Throw out this UNALIGNED_INT_ACCESS_OK nonsense. Even where it works, it is often way way slower than doing the right thing. Backport candidate.
svn:r6473
2006-05-23 08:23:03 +00:00
Peter Palfrader
f7ba9d77e4 All these headers we get via torint.h
svn:r6452
2006-05-10 10:24:17 +00:00
Nick Mathewson
8a13a7cfe8 mainline branch. Remove some more dead XXXs.
svn:r6401
2006-04-18 03:58:42 +00:00
Nick Mathewson
1fbc74661f Remove DER64 functions in trunk: they will never be used again unless the directory authorities switch back to 0.0.9tooearly.
svn:r6376
2006-04-10 21:23:00 +00:00
Roger Dingledine
7e3a98b489 "" is not a plausible address for addressmaps.
svn:r6299
2006-04-03 00:26:51 +00:00
Peter Palfrader
1fa7b3cef7 Avoid warnings about machine/limits.h on Debian GNU/kFreeBSD
svn:r6271
2006-03-29 05:14:12 +00:00
Roger Dingledine
0543900fbf clean up the traces from tracking the 0.1.1.9-alpha stack-smashing bug.
svn:r6240
2006-03-26 06:47:51 +00:00
Roger Dingledine
7871ad9116 failing in a support function is a warn, not an err.
svn:r6239
2006-03-26 06:47:08 +00:00
Nick Mathewson
6d9632ba23 Check return value from GetVersionEx (even though the MSDN example doesnt) and zero out the LPOSVERSIONINFOEX struct before getting the version. This may fix the "johnboy" [major=-858993460,minor=-858993460] problem.
svn:r6233
2006-03-24 05:26:33 +00:00
Nick Mathewson
15e5cf6088 Fix memory leak when uncompressing concatenated zlib streams. Unit tests and tor client work; looks ok.
svn:r6211
2006-03-21 20:31:27 +00:00
Roger Dingledine
6449e2f6d6 ok, commenting that out broke things real bad.
leave it, and accept the memory leak for now.


svn:r6201
2006-03-20 02:13:35 +00:00
Roger Dingledine
54ced294df Resolve a memory leak on clients. This disables some
functionality that we might still want. Nick?


svn:r6200
2006-03-20 00:52:22 +00:00
Nick Mathewson
0f0e14c6e3 normalize whitespace.
svn:r6173
2006-03-17 04:43:37 +00:00
Roger Dingledine
0e62befab8 add tor_strisprint() back in, this time with comments.
svn:r6170
2006-03-15 23:35:55 +00:00
Roger Dingledine
4cd4353847 and remove now-extraneous function
svn:r6168
2006-03-15 19:17:46 +00:00
Nick Mathewson
0bc19dddf5 Use INLINE (which we define) instead of __inline (which is nonstandard) in ht.h. Resolves bug 270; maybe sun C will work now.
svn:r6153
2006-03-13 15:09:49 +00:00
Nick Mathewson
daea6b21a5 Fix bug in close_logs(): when we close and delete logs, remove them all from the global "logfiles" list. This should fix bug 222.
svn:r6145
2006-03-13 00:54:21 +00:00
Nick Mathewson
0c132ee2a1 Instead of listing a set of compilers that prefers __func__ to __FUNCTION__, use autoconf. Also, prefer __func__ in our own code: __func__ is a C99 standard, whereas __FUNCTION__ is not. [Fixes bug 254.]
svn:r6144
2006-03-13 00:25:36 +00:00
Nick Mathewson
bd8ffccae7 More cleanups noticed by weasel; also, remove macros that nobody uses.
svn:r6143
2006-03-12 23:31:16 +00:00
Nick Mathewson
4d3e709c4b Use escaped() for remaining cases.
svn:r6117
2006-03-11 02:21:30 +00:00
Roger Dingledine
a385b0087f fix infinite loop
svn:r6090
2006-03-06 20:01:46 +00:00
Nick Mathewson
5777ee0e1a Add some functions to escape values from the network before sending them to the log. Use them everywhere except for routerinfo->plaftorm, routerinfo->contact_info, and rend*.c. (need sleep now)
svn:r6087
2006-03-05 09:50:26 +00:00
Nick Mathewson
6a4e304d9e Allow private:* in routerdescs; not generated yet (because older Tors do not understand it); needs testing.
svn:r6086
2006-03-05 05:27:59 +00:00
Peter Palfrader
42f14e8e10 Add function names to log_* on non-gcc
svn:r6039
2006-02-18 07:18:14 +00:00
Peter Palfrader
4f5e607389 Finish log function renaming for non-GNUC systems
svn:r6034
2006-02-18 02:11:48 +00:00
Roger Dingledine
6ce36ead42 Start the process of converting warn to log_warn and so on.
This is needed because Windows already has an err() that we
can't clobber. And we need to be able to make the log functions
a macro so we can print the function's name in the log entry.


svn:r6000
2006-02-13 08:01:59 +00:00
Nick Mathewson
2cc66125b8 try to fix bug with spurious "everything is broken" warning
svn:r5994
2006-02-13 00:26:43 +00:00
Nick Mathewson
dba155ecff Generate 18.0.0.0/8 address policy format in descs when we can; warn when the mask is not reducible to a bit-prefix.
svn:r5991
2006-02-12 23:58:22 +00:00
Roger Dingledine
b99f903e34 and don't warn when it happens here either, unless the user
wants to hear it.


svn:r5990
2006-02-12 23:44:02 +00:00
Roger Dingledine
53c54b75c9 Correct a function comment. Nick: is this right?
svn:r5989
2006-02-12 23:34:03 +00:00
Roger Dingledine
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +00:00
Roger Dingledine
28f3765b5a and maybe some function documentation will help too
svn:r5935
2006-02-09 02:59:37 +00:00
Roger Dingledine
6f579deff4 check for EADDRINUSE in a cross-platform way (unless i'm wrong)
svn:r5899
2006-02-03 12:25:46 +00:00
Roger Dingledine
418dc7b16e I believe this resolves bug 234, the mysterious crash on 0.1.1.9
and later servers. I'm not sure yet, but better to have it in CVS
while we speculate that it's the fix.


svn:r5895
2006-02-02 10:10:07 +00:00
Peter Palfrader
dbf2e10460 Apply Matt Ghali's --with-syslog-facility patch
svn:r5883
2006-02-01 02:15:44 +00:00
Roger Dingledine
f1864dfff3 On systems that don't have getrlimit (like windows), we were artificially
constraining ourselves to a max of 1024 connections. Now if there is no
getrlimit, just assume that we can handle the whole 15000 connections.

The better answer is to find a getrlimit equivalent on Windows, but hey,
one step at a time.


svn:r5854
2006-01-23 23:39:13 +00:00
Nick Mathewson
45757dafb7 Split PARANOIA_B into B1 and B2.
svn:r5849
2006-01-22 18:22:04 +00:00
Nick Mathewson
241310bbac Split 0119_PARANOIA into 0119_PARANOIA_[ABC]. A is "this is suspicious, and we have not tried running without this yet". B is "this is suspicious, but the last time we tested, it was okay." C is "How could this possibly be the cause?"
svn:r5840
2006-01-17 23:08:38 +00:00
Nick Mathewson
099b9ce2f9 Fix bug 230: add a rollback function to reverse all changes since the last mark_logs_temp(), and move log initialization into the two-phase part of option setting.
svn:r5803
2006-01-11 19:40:14 +00:00
Nick Mathewson
55ac4f032c Add a (diabled by default) option in crypto.h to disable most of the interesting crypto-related changes made on 0.1.1.9. This will help hunt bug 234.
svn:r5777
2006-01-10 21:12:06 +00:00
Nick Mathewson
7fc62029d4 Refuse to use RunAsDaemon when torrc is a relative path. Fixes bug 229.
svn:r5767
2006-01-10 20:00:20 +00:00
Roger Dingledine
a45b131590 check for integer overflows in more places, when adding elements to
smartlists. this could possibly prevent a buffer overflow on malicious
huge inputs. i don't see any, but i haven't looked carefully.


svn:r5695
2006-01-02 04:40:18 +00:00
Nick Mathewson
0da2069643 Clearner fix for timegm assert problem.
svn:r5690
2006-01-01 23:13:19 +00:00
Nick Mathewson
04db9de847 Fix assertion-trigger bug found by sjmurdoch
svn:r5689
2006-01-01 23:09:19 +00:00
Roger Dingledine
6005e110b9 whitespace fixes
svn:r5682
2005-12-31 06:26:10 +00:00
Nick Mathewson
9482b1b9d5 Choose directory servers from routerstatus list, not from routerinfo list. This way, as soon was we have a networkstatus, we can ask a cache to give us routers, rather than needing to ask the directories.
svn:r5586
2005-12-14 22:00:58 +00:00
Nick Mathewson
7e6a41af93 Make hashtables use a little less space on 64-bit architectures.
svn:r5585
2005-12-14 21:10:06 +00:00
Nick Mathewson
1af630d32c Bite the bullet and limit all our source lines to 80 characters, the way IBM intended.
svn:r5582
2005-12-14 20:40:40 +00:00
Roger Dingledine
9b0a40ec78 crank the max line limit down to 150 chars.
svn:r5550
2005-12-10 08:27:01 +00:00
Nick Mathewson
a1bcdb2f76 util.c:1308: error: conflicting types for "is_internal_IP"
svn:r5545
2005-12-09 05:15:36 +00:00
Roger Dingledine
c0a6e2232c let is_internal_IP() know whether you're asking about an IP
address for connecting or an IP address for binding, because
in the latter, 0.0.0.0 is a special case.


svn:r5543
2005-12-09 02:45:33 +00:00
Nick Mathewson
e9b66ec906 Document CREATE_FAST better in the code. Move our key expansion algorithm into a separate function in crypto.c
svn:r5530
2005-12-08 17:38:32 +00:00
Nick Mathewson
cf5facf3e1 Do not free a constant string.
svn:r5527
2005-12-08 04:01:37 +00:00
Roger Dingledine
130d0e4d1d fix typo noticed by scrimbly
svn:r5522
2005-12-07 19:49:18 +00:00
Roger Dingledine
485b2cb4dc get rid of nick's crazy voodoo dh checking.
svn:r5518
2005-12-06 23:09:44 +00:00
Peter Palfrader
1bf56b452e Remove superfluous strdup
svn:r5503
2005-12-05 01:30:11 +00:00
Peter Palfrader
7a70a142f4 Also print usernames, not just numeric UIDs when we tell the user that his data directory has the wrong owner
svn:r5502
2005-12-05 01:28:10 +00:00
Roger Dingledine
8b0f1f029c give a hint when people are running tor as the wrong user, rather than
telling them to start chowning random directories.


svn:r5500
2005-12-05 01:07:58 +00:00
Nick Mathewson
ce3cdecb9d Make more arguments const; do not call hash tables trees.
svn:r5487
2005-12-03 02:00:51 +00:00
Nick Mathewson
4a0b6af935 Ive spent about 10 hours benchmarking permutations on our counter-mode implementation. This is the one that flies. (Avoid OpenSSL; optimizze rijndael calling convention to avoid needing to marshall and unmarshall counter.) This should speed up cell encryption by about 27%.
svn:r5486
2005-12-01 18:30:39 +00:00
Roger Dingledine
a6da372000 and its header
svn:r5478
2005-11-30 22:23:27 +00:00
Roger Dingledine
923ad87470 remove another unused function
svn:r5477
2005-11-30 22:19:02 +00:00
Roger Dingledine
77a425d8b2 Remove some functions that were around for hupping log files. We handle
them already in do_hup() by marking our log files as temporary and then
rotating them in options_init_from_torrc().


svn:r5473
2005-11-30 06:45:30 +00:00
Nick Mathewson
d56a65c497 Fix some verbose warnings and remove an unneeded include.
svn:r5472
2005-11-30 06:38:41 +00:00
Nick Mathewson
9cec3a13f5 remove some functions that are not used; #if0 out some files that are not likely to be used.
svn:r5471
2005-11-30 06:27:59 +00:00
Nick Mathewson
6b49a93bd5 Move code to check for zero digests into util.c
svn:r5468
2005-11-30 02:47:59 +00:00
Nick Mathewson
72cb64406a HT_NEXT invalidates the last iterator; fix rmv-related segfault.
svn:r5458
2005-11-26 00:42:25 +00:00
Roger Dingledine
b6b1b4f283 Bandaid workaround to make cvs not crash tor clients.
This is not a real fix. I didn't look at the rest of the code.
Nick?


svn:r5455
2005-11-25 02:16:10 +00:00
Nick Mathewson
05482a0899 Add functions to return number of elts in associative containers
svn:r5448
2005-11-23 07:48:13 +00:00
Nick Mathewson
a39269572f Replace balanced trees with hash tables: this should make stuff significantly faster.
svn:r5441
2005-11-23 04:18:45 +00:00
Roger Dingledine
8182eb69cd a smidgen more hint when we fail to seed the rng
svn:r5438
2005-11-21 01:12:01 +00:00
Nick Mathewson
83d6b0387b Try to build with OpenSSL 0.9.6. Lets pay attention to see if anybody complains.
svn:r5398
2005-11-16 05:22:44 +00:00
Nick Mathewson
6c361468c1 Loops without an increment step can suck, even on windows.
svn:r5376
2005-11-15 03:16:32 +00:00
Nick Mathewson
9b432311c4 Make new logging stuff work on windows; fix a couple of windows typos.
svn:r5375
2005-11-15 03:05:23 +00:00
Nick Mathewson
e022aa73e6 Hm; looks like the callback business was unnecessary, since DHparams_dup() copies dh->length.
svn:r5372
2005-11-14 21:17:38 +00:00
Nick Mathewson
027d0ef18c Use a callback to set our DH parameters; set SSL_OP_SINGLE_DH_USE.
svn:r5371
2005-11-14 19:20:47 +00:00
Nick Mathewson
887178e710 Oops. It looks like there *was* an easy way to make openssl do what we wanted.
svn:r5370
2005-11-14 19:18:31 +00:00
Roger Dingledine
ed4f15b2a7 When logging via syslog, include the pid whenever we provide
a log entry. Suggested by Todd Fries.


svn:r5366
2005-11-13 22:28:07 +00:00
Roger Dingledine
5ef2927870 correct nick's comment
svn:r5360
2005-11-11 21:44:38 +00:00
Nick Mathewson
f14743a975 Note that much of check_dh_key is voodoo; make x in DH be only 320 bits for DH speed improvement: this wants auditing. [We have blessing from Ian on this.] (Note that DH in SSL is not yet affected.)
svn:r5359
2005-11-11 20:18:00 +00:00
Roger Dingledine
87e8e7b4fa using an unsigned int for something that requires at least 3 bytes
makes me uncomfortable.


svn:r5340
2005-11-01 06:15:48 +00:00
Roger Dingledine
c68cadc0c8 tor_assert had a misleading comment
svn:r5338
2005-11-01 06:12:51 +00:00
Roger Dingledine
a2a4f4ae61 cleanups and a smidgen more docs
svn:r5335
2005-11-01 03:47:55 +00:00
Nick Mathewson
3c36a14ba6 Call ERR_remove_state() on the main thread on shutdown,too
svn:r5322
2005-10-26 02:20:48 +00:00
Nick Mathewson
9492424d3f Per comments at the bottom of openssl/FAQ, call even more functions to
clean up OpenSSL's toys when it's done playing.  (Why isn't there an
OpenSSL_free_everything() function?)


svn:r5321
2005-10-25 19:01:48 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Roger Dingledine
d7e136240a consistency is the hobgoblin of little armas
svn:r5316
2005-10-25 17:58:43 +00:00
Nick Mathewson
049f6c0131 Switch remaining files to new log interface.
svn:r5315
2005-10-25 17:52:14 +00:00
Nick Mathewson
7a9774eff0 Also here.
svn:r5314
2005-10-25 17:42:09 +00:00
Peter Palfrader
0738c24b97 Fix log levels notice and warn for new logging stuff
svn:r5313
2005-10-25 17:41:43 +00:00
Nick Mathewson
e7e170a59e Change more files to new loggin interface. 3 left.
svn:r5310
2005-10-25 08:20:10 +00:00
Nick Mathewson
932106f54c Efficiency hack: call tor_fix_source_file late, not early. Add "BUG" domain. Domains are now bitmasks... just in case. Make some err msgs non-general.
svn:r5309
2005-10-25 07:05:03 +00:00
Nick Mathewson
beaf898fe5 add more domains
svn:r5300
2005-10-24 19:36:43 +00:00
Nick Mathewson
a20835ac92 Check for even more windows version flags, and note any we do not recognize.
svn:r5297
2005-10-24 18:37:09 +00:00
Nick Mathewson
1bd3f6cc9a Update more files to new log stuff.
svn:r5286
2005-10-18 22:56:40 +00:00
Nick Mathewson
55f2ab9cc3 Migrate a few more files to domained logging
svn:r5285
2005-10-18 22:21:29 +00:00
Nick Mathewson
edf5698474 Start dividing log messages into logging domains. No, LD_ is not the best of identifiers. src/or has not been converted yet. Domains dont do anything yet.
svn:r5284
2005-10-18 21:58:19 +00:00
Nick Mathewson
5828f8920e Add a "Map from digest to void*" abstraction, since we already faked it in 3 places by encoding keys in hex and sticking them in a strmap.
svn:r5278
2005-10-18 20:11:39 +00:00
Nick Mathewson
0349598928 stupid gcc. stupid nickm.
svn:r5277
2005-10-18 17:52:45 +00:00