Nick Mathewson
7159edf909
Move the escape-for-log code into src/lib/log
...
It doesn't need anything higher-level, and everything that needs the
logs potentially needs this.
2018-06-26 20:51:17 -04:00
Nick Mathewson
79f73ab330
Finally extract the log library and make it build.
...
This patch:
- introduces an fdio module for low-level fd functions that don't
need to log.
- moves the responsibility for opening files outside of torlog.c,
so it won't need to call tor_open_cloexec.
2018-06-22 11:40:20 -04:00
Nick Mathewson
da4ae8a6b6
Automated fixup of include paths after torlog.h movement.
2018-06-22 10:32:10 -04:00
Nick Mathewson
97b15a1d7c
Extract the locking and logging code
...
The locking code gets its own module, since it's more fundamental
than the higher-level locking code.
Extracting the logging code was the whole point here. :)
2018-06-22 10:31:51 -04:00
Nick Mathewson
2cf033f238
Extract simple integer math into its own module
2018-06-22 09:49:13 -04:00
Nick Mathewson
3883338c81
Move smartlist_add_{v,}asprintf into smartlist.[ch]
...
Now that I know that "strings" nests below "container", I know this
is safe.
2018-06-22 09:49:13 -04:00
Nick Mathewson
1abadee3fd
Extract key string manipulation functions into a new library.
2018-06-22 09:49:13 -04:00
Nick Mathewson
9426751b72
Extract our code for answering "what time is it right now".
...
The other time stuff is higher-level
2018-06-22 09:49:13 -04:00
Nick Mathewson
de508c5f50
Extract smartlist.h from container.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
b8be8265b6
Rectify include paths after container split (automatic)
2018-06-22 09:49:13 -04:00
Nick Mathewson
f95e3bf5fc
Simplify include structure of container.[ch]
2018-06-21 15:33:25 -04:00
Nick Mathewson
e066966bf4
Extract tor_malloc and friends to a new module.
2018-06-21 15:20:01 -04:00
Nick Mathewson
accf239fa3
Rectify include paths (automated)
2018-06-21 13:19:00 -04:00
Nick Mathewson
fa5fda5bbf
Rectify include paths (automated)
2018-06-21 13:14:14 -04:00
Nick Mathewson
275aff6917
Rectify include paths (automated)
2018-06-21 10:47:11 -04:00
Nick Mathewson
72a5ae8c66
Merge branch 'maint-0.3.4'
2018-06-21 08:38:21 -04:00
Nick Mathewson
8f3712cf6e
eol@eof is still the law in 0.3.4 :(
2018-06-20 19:05:11 -04:00
Nick Mathewson
f24797a587
Merge branch 'maint-0.3.4'
2018-06-20 17:49:56 -04:00
Nick Mathewson
f91ea506f0
Fix clang warnings introduced by 9f2b887c5d
2018-06-20 17:49:06 -04:00
Nick Mathewson
057d838409
Use raw_assert() in write_all().
...
This makes tor_log() finally non-circular.
2018-06-20 16:16:45 -04:00
Nick Mathewson
7a2dce9006
Use raw_assert() in central allocation functions.
...
This is, again, to avoid circularity in the log code.
2018-06-20 16:16:45 -04:00
Nick Mathewson
5ecd1fec15
Move horrible-emergency handling into torerr.[ch]
...
Previously we had code like this for bad things happening from
signal handlers, but it makes sense to use the same logic to handle
cases when something is happening at a level too low for log.c to be
involved.
My raw_assert*() stuff now uses this code.
2018-06-20 15:08:06 -04:00
Nick Mathewson
90aeaa53cd
Remove all use of the assert.h header
...
Nothing in Tor has actually called assert() for some while.
2018-06-20 10:39:07 -04:00
Nick Mathewson
9fa73003fc
Remove dmalloc support; closes #26426
...
Dmalloc hasn't seen a release in over a decade, and there are much
better tools to use these days.
2018-06-20 10:21:34 -04:00
Nick Mathewson
0dab29ce10
Run rectify_include_paths.py
2018-06-20 09:35:05 -04:00
Nick Mathewson
fb0019daf9
Update copyrights to 2018.
2018-06-20 08:13:28 -04:00
rl1987
39bbb8d9cf
Avoid casting smartlist index implicitly
2018-06-04 11:56:37 +03:00
Nick Mathewson
cd3fc2aa48
Merge remote-tracking branch 'neel/b25511-r4'
2018-04-23 09:13:24 -04:00
Neel Chauhan
9e3e1b8bfb
Add format_local_iso_time_nospace()
2018-04-16 20:37:50 -04:00
Mike Perry
0e06a9c3e7
Helper function to add u32 without overflow.
2018-04-16 21:46:31 +00:00
Nick Mathewson
d3b9b5a3dd
Remove windows log_from_handle as unused.
...
This function was only used by PortForwardingHelper, which was
removed in 9df110cd72 . Its presence caused warnings on windows.
2018-04-12 12:38:46 -04:00
Neel Chauhan
9df110cd72
Remove PortForwarding options
...
Signed-off-by: Isis Lovecruft <isis@torproject.org >
2018-04-04 00:19:33 +00:00
Nick Mathewson
6317aa2cc0
Merge branch 'maint-0.3.3'
2018-03-28 07:50:47 -04:00
Nick Mathewson
d4bf1f6c8e
Add a paranoia check in string_is_valid_nonrfc_hostname()
...
The earlier checks in this function should ensure that components is
always nonempty. But in case somebody messes with them in the
future, let's add an extra check to make sure we aren't crashing.
2018-03-28 07:48:18 -04:00
Nick Mathewson
b504c854d3
Rename string_is_valid_hostname -> string_is_valid_nonrfc_hostname
...
Per discussion on 25055.
2018-03-28 07:42:27 -04:00
rl1987
09351c34e9
Don't strlen before checking for NULL
2018-03-28 07:39:03 -04:00
rl1987
a28e350cff
Tweak loop condition
2018-03-28 07:39:03 -04:00
rl1987
6b6d003f43
Don't explode on NULL or empty string
2018-03-28 07:39:03 -04:00
rl1987
ee1fca727c
Simplify hostname validation code
2018-03-28 07:39:03 -04:00
rl1987
dbb7c8e6fd
Validate hostnames with punycode TLDs correctly
2018-03-28 07:39:03 -04:00
rl1987
4413e52f9e
Improve handling of trailing dot
2018-03-28 07:39:03 -04:00
rl1987
6335db9fce
Refrain from including <ctype.h>
2018-03-28 07:39:03 -04:00
rl1987
5986589b48
Call strlen() once
2018-03-28 07:39:03 -04:00
rl1987
b0ba4aa7e9
Fix bracketed IPv6 string validation
2018-03-28 07:39:03 -04:00
rl1987
1af016e96e
Do not consider IP strings valid DNS names. Fixes #25055
2018-03-28 07:39:03 -04:00
rl1987
0e453929d2
Allow IPv6 address strings to be used as hostnames in SOCKS5 requests
2018-03-28 07:39:03 -04:00
Nick Mathewson
0eed0899cd
Merge branch 'bug24658-rm-curve25519-header' into bug24658-merge
2018-03-26 20:12:59 -04:00
Deepesh Pathak
ca6682f3f8
Fix spelling mistakes corresponding to ticket #23650
2018-02-07 10:41:57 -05:00
Fernando Fernandez Mancera
61c7ec29f1
Include crypto_digest.h in order to solve dependency issues.
...
Included crypto_digest.h in some files in order to solve xof+digest module
dependency issues. Removed crypto.h where it isn't needed anymore.
Follows #24658 .
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net >
2018-02-03 17:04:36 +01:00
Nick Mathewson
c92ac9f5cb
Convert the rest of src/common's headers to use FREE_AND_NULL
2017-12-08 14:47:19 -05:00