Commit Graph

1887 Commits

Author SHA1 Message Date
Nick Mathewson
fdbb9cdf74 Add a sha256 hmac function, with tests 2011-10-10 23:14:09 -04:00
Nick Mathewson
c0bbcf138f Turn X509 certificates into a first-class type and add some functions 2011-10-10 23:14:02 -04:00
Nick Mathewson
dcf69a9e12 New function to get all digests of a public key 2011-10-10 23:14:02 -04:00
Sebastian Hahn
cce85c819b Fix a compile warning on OS X 10.6 and up 2011-10-11 02:25:00 +02:00
Nick Mathewson
6a673ad313 Add a missing comma in tor_check_port_forwarding
My fault; fix for bug 4213.
2011-10-10 11:42:05 -04:00
Nick Mathewson
ed39621a9d Merge remote-tracking branch 'asn2/bug3656'
Conflicts:
	src/common/util.c
	src/common/util.h
	src/or/config.h
	src/or/main.c
	src/test/test_util.c
2011-10-07 16:05:13 -04:00
George Kadianakis
3be9d76fa2 Make it compile on Windows™. 2011-10-07 15:44:44 +02:00
Nick Mathewson
2725a88d5e Merge remote-tracking branch 'origin/maint-0.2.2' 2011-10-03 15:19:00 -04:00
Sebastian Hahn
103c861dfe Looks like Windows version 6.2 will be Windows 8
Thanks to funkstar for the report
2011-10-01 14:50:44 +02:00
Nick Mathewson
41dfc4c19c Make bufferevents work with TokenBucketRefillInterval 2011-09-22 15:07:34 -04:00
Nick Mathewson
40288e1e66 Merge remote-tracking branch 'origin/maint-0.2.2' 2011-09-20 10:25:56 -04:00
Mansour Moufid
1ba90ab655 Fix a potentially useless integer overflow check.
GCC 4.2 and maybe other compilers optimize away unsigned integer
overflow checks of the form (foo + bar < foo), for all bar.

