Alexander Færøy
dc2384da30
Fix potential memory leak in hs_helper_build_hs_desc_impl().
...
This patch fixes a memory leak in hs_helper_build_hs_desc_impl() where
if a test assertion would fail we would leak the storage that `desc`
points to.
See: Coverity CID 1437448
2018-06-23 10:27:10 +02:00
Alexander Færøy
ce5d055ed7
Fix memory leak in pick_hsdir_v3().
...
This patch fixes a memory leak in pick_hsdir_v3() where we might return
early, but forgot to free the responsible_hsdirs variable. We solve this
by not allocating storage for responsible_hsdirs until it's actually
needed.
See: Coverity CID 1437449
2018-06-23 03:40:32 +02:00
Alexander Færøy
1724f995c7
Fix potential memory leak in test_hs_auth_cookies().
...
This patch fixes a potential memory leak in test_hs_auth_cookies() if a
test-case fails and we goto the done label where no memory clean up is
done.
See: Coverity CID 1437453
2018-06-23 03:17:09 +02:00
Alexander Færøy
8c8941eb29
Fix potential memory leak in hs_helper_build_intro_point().
...
This patch fixes a potential memory leak in
hs_helper_build_intro_point() where a `goto done` is called before the
`intro_point` variable have been assigned to the value of the `ip`
variable.
See: Coverity CID 1437460
See: Coverity CID 1437456
2018-06-23 02:29:54 +02:00
Nick Mathewson
1b93b065fc
Make an inline static so we can build with coverage enabled.
2018-06-22 14:11:37 -04:00
Nick Mathewson
405fa42e8a
Another windows include
2018-06-22 13:52:30 -04:00
Nick Mathewson
4b32446a4c
We also need torerr in tm_cvt.
2018-06-22 13:34:35 -04:00
Nick Mathewson
145665abcb
Add another include for windows, and change a log to a raw_assert
2018-06-22 13:33:48 -04:00
Nick Mathewson
76a717890e
Remove an "m" that did not belong.
2018-06-22 13:32:47 -04:00
Nick Mathewson
4118ba67db
Update the micro-revision.i dependencies, and add a stdlib.h
2018-06-22 13:25:58 -04:00
Nick Mathewson
cf66544941
Two more small changes for CI.
2018-06-22 13:10:52 -04:00
Nick Mathewson
7aecea79cb
A pair of missing includes.
2018-06-22 12:53:57 -04:00
Nick Mathewson
b0adf2fc9b
Fix up the rust build script library list.
2018-06-22 12:04:11 -04:00
Nick Mathewson
bcf3e546d1
Move util_bug into libtor-log
2018-06-22 11:54:38 -04:00
Nick Mathewson
6fc2d53227
Remove util_bug dependency on compat.h
2018-06-22 11:51:58 -04:00
Nick Mathewson
7a93ce8f63
Update .gitignore and .may_include files
2018-06-22 11:46:44 -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
90a09df5ba
Extract strlcpy and strlcmp to libtor-string
2018-06-22 11:18:19 -04:00
Nick Mathewson
bfb39164ce
Extract core part of gmtime_r, localtime_r (without logging)
2018-06-22 11:17:11 -04:00
Nick Mathewson
b2d4e786b7
Remove the util_bug.h include from smartlist.h.
...
This change makes a whole bunch of things in torlog.c break, since
apparently I did not find all the fd dependencies.
2018-06-22 10:50:14 -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
1e07b4031e
Move ARRAY_LENGTH to compiler_compat.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
0932f32291
Remove compat.h as unneeded from log.c and torlog.h
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
d1cada5a8a
Update permissible includes
2018-06-22 09:49:13 -04:00
Nick Mathewson
c2a558a346
Expunge container.h
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
9cf6fc91b1
Remove map from container.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
50a5954003
Remove bloom filters, order statistics, and bitarrays from container.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
932b4d0a43
Remove container->crypto dependency
...
Containers were using crypto_digest.h, just to see the value of
DIGEST_LEN. Moved those constants into a new defs module.
2018-06-22 09:49:13 -04:00
Nick Mathewson
479c2ab503
Move STRUCT_VAR_P to compat_compiler.
2018-06-22 09:49:13 -04:00
Nick Mathewson
657ff55408
Split container.c based on container types, and minimize includes
...
Minimizing includes revealed other places includes were necessary.
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
77dff00b18
Refactor container into a library.
2018-06-22 09:49:13 -04:00
Taylor Yu
81e6c53a3e
Add Travis jobs for non-hardened Rust
...
Right now we're having trouble getting Rust builds to succeed if
fragile hardening is enabled. Add new mandatory jobs to make sure at
least some Rust testing happens in Travis.
Fixes bug 26449; bug not in any released tor.
2018-06-21 22:30:05 -05:00
Taylor Yu
d935aceb2b
Use correct CARGO_HOME in test_rust.sh
...
Out-of-tree builds could fail to run the rust tests if built in
offline mode. cargo expects CARGO_HOME to point to the .cargo
directory, not the directory containing .cargo.
Fixes bug 26455; bug not in any released tor.
2018-06-21 18:20:03 -05: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
eb784aa9ea
add license statement to checkincludes, and have it return an error code
2018-06-21 14:29:00 -04:00
Nick Mathewson
56c1fbf33f
Use the "commands" argument of AC_CONFIG_FILES to make scripts +x
...
Closes ticket 26439.
2018-06-21 14:26:47 -04:00
Nick Mathewson
8dcc015975
Fix wide lines in dirauth/dirvote.*
2018-06-21 14:23:32 -04:00
Nick Mathewson
7f2dbbe585
Make sure check-spaces applies in lib and dirauth.
2018-06-21 14:22:15 -04:00
Nick Mathewson
946428d273
Run checkIncludes.py from "make check-includes"
2018-06-21 14:20:43 -04:00
Nick Mathewson
999f7984e1
New script to check includes for modularity violations
...
Includes configuration files to enforce these rules on lib and
common. Of course, "common" *is* a modularity violation right now,
so these rules aren't as strict as I would like them to be.
2018-06-21 14:05:33 -04:00
Nick Mathewson
8918bd90e9
Merge branch 'extract_easy_common_libs'
2018-06-21 13:57:13 -04:00
Nick Mathewson
3305ae5044
Rectify include paths (automated).
...
You have no idea how glad I am that this is automated.
2018-06-21 13:20:07 -04:00