summaryrefslogtreecommitdiff
path: root/src/common/util.h
AgeCommit message (Collapse)Author
2015-07-31Move formatting functions around.Nick Mathewson
The base64 and base32 functions used to be in crypto.c; crypto_format.h had no header; some general-purpose functions were in crypto_curve25519.c. This patch makes a {crypto,util}_format.[ch], and puts more functions there. Small modules are beautiful!
2015-05-07Merge branch 'writing_tests'Nick Mathewson
2015-05-07Write the outlines of a WritingTests.txt documentNick Mathewson
Also, add some sample tests to be examples.
2015-04-01Merge branch 'remove_digests'Nick Mathewson
2015-04-01Drop support for --digestsNick Mathewson
This is a fair amount of maintainance burden, and doesn't help much more than the git microversion. Closes ticket 14742.
2015-03-26Implement "TOR_PT_EXIT_ON_STDIN_CLOSE".Yawning Angel
Background processes spawned by Tor now will have a valid stdin. Pluggable transports can detect this behavior with the aformentioned enviornment variable, and exit if stdin ever gets closed.
2015-03-21Disable assertions during coverage buildsSebastian Hahn
This removes roughly 5000 branches in my testing. We never want to trigger assertions even during tests, so this is sane. Implements #15400.
2015-02-17Remove tor_strclear(), and replace previous calls with memwipe().Yawning Angel
2015-02-02Add more parenthesis to the definition of ARRAY_LENGTHNick Mathewson
2015-01-28Bug #8405: Report SOCKS username/password in CIRC status eventsArthur Edelstein
Introduces two new circuit status name-value parameters: SOCKS_USERNAME and SOCKS_PASSWORD. Values are enclosing in quotes and unusual characters are escaped. Example: 650 CIRC 5 EXTENDED [...] SOCKS_USERNAME="my_username" SOCKS_PASSWORD="my_password"
2015-01-15Restrict sample values of the Laplace distribution to int64_t.George Kadianakis
This helps avoid undefined behavior from casting big double values to int64_t. Fixes #14090.
2015-01-10Merge branch 'master' of https://git.torproject.org/tor into ↵teor
bug13111-empty-key-files-fn-empty Conflicts: src/or/connection_edge.c Merged in favour of origin.
2015-01-10Merge branch 'bug14001-clang-warning' into bug13111-empty-key-files-fn-emptyteor
Conflicts: src/or/router.c Choose newer comment. Merge changes to comment and function invocation.
2015-01-07Merge branch 'bug9286_v3_squashed'Nick Mathewson
2015-01-07Stop accepting milliseconds in various directory contextsNick Mathewson
Have clients and authorities both have new behavior, since the fix for bug 11243 has gone in. But make clients still accept accept old bogus HSDir descriptors, to avoid fingerprinting trickery. Fixes bug 9286.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-10Add better support to obfuscate statistics.Karsten Loesing
2014-11-08Stop failing when key files are zero-lengthteor
Instead, generate new keys, and overwrite the empty key files. Adds FN_EMPTY to file_status_t and file_status. Fixes bug 13111. Related changes due to review of FN_FILE usage: Stop generating a fresh .old RSA key file when the .old file is missing. Avoid overwriting .old key files with empty key files. Skip loading zero-length extra info store, router store, stats, state, and key files.
2014-11-05Merge remote-tracking branch 'meejah/ticket-11291-extra-utests'Nick Mathewson
Conflicts: src/or/config.c
2014-11-04Merge branch 'bug13315_squashed'Nick Mathewson
Conflicts: src/or/buffers.c
2014-11-04Adding helper function that checks if string is a valid IPv6 address.rl1987
2014-11-04Introducing helper function to validate IPv4 address strings.rl1987
2014-11-04Introducing helper function to validate DNS name strings.rl1987
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-02Fix white spaceDavid Stainton
2014-08-30Clean up patchDavid Stainton
Here I clean up anon's patch with a few of nickm's suggestions from comment 12: https://trac.torproject.org/projects/tor/ticket/11291#comment:12 I did not yet completely implement all his suggestions.
2014-08-30Ticket #11291: patch from "anon":anonymous
test-11291-group-redable-hsdirs-wtests-may8.patch
2014-08-13Add reallocarray clone so we can stop doing multiply-then-reallocateNick Mathewson
2014-06-14Use waitpid code to learn when a controlled process diesNick Mathewson
This lets us avoid sending SIGTERM to something that has already died, since we realize it has already died, and is a fix for the unix version of #8746.
2013-11-18Merge branch 'backtrace_squashed'Nick Mathewson
Conflicts: src/common/sandbox.c src/common/sandbox.h src/common/util.c src/or/main.c src/test/include.am src/test/test.c
2013-11-18Refactor format_*_number_sigsafe to have a common implementationNick Mathewson
2013-11-15Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
Conflicts: src/or/relay.c Conflict changes were easy; compilation fixes required were using using TOR_SIMPLEQ_FIRST to get head of cell queue.
2013-11-15Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/or.h src/or/relay.c Conflicts were simple to resolve. More fixes were needed for compilation, including: reinstating the tv_to_msec function, and renaming *_conn_cells to *_chan_cells.
2013-10-11Merge branch 'bug1376'Nick Mathewson
2013-09-13Merge remote-tracking branch 'ctoader/gsoc-cap-stage2'Nick Mathewson
Conflicts: src/common/sandbox.c
2013-09-01Added no_tempfile parameter to write_chunks_to_file to do non-atomic writes. ↵Kevin Butler
Implements #1376.
2013-08-15Merge branch 'bug5040_4773_rebase_3'Nick Mathewson
2013-08-15Test ExtORPort cookie initialization when file writing is broken.George Kadianakis
2013-08-05fixes suggested by nickmCristian Toader
2013-07-31Merge branch 'bug9288_rebased'Nick Mathewson
Conflicts: src/test/test_pt.c
2013-07-31Prepare some mock functions to test #9288.George Kadianakis
2013-07-19Refactor the assertion-failure code into a functionNick Mathewson
2013-07-19Add a signal-safe decimal formatting functionNick Mathewson
2013-07-18Rename tor_escape_str_for_socks_arg() to something more generic.George Kadianakis
Since we are going to be using that function to also escape parameters passed to transport proxies using environment variables.
2013-07-18Pass characters to be escaped to tor_escape_str_for_socks_arg().George Kadianakis
This is in preparation for using tor_escape_str_for_socks_arg() to escape server-side pluggable transport parameters.
2013-07-15Expose format_hex_number_..., and rename it to ..._sigsafe().Nick Mathewson
There are some other places in the code that will want a signal-safe way to format numbers, so it shouldn't be static to util.c.
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-06-14Instead of testing for __GNUC__, use CHECK_SCANF, like CHECK_PRINTF.dana koch
This lets us have the possibility of fine-tuning the check in the tor_sscanf test cases at a later date.
2013-04-17Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-04-17Merge branch 'bug8037_squashed' into maint-0.2.4Nick Mathewson