Fix one such check in `src/common/OpenBSD_malloc_Linux.c'.
2011-09-20 09:52:44 -04:00
George Kadianakis
2e73f9b3ee Put some sense into our logging.
Transform our logging severities to something more sensible.
Remove sneaky printf()s.
2011-09-12 00:10:07 +02:00
George Kadianakis
de7565f87f Make check-spaces happy. 2011-09-11 23:34:36 +02:00
George Kadianakis
c6811c57cb Enforce transport names being C identifiers.
Introduce string_is_C_identifier() and use it to enforce transport
names according to the 180 spec.
2011-09-11 23:34:11 +02:00
George Kadianakis
782810a8bf Introduce tor_terminate_process() function. 2011-09-11 20:26:01 +02:00
Nick Mathewson
a41f1fc612 Merge remote-tracking branch 'origin/maint-0.2.2'
Conflicts:
	configure.in
	src/or/circuitbuild.c
2011-09-09 12:58:12 -04:00
Steven Murdoch
cfa9ee5fe7 Fix double-closing a stdio stream
After a stream reached eof, we fclose it, but then
test_util_spawn_background_partial_read() reads from it again, which causes
an error and thus another fclose(). Some platforms are fine with this, others
(e.g. debian-sid-i386) trigger a double-free() error. The actual code used by
Tor (log_from_pipe() and tor_check_port_forwarding()) handle this case
correctly.
2011-09-01 14:15:54 +01:00
Nick Mathewson
6a3e4a89a2 Tweaks on last process-launch patches 2011-08-31 22:14:38 -04:00
Steven Murdoch
5b8a20ed44 Make a version of tor_read_all_handle() for non-Windows platforms
Mainly used for testing reading from subprocesses. To be more generic
we now pass in a pointer to a process_handle_t rather than a Windows-
specific HANDLE.
2011-09-01 01:43:44 +01:00
Nick Mathewson
a7c07605d0 Add a missing include to util.c to get waitpid() on Linux 2011-08-31 00:36:43 -04:00
Nick Mathewson
0ac4b0f99d Check for lround with autoconf; fall back to rint. 2011-08-30 22:22:15 -04:00
Sebastian Hahn
03760f6c6f Fix a compilation issue on older FreeBSDs 2011-08-30 20:45:49 -04:00
Nick Mathewson
2778cdd671 Rename tor_join_cmdline to tor_join_win_cmdline; tweak doxygen 2011-08-30 16:00:08 -04:00
Nick Mathewson
4f585b9ee2 Merge remote-tracking branch 'sjmurdoch/bug2046' 2011-08-30 15:51:45 -04:00
Steven Murdoch
d1dd9991cd Document limitation of log_from_handle with partial reads 2011-08-30 15:02:28 +01:00
Steven Murdoch
da34360952 Factor out and re-write code for splitting lines from a handle
Now handles non-printable characters and will not output a spurious
new-line if given a partial line.
2011-08-30 14:55:51 +01:00
Steven Murdoch
bc97f41080 Refactor out command line formatting
Now correctly handles whitespace, quotes and backslashes. Passes all unit tests.
2011-08-29 14:37:38 +01:00
Steven Murdoch
93792b5aa6 Add a sanity check 2011-08-29 00:36:41 +01:00
Steven Murdoch
f1ff65dfad Replace two magic tristates with #define'd names
- process_handle_t.status
- return value of tor_get_exit_code()
2011-08-29 00:30:18 +01:00
Steven Murdoch
3f0a197aad Make signature of tor_spawn_background more conventional
Conventionally in Tor, structs are returned as pointers, so change
tor_spawn_background() to return the process handle in a pointer rather
than as return value.
2011-08-28 23:35:02 +01:00
Nick Mathewson
f186e16241 Add write watermarks to filtered bufferevents. 2011-08-24 17:31:37 -04:00
Nick Mathewson
59d0f750c9 Apply rate-limiting to the lowest bufferevent in the stack.
When we're doing filtering ssl bufferevents, we want the rate-limits
to apply to the lowest level of the bufferevent stack, so that we're
actually limiting bytes sent on the network. Otherwise, we'll read
from the network aggressively, and only limit stuff as we process it.
2011-08-24 17:31:32 -04:00
Steven Murdoch
1da5081ae0 Appease "make check-spaces" 2011-08-24 21:34:13 +01:00
Steven Murdoch
50b48c3ea7 Improve comments and fix one bug 2011-08-24 21:33:53 +01:00
Steven Murdoch
476807211c We don't need to find our own path, just tell Windows to search 2011-08-24 20:50:58 +01:00
Nick Mathewson
ede9cd4f99 Merge remote-tracking branch 'origin/maint-0.2.2' 2011-08-24 13:53:17 -04:00
Gisle Vanem
5939c09d35 lround() missing in MSVC
lround() is missing in MS Visual-C's <math.h>. Not available anywhere.
Here is an easy patch.
2011-08-24 13:52:44 -04:00
Steven Murdoch
2efafdfe14 Fix compilation errors under *nix 2011-08-23 01:09:24 +01:00
Steven Murdoch
1ad986335a Tidy up subprocess code
- Better error handling
- Write description of functions
- Don't assume non-negative process return values
2011-08-22 19:43:38 +01:00
Steven Murdoch
f46f6aabb4 Fix some compiler warnings 2011-08-22 18:13:58 +01:00
Steven Murdoch
6443a756df Merge branch 'bug1983-port-tor-fw-helper-to-windows' into bug2046
Conflicts:
	configure.in
	src/tools/tor-fw-helper/Makefile.am
	src/tools/tor-fw-helper/tor-fw-helper-upnp.c
	src/tools/tor-fw-helper/tor-fw-helper.c
2011-08-22 17:53:17 +01:00
Nick Mathewson
d3653063d3 Automatically use filtering bufferevents with IOCP. 2011-08-18 15:16:05 -04:00
Steven Murdoch
cc5b6d6cee Merge remote branch 'origin/master' into bug2046 2011-08-18 18:42:02 +01:00
Steven Murdoch
7d015c886a Complete logging of output from port forwarding helper 2011-08-18 18:41:23 +01:00
Nick Mathewson
52e36feda1 Call evthread_use_windows_threads when running with IOCP on windows 2011-08-17 14:44:16 -04:00
Sebastian Hahn
6a06f45b04 Actually pick a random port when "auto" is specified
ddc65e2b33 had broken this
2011-08-17 10:41:36 -04:00
George Kadianakis
db4cde3810 Improve the code a tad.
* Use strcmpstart() instead of strcmp(x,y,strlen(y)).
* Warn the user if the managed proxy failed to launch.
* Improve function documentation.
* Use smartlist_len() instead of n_unconfigured_proxies.
* Split managed_proxy_destroy() to managed_proxy_destroy()
  and managed_proxy_destroy_with_transports().
* Constification.
2011-08-15 17:26:03 +02:00
Sebastian Hahn
f137ae896e Don't warn on http connection to my orport
Also remove a few other related warnings that could occur during the ssl
handshake. We do this because the relay operator can't do anything about
them, and they aren't their fault.
2011-08-11 20:37:51 +02:00
Nick Mathewson
b76f46c6d8 Merge branch 'bug1692-squashed' 2011-08-10 15:04:36 -04:00