Commit Graph

182 Commits

Author SHA1 Message Date
Nick Mathewson
56c54a66bd Fix a memory leak in handling GETINFO.
Fixes bug 33103; bugfix on 0.4.3.1-alpha.
2020-02-05 19:18:32 -05:00
Taylor Yu
f7a2b98674 fix leak in GETCONF
Fix a memory leak introduced by refactoring of control reply
formatting code.  Fixes bug 33039; bugfix on 0.4.3.1-alpha.
2020-01-24 12:20:47 -06:00
Nick Mathewson
3c89622e39 Merge branch 'ticket32487_squashed' into ticket32487_squashed_and_merged
Resolved conflicts in src/core/include.am
2020-01-16 07:57:37 -05:00
Nick Mathewson
fe8156dbc2 Move dirserv_get_routerdescs() to control_getinfo.c
This function had some XXX comments indicating (correctly) that it
was not actually used by the dirserver code, and that only the
controller still used it.
2020-01-16 07:48:17 -05:00
Nick Mathewson
73ac1add3f Split core/include.am into per-subdirectory include.am files
Closes ticket 32137.
2020-01-13 09:34:17 -05:00
Nick Mathewson
e45810113b Merge branch 'pre_formatter_cleanups_squashed' 2020-01-09 07:32:39 -05:00
Nick Mathewson
8d4b4aa932 control_hs.h: use a couple of struct delcarations
Doing this frees us from some assumptions about include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
4f02812242 It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
Nick Mathewson
1b63eea66c Merge branch 'haxxpop/tcp_proxy_squashed' into tcp_proxy_squshed_and_merged 2020-01-06 13:41:20 -05:00
Suphanat Chunhapanya
119004e87d circuit: Implement haproxy 2020-01-06 13:39:10 -05:00
teor
57b6678d52 Run "make autostyle" 2019-12-20 09:45:53 +10:00
Taylor Yu
bfe38878b2 Rename control_reply_add_1kv
Part of ticket 30984.
2019-12-09 09:55:04 -06:00
Taylor Yu
9b196f1563 simplify getinfo using reply lines
Simplify handle_control_getinfo() by using the new reply lines
abstraction.  Previously, this function explicitly checked for whether
it should generate a MidReplyLine, a DataReplyLine, or an
EndReplyLine.  control_write_reply_lines() now abstracts this check.

Part of #30984.
2019-12-08 22:40:00 -06:00
Taylor Yu
a08f43ba04 use control reply lines for protocolinfo
Simplify handle_control_protocolinfo() by using the new reply line
abstraction.

Part of #30984.
2019-12-08 22:40:00 -06:00
Taylor Yu
2143bae6c4 refactor handle_control_protocolinfo
Factor out the parts of handle_control_protocolinfo() that assemble
the AUTHMETHODS and COOKIEFILE strings.

Part of #30984.
2019-12-08 22:40:00 -06:00
Taylor Yu
c744d23c8d simplify getconf by using reply lines
In handle_control_getconf(), use the new control reply line
abstraction to simplify output generation.  Previously, this function
explicitly checked for whether it should generate a MidReplyLine or an
EndReplyLine.  control_write_reply_lines() now abstracts this check.

Part of #30984.
2019-12-08 22:40:00 -06:00
Taylor Yu
1a68a18093 reply lines structures
Part of #30984.
2019-12-08 22:40:00 -06:00
Nick Mathewson
fcb5656128 Merge branch 'ticket32609_squashed' 2019-12-04 12:15:28 -05:00
teor
9ad569c71d practracker: Add missing .may_include files
All of these files contain "*.h", except for:
* src/app/config/.may_include
* src/test/.may_include
which also contain "*.inc".

This change prevents includes of "*.c" files, and other
unusually named files.

Part of 32609.
2019-12-04 12:15:22 -05:00
George Kadianakis
2693bf47e8 control-port: Include HS address in ONION_CLIENT_AUTH_VIEW reply. 2019-12-04 13:33:07 +02:00
David Goulet
65759f2901 Merge branch 'tor-github/pr/1563' 2019-12-03 09:22:21 -05:00
George Kadianakis
9395a0c765 hsv3: Remove support for client auth nicknames.
Because the function that parses client auth credentials saved on
disk (parse_auth_file_content()) is not future compatible, there is no way to
add support for storing the nickname on the disk. Hence, nicknames cannot
persist after Tor restart making them pretty much useless.

