aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirparse
AgeCommit message (Collapse)Author
2021-03-15Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-03-15Merge branch 'maint-0.3.5' into maint-0.4.4Nick Mathewson
2021-03-15Clarify new intended strategy with TROVE-2021-001Nick Mathewson
We're going to disable this feature in all versions for now.
2021-03-15Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-03-15Merge branch 'maint-0.3.5' into maint-0.4.4Nick Mathewson
2021-02-19Disable the dump_desc() function.Nick Mathewson
It can be called with strings that should have been length-delimited, but which in fact are not. This can cause a CPU-DoS bug or, in a worse case, a crash. Since this function isn't essential, the best solution for older Tors is to just turn it off. Fixes bug 40286; bugfix on 0.2.2.1-alpha when dump_desc() was introduced.
2021-01-11Reject obsolete router/extrainfo descs more quietly.Nick Mathewson
Thanks to proposal 315 / ticket #30132, more fields are now required in these documents. But ancient Tors that try to upload obsolete documents were causing the authorities to log warnings about missing fields, and to do so very spammily. We now detect the missing fields before tokenizing, and log at debug. This is a bit of ugliness, but it's probably a safer choice than making _all_ unparseable-desc warnings into debug-level logs. I'm looking at identity-ed25519 in extrainfos and proto in routerdescs because they were (I believe) the latest-added fields in Tor's history: any Tor that lacks them will also lack the other newly required fields. Fixes bug #40238; bugfix on 0.4.5.1-alpha.
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-10-16Fix up vote tests in test_dir_handle_get.Nick Mathewson
These tests used a hardcoded vote with a hardcoded digest. That vote didn't have any pr lines, and so it is now invalid. I've adjusted the testing code so that it mocks the signature-checking, so that we can more easily change the contents of the vote.
2020-10-15Mark as required fields from prop315.Nick Mathewson
This change breaks some unit tests; it's time to fix those in subsequent commits.
2020-08-03Rename protover_contains_long_protocol_names to protover_list_is_invalidNick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ protover_contains_long_protocol_names protover_list_is_invalid
2020-08-03Merge remote-tracking branch 'tor-gitlab/mr/94'Nick Mathewson
2020-07-14Merge branch 'ticket40033_045_01_squashed'Nick Mathewson
2020-07-14Rename blacklist and whitelist wordingDavid Goulet
Closes #40033 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14addr: Use tor_addr_t instead of uint32_t for IPv4David Goulet
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-05-06Merge branch 'maint-0.4.3'Nick Mathewson
Amazingly, this time we had no merge conflicts with "falls through" comments.
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.3 version.)
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
2020-03-17Merge branch 'maint-0.4.3'Nick Mathewson
2020-03-17Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-03-17Merge branch 'maint-0.4.1' into maint-0.4.2Nick Mathewson
2020-02-09dirparse: add helper for recommended/required protocolscypherpunks
2020-02-09dirparse: reject votes with invalid recommended/required protocolscypherpunks
2020-02-09dirparse: curlybraceify if statementscypherpunks
2020-02-09dirparse: reject routerstatus entries with malformed protovercypherpunks
Contrary to its name, protover_contains_long_protocol_names() detects all parse errors, not just long names.
2020-02-09dirparse: reject votes with malformed routerstatus entriescypherpunks
2020-02-06Wrap columnar tables in "clang-format off/on"Nick Mathewson
These tables have aligned comments, so we don't want clang-format to mess with them.
2020-02-05Merge branch 'trove_2020_002_035' into trove_2020_002_041Nick Mathewson
Resolved Conflicts: src/feature/dirparse/parsecommon.c
2020-02-05When parsing tokens, reject early on spurious keys.Nick Mathewson
2020-02-05When parsing, reject >1024-bit RSA private keys sooner.Nick Mathewson
Private-key validation is fairly expensive for long keys in openssl, so we need to avoid it sooner.
2020-01-13Split core/include.am into per-subdirectory include.am filesNick Mathewson
Closes ticket 32137.
2020-01-09Merge branch 'pre_formatter_cleanups_squashed'Nick Mathewson
2020-01-09routerparse.h: include parsecommon.h when exposing token table.Nick Mathewson
Without this include, our compilation depends more on include order.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-12-20Replace several C identifiers.teor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ EXPOSE_CLEAN_BACKTRACE BACKTRACE_PRIVATE \ TOR_CHANNEL_INTERNAL_ CHANNEL_OBJECT_PRIVATE \ CHANNEL_PRIVATE_ CHANNEL_FILE_PRIVATE \ EXPOSE_ROUTERDESC_TOKEN_TABLE ROUTERDESC_TOKEN_TABLE_PRIVATE \ SCHEDULER_PRIVATE_ SCHEDULER_PRIVATE
2019-12-04practracker: Add missing .may_include filesteor
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-11-15Doxygen: rename all .dox files to end with .mdNick Mathewson
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-15Doxygen: remove /** and **/ from all .dox filesNick Mathewson
This is an automatically generated commit, made with: find src -name '*.dox' | \ xargs perl -i -ne 'print unless (m#^\s*/?\*\*/?\s*$#);'
2019-11-04directory-level documentation for feature/*Nick Mathewson
2019-11-04Doxygen: Avoid ambiguity in @dir directivesNick Mathewson
This commit was automatically generated with: find src -name '*.dox' |xargs perl -i -pe 's{\@dir ([^/])}{\@dir /$1};'
2019-11-04Add stub directory-level documentation for most source directoriesNick Mathewson
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-10-26doxygen: add @file declarations for src/feature/Nick Mathewson
If a file doesn't use the file command (either \file or @file), Doxygen won't try to process it.
2019-10-22Re-run make autostyle.Nick Mathewson
2019-10-16Rename authcert_members.i to .h, and have it define a macro.Nick Mathewson
Including a file in the middle of a declaration seems to confuse Doxygen, and Coccinelle doesn't much like it either.l
2019-10-16Doxygen: fix warnings about mismatched HTML tags.Nick Mathewson
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-19microdesc_parse: convert some ints to boolsNick Mathewson
Noted by ahf during review of #31675
2019-09-19microdesc_parse: Rename "next" label to "err".Nick Mathewson
2019-09-19Reindent microdesc_parse_fields().Nick Mathewson
I suggest reviewing this with -b: it should be whitespace-only.
2019-09-19Extract field-parsing code for microdesc_parse.cNick Mathewson
The code here parses the fields from the microdescriptor, including possible annotations, and stores them into a microdesc_t object. This commit is almost pure code movement; I recommend using --color-moved to review it.