aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirparse/parsecommon.c
AgeCommit message (Collapse)Author
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-03-17Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
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-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2019-01-09Merge branch 'ticket28856_v2'Nick Mathewson
2019-01-03Merge branch 'ticket28852'Nick Mathewson
2018-12-18Use a single path for all PEM-like objects in get_next_token()Nick Mathewson
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-17Replace use of strcmp_len() with new mem_eq_token().Nick Mathewson
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-14Remove a needless memset() in get_token_arguments()Nick Mathewson
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-14Use 25% less RAM for base64-encoded directory objectsNick Mathewson
We were allocating N bytes to decode an N-byte base64 encoding, when 3N/4 would have been enough.
2018-10-25Merge branch 'bug28202_033' into bug28202_035Nick Mathewson
2018-10-01Extract addr-policy parsing code.Nick Mathewson
2018-10-01Move routerparse and parsecommon to their own module.Nick Mathewson