In the future we can introduce nicknames by adding a new file format for client
auth credentials, but this was not deemed worth doing at this stage.
2019-12-03 09:22:17 -05:00
George Kadianakis
70572b9abd hsv3: Implement permanent storage of auth credentials.
- See hs_client_register_auth_credentials() for the entry point.
- Also set the permanent flag for credentials we read from the filesystem.
- Also add some missing documentation.
2019-12-03 09:22:17 -05:00
teor
41a3930129 control: Update an outdated function comment
Cleanup after 31531.
2019-11-29 10:55:27 +10:00
teor
f8f278f8c4 control: Remove an unused function return value
Cleanup after 31531.
2019-11-29 10:54:42 +10:00
teor
7a69b3aebc control: Rename a function variable
Cleanup after 31531.
2019-11-29 10:53:32 +10:00
teor
7572988ea9 control: Remove an unnecessary header in control_events.h
And replace it with a struct forward declaration.

Also, move all the headers in the file before the forward
declaration.

Cleanup after 31531.
2019-11-29 10:50:09 +10:00
Neel Chauhan
99cf3f99c0 Make control_event_conf_changed() take a config_line_t 2019-11-26 22:12:23 -05:00
Nick Mathewson
31f8b4fa65 Merge branch 'stream-socks-auth' into bug19859_merged 2019-11-25 07:58:02 -05:00
George Kadianakis
21b3303657 Rename REGISTER_SUCCESS_ALSO_DECRYPTED to REGISTER_SUCCESS_AND_DECRYPTED. 2019-11-18 19:21:45 +02:00
George Kadianakis
97fd75169d Various minor improvements after David's review.
- Fix a wrong log message
- Introduce a cap for the nickname size
- Change some 'if' statements to 'switch'.
2019-11-18 19:21:41 +02:00
George Kadianakis
ce422a9d4a hs-v3: Decrypt pending descriptors when we get new client auth creds. 2019-11-18 19:21:34 +02:00
George Kadianakis
db6a48b6bf control-port: Implement ONION_CLIENT_AUTH_VIEW. 2019-11-18 19:19:00 +02:00
George Kadianakis
8330b4dc2a control-port: Implement ONION_CLIENT_AUTH_REMOVE. 2019-11-18 19:18:49 +02:00
George Kadianakis
00fdaaee1e control-port: Implement ONION_CLIENT_AUTH_ADD. 2019-11-18 19:16:01 +02:00
teor
c34fb3413d
Merge remote-tracking branch 'tor-github/pr/1517' 2019-11-18 11:21:37 +10:00
Nick Mathewson
8b91680d5c Doxygen: rename all .dox files to end with .md
Using a standard ending here will let other tools that expect
markdown understand our output here.

This commit was automatically generated with:

   for fn in $(find src -name '*.dox'); do \
      git mv "$fn" "${fn%.dox}.md"; \
   done
2019-11-15 09:28:12 -05:00
Nick Mathewson
3a7369d0cf Doxygen: remove /** and **/ from all .dox files
This is an automatically generated commit, made with:

find src -name '*.dox' | \
   xargs  perl -i -ne 'print unless (m#^\s*/?\*\*/?\s*$#);'
2019-11-15 09:23:51 -05:00
Nick Mathewson
4845ab53f0 Make all our struct names end with "_t".
This is an automated commit, generated by this command:

./scripts/maint/rename_c_identifier.py \
        address_ttl_s address_ttl_t \
        aes_cnt_cipher aes_cnt_cipher_t \
        authchallenge_data_s authchallenge_data_t \
        authenticate_data_s authenticate_data_t \
        cached_bw_event_s cached_bw_event_t \
        cbuf cbuf_t \
        cell_ewma_s cell_ewma_t \
        certs_data_s certs_data_t \
        channel_idmap_entry_s channel_idmap_entry_t \
        channel_listener_s channel_listener_t \
        channel_s channel_t \
        channel_tls_s channel_tls_t \
        circuit_build_times_s circuit_build_times_t \
        circuit_muxinfo_s circuit_muxinfo_t \
        circuitmux_policy_circ_data_s circuitmux_policy_circ_data_t \
        circuitmux_policy_data_s circuitmux_policy_data_t \
        circuitmux_policy_s circuitmux_policy_t \
        circuitmux_s circuitmux_t \
        coord coord_t \
        cpuworker_job_u cpuworker_job_u_t \
        cv_testinfo_s cv_testinfo_t \
        ddmap_entry_s ddmap_entry_t \
        dircollator_s dircollator_t \
        dist_ops dist_ops_t \
        ecdh_work_s ecdh_work_t \
        ewma_policy_circ_data_s ewma_policy_circ_data_t \
        ewma_policy_data_s ewma_policy_data_t \
        fp_pair_map_entry_s fp_pair_map_entry_t \
        fp_pair_map_s fp_pair_map_t \
        guard_selection_s guard_selection_t \
        mbw_cache_entry_s mbw_cache_entry_t \
        outbuf_table_ent_s outbuf_table_ent_t \
        queued_event_s queued_event_t \
        replyqueue_s replyqueue_t \
        rsa_work_s rsa_work_t \
        sandbox_cfg_elem sandbox_cfg_elem_t \
        scheduler_s scheduler_t \
        smp_param smp_param_t \
        socket_table_ent_s socket_table_ent_t \
        state_s state_t \
        threadpool_s threadpool_t \
        timeout_cb timeout_cb_t \
        tor_libevent_cfg tor_libevent_cfg_t \
        tor_threadlocal_s tor_threadlocal_t \
        url_table_ent_s url_table_ent_t \
        worker_state_s worker_state_t \
        workerthread_s workerthread_t \
        workqueue_entry_s workqueue_entry_t
2019-11-07 08:41:22 -05:00
Nick Mathewson
a33d1dce8a directory-level documentation for feature/* 2019-11-04 17:07:38 -05:00
Nick Mathewson
62a473debf Doxygen: Avoid ambiguity in @dir directives
This commit was automatically generated with:

find src -name '*.dox' |xargs perl -i -pe 's{\@dir ([^/])}{\@dir /$1};'
2019-11-04 10:23:36 -05:00
Nick Mathewson
7fc077ed25 Add stub directory-level documentation for most source directories
This includes app, core, feature, lib, and tools, but excludes
ext, test, and trunnel.

This was generated by the following shell script:

cd src
for dname in $(find lib core feature app tools -type d |grep -v \\.deps$); do
    keyword="$(echo "$dname" |sed -e "s/\//_/" )"
    target="${dname}/${keyword}.dox"
    echo "$target"
    cat <<EOF >"$target"
/**
@dir ${dname}
@brief ${dname}
**/
EOF

    git add "$target"
done
2019-11-04 07:40:14 -05:00
David Goulet
b98631d280 Merge branch 'tor-github/pr/1476' 2019-10-28 08:47:57 -04:00
JeremyRand
56ee42e1c9
Bug 19859: Add HTTPCONNECT client protocol 2019-10-27 05:14:21 +00:00
JeremyRand
23819d3a66
Bug 19859: Set arg to const 2019-10-27 03:06:19 +00:00
JeremyRand
0c4e3b6b50
Bug 19859: Consolidate flag fields into ISO_FIELDS 2019-10-27 01:54:11 +00:00
JeremyRand
2734968e40
Bug 19859: Add stream isolation data to STREAM event 2019-10-27 01:32:21 +00:00
Nick Mathewson
68f8086041 doxygen: add @file declarations for src/feature/
If a file doesn't use the file command (either \file or @file),
Doxygen won't try to process it.
2019-10-26 12:05:28 -04:00
Nick Mathewson
16dffa523e Rename confparse.[ch] identifiers to confmgt.[ch] identifiers.
This is an automated commit, generated by this command:

./scripts/maint/rename_c_identifier.py \
        confparse.h confmgt.h \
        confparse.c confmgt.c \
        CONFPARSE_PRIVATE CONFMGT_PRIVATE \
        TOR_CONFPARSE_H TOR_CONFMGT_H
2019-10-26 10:09:03 -04:00
Nick Mathewson
931a5db2a7 Re-run make autostyle. 2019-10-22 09:40:31 -04:00