Commit Graph

56 Commits

Author SHA1 Message Date
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
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
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
931a5db2a7 Re-run make autostyle. 2019-10-22 09:40:31 -04:00
Nick Mathewson
87afe5c260 Rename authcert_members.i to .h, and have it define a macro.
Including a file in the middle of a declaration seems to confuse
Doxygen, and Coccinelle doesn't much like it either.l
2019-10-16 10:53:01 -04:00
Nick Mathewson
98735c40b6 Doxygen: fix warnings about mismatched HTML tags. 2019-10-16 08:27:03 -04:00
Nick Mathewson
53116ca0b7 Re-run "make autostyle" with improved annotate_ifdef_directives 2019-09-30 08:57:37 -04:00
Nick Mathewson
c309169217 microdesc_parse: convert some ints to bools
Noted by ahf during review of #31675
2019-09-19 14:37:24 -04:00
Nick Mathewson
194884977c microdesc_parse: Rename "next" label to "err". 2019-09-19 14:37:24 -04:00
Nick Mathewson
2094796c24 Reindent microdesc_parse_fields().
I suggest reviewing this with -b: it should be whitespace-only.
2019-09-19 14:37:24 -04:00
Nick Mathewson
ec368409fa Extract field-parsing code for microdesc_parse.c
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.
2019-09-19 14:37:24 -04:00
Nick Mathewson
b1552e8814 Reindent microdesc_extract_body().
This commit is whitespace-only; I suggest reviewing with -b.
2019-09-19 14:37:24 -04:00
Nick Mathewson
9cbc166ea0 Extract the body-copying portion of microdesc parsing
This code is logically independent of the rest of the function, and
goes better in its own function.

This is almost purely code movement; I suggest reviewing with
--color-moved.
2019-09-19 14:37:24 -04:00
Nick Mathewson
e7d7e04155 Do not look inside bogus microdesc when listing its digest as invalid
We have code in microdescs_parse_from_string() to record the digests
of microdescriptors that we could not parse.  But right now, that
code looks at the md->digest field, which is a bit inelegant, and
will stand in the way of sensible refactoring.

Instead, use a local variable to hold the digest.
2019-09-10 09:10:49 -04:00
Nick Mathewson
7282213bd3 Extract saved_location_to_string() from microdesc parsing.
We may be able to use this function in other places in the future;
if so, we should move it to somewhere more useful.

Part of 31675.
2019-09-10 09:10:49 -04:00
Neel Chauhan
be4a60945d Check IPv6 exit policies on microdescriptors in node_exit_policy_rejects_all() 2019-09-05 17:02:45 +03:00
teor
c7fc53c2e7
Merge branch 'bug30781_040' into bug30781_master 2019-06-06 09:57:31 +10:00
teor
fb3f461406
Merge branch 'bug30781_035' into bug30781_040 2019-06-06 09:56:50 +10:00
teor
c8c2e2b8fc
Merge branch 'bug30781_034' into bug30781_035
Moved fix from src/or/routerparse.c to src/feature/dirparse/routerparse.c.
2019-06-06 09:55:44 +10:00
Nick Mathewson
60213a3621 Run "make autostyle." 2019-06-05 09:33:35 -04:00
Nick Mathewson
295feeb093 Replace all remaining tor_mem_is_zero() with fast_mem_is_zero() 2019-04-30 14:49:05 -04:00
George Kadianakis
6a179b1072 Merge branch 'tor-github/pr/891' into maint-0.4.0 2019-04-18 13:21:59 +03:00
Nick Mathewson
99b87d7ca4 Even more diagnostic messages for bug 28223.
Try to figure out _where exactly_ we are first encountering NULs in
microdescriptors, and what we are doing when that happens.
2019-04-03 13:53:06 -04:00
Nick Mathewson
2f683465d4 Bump copyright date to 2019 2019-01-16 12:33:22 -05:00
Nick Mathewson
efe55b8898 Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
Nick Mathewson
f9a7701ff1 Merge branch 'ticket28856_v2' 2019-01-09 08:46:40 -05:00
Nick Mathewson
a7cbbf279e Merge branch 'ticket28852' 2019-01-03 21:31:08 -05:00
Nick Mathewson
7113a339dc Avoid a needless decode/re-encode step in assigning onion keys
Previously we had decoded the asn.1 to get a public key, and then
discarded the asn.1 so that we had to re-encode the key to store it
in the onion_pkey field of a microdesc_t or routerinfo_t.

