mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
Merge branch 'bug30958_029' into bug30958_035
This commit is contained in:
commit
b7dda83cfa
2 changed files with 12 additions and 5 deletions
5
changes/bug30958
Normal file
5
changes/bug30958
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
o Minor bugfixes (statistics):
|
||||||
|
- Stop removing the ed25519 signature if the extra info file is too big.
|
||||||
|
If the signature data was removed, but the keyword was kept, this could
|
||||||
|
result in an unparseable extra info file. Fixes bug 30958;
|
||||||
|
bugfix on 0.2.7.2-alpha.
|
|
@ -2980,11 +2980,13 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo,
|
||||||
while (strlen(s) > MAX_EXTRAINFO_UPLOAD_SIZE - DIROBJ_MAX_SIG_LEN) {
|
while (strlen(s) > MAX_EXTRAINFO_UPLOAD_SIZE - DIROBJ_MAX_SIG_LEN) {
|
||||||
/* So long as there are at least two chunks (one for the initial
|
/* So long as there are at least two chunks (one for the initial
|
||||||
* extra-info line and one for the router-signature), we can keep removing
|
* extra-info line and one for the router-signature), we can keep removing
|
||||||
* things. */
|
* things. If emit_ed_sigs is true, we also keep 2 additional chunks at the
|
||||||
if (smartlist_len(chunks) > 2) {
|
* end for the ed25519 signature. */
|
||||||
/* We remove the next-to-last element (remember, len-1 is the last
|
const int required_chunks = emit_ed_sigs ? 4 : 2;
|
||||||
element), since we need to keep the router-signature element. */
|
if (smartlist_len(chunks) > required_chunks) {
|
||||||
int idx = smartlist_len(chunks) - 2;
|
/* We remove the next-to-last or 4th-last element (remember, len-1 is the
|
||||||
|
* last element), since we need to keep the router-signature elements. */
|
||||||
|
int idx = smartlist_len(chunks) - required_chunks;
|
||||||
char *e = smartlist_get(chunks, idx);
|
char *e = smartlist_get(chunks, idx);
|
||||||
smartlist_del_keeporder(chunks, idx);
|
smartlist_del_keeporder(chunks, idx);
|
||||||
log_warn(LD_GENERAL, "We just generated an extra-info descriptor "
|
log_warn(LD_GENERAL, "We just generated an extra-info descriptor "
|
||||||
|
|
Loading…
Add table
Reference in a new issue