Now we can just do a tor_memdup() instead, which should be loads
faster.
2018-12-18 18:58:08 -05:00
Nick Mathewson
0556942284 Use a single path for all PEM-like objects in get_next_token()
Previously, we would decode the PEM wrapper for keys twice: once in
get_next_token, and once later in PEM decode.  Now we just do all of
the wrapper and base64 stuff in get_next_token, and store the
base64-decoded part in the token object for keys and non-keys alike.

This change should speed up parsing slightly by letting us skip a
bunch of stuff in crypto_pk_read_*from_string(), including the tag
detection parts of pem_decode(), and an extra key allocation and
deallocation pair.

Retaining the base64-decoded part in the token object will allow us
to speed up our microdesc parsing, since it is the asn1 portion that
we actually want to retain.
2018-12-18 18:58:08 -05:00
Nick Mathewson
a0fad3981e Replace use of strcmp_len() with new mem_eq_token().
The strcmp_len() function was somewhat misconceived, since we're
only using it to test whether a length+extent string is equal to a
NUL-terminated string or not.  By simplifying it and making it
inlined, we should be able to make it a little faster.

(It *does* show up in profiles.)

Closes ticket 28856.
2018-12-17 09:03:04 -05:00
Nick Mathewson
9dc53bc68f Remove a needless memset() in get_token_arguments()
I believe we originally added this for "just in case" safety, but it
isn't actually needed -- we never copy uninitialized stack here.
What's more, this one memset is showing up on our startup profiles,
so we ought to remove it.

Closes ticket 28852.
2018-12-14 14:48:12 -05:00
Nick Mathewson
6dc90d290d Use 25% less RAM for base64-encoded directory objects
We were allocating N bytes to decode an N-byte base64 encoding,
when 3N/4 would have been enough.
2018-12-14 13:51:51 -05:00
Nick Mathewson
36f808c936 Vote on the StaleDesc flag from prop293
The StaleDesc flag tells relays that they need to upload a new
descriptor soon, or they will drop out of the consensus.
2018-11-25 10:05:13 -05:00
Nick Mathewson
48b08f0592 Merge branch 'ticket27359_v2_squashed' 2018-11-19 08:26:49 -05:00
Nick Mathewson
426c9561c5 Use nodefamily_t in microdescriptors.
Closes ticket 27359.
2018-11-19 08:26:10 -05:00
Nick Mathewson
988d4903a3 Merge branch 'networkstatus_mmap' into networkstatus_mmap_merge 2018-10-31 09:04:12 -04:00
Nick Mathewson
e9ff3e7d4a Merge branch 'bug28202_033' into bug28202_035 2018-10-25 09:16:08 -04:00
Nick Mathewson
2dccef0eb4 Merge branch 'bug27772_squashed' 2018-10-14 15:31:52 -04:00
Nick Mathewson
d199348664 Remove versions.h include from routerparse.h 2018-10-01 11:22:47 -05:00
Nick Mathewson
5f9839ee42 Remove unused headers from routerparse.c 2018-10-01 11:17:33 -05:00
Nick Mathewson
35db3f8162 Extract addr-policy parsing code. 2018-10-01 11:17:19 -05:00
Nick Mathewson
95e2eb9083 Move summarize_protover_flags to versions.c 2018-10-01 10:48:55 -05:00
Nick Mathewson
4201203845 extract networkstatus parsing to its own file. 2018-10-01 10:46:00 -05:00
Nick Mathewson
cd23903427 Pull detached-signatures code into dirauth. 2018-10-01 10:46:00 -05:00
Nick Mathewson
2be35f4d61 Split microdescriptor parser into its own file. 2018-10-01 10:46:00 -05:00
Nick Mathewson
aff5bf5464 Remove addr_policy_assert_ok() as unused 2018-10-01 00:09:00 -05:00
Nick Mathewson
3100831762 Remove dump_distinct_digest_count()
It was disabled-by-default for ages, and it no longer compiles. I
think it's safe to call it obsolete.
2018-10-01 00:09:00 -05:00