Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
73c9c16f
Commit
73c9c16f
authored
6 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Remove MIN_METHOD_FOR_ED25519_ID_VOTING
This also lets us remove the old rsa-based routerstatus collator.
parent
4d6f21bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/or/dircollate.c
+3
-35
3 additions, 35 deletions
src/or/dircollate.c
src/or/dirvote.c
+2
-5
2 additions, 5 deletions
src/or/dirvote.c
src/or/dirvote.h
+0
-4
0 additions, 4 deletions
src/or/dirvote.h
with
5 additions
and
44 deletions
src/or/dircollate.c
+
3
−
35
View file @
73c9c16f
...
...
@@ -25,7 +25,6 @@
#include
"dircollate.h"
#include
"dirvote.h"
static
void
dircollator_collate_by_rsa
(
dircollator_t
*
dc
);
static
void
dircollator_collate_by_ed25519
(
dircollator_t
*
dc
);
/** Hashtable entry mapping a pair of digests (actually an ed25519 key and an
...
...
@@ -208,48 +207,17 @@ dircollator_add_vote(dircollator_t *dc, networkstatus_t *v)
void
dircollator_collate
(
dircollator_t
*
dc
,
int
consensus_method
)
{
(
void
)
consensus_method
;
tor_assert
(
!
dc
->
is_collated
);
dc
->
all_rsa_sha1_lst
=
smartlist_new
();
if
(
consensus_method
<
MIN_METHOD_FOR_ED25519_ID_VOTING
)
dircollator_collate_by_rsa
(
dc
);
else
dircollator_collate_by_ed25519
(
dc
);
dircollator_collate_by_ed25519
(
dc
);
smartlist_sort_digests
(
dc
->
all_rsa_sha1_lst
);
dc
->
is_collated
=
1
;
}
/**
* Collation function for RSA-only consensuses: collate the votes for each
* entry in <b>dc</b> by their RSA keys.
*
* The rule is:
* If an RSA identity key is listed by more than half of the authorities,
* include that identity, and treat all descriptors with that RSA identity
* as describing the same router.
*/
static
void
dircollator_collate_by_rsa
(
dircollator_t
*
dc
)
{
const
int
total_authorities
=
dc
->
n_authorities
;
DIGESTMAP_FOREACH
(
dc
->
by_rsa_sha1
,
k
,
vote_routerstatus_t
**
,
vrs_lst
)
{
int
n
=
0
,
i
;
for
(
i
=
0
;
i
<
dc
->
n_votes
;
++
i
)
{
if
(
vrs_lst
[
i
]
!=
NULL
)
++
n
;
}
if
(
n
<=
total_authorities
/
2
)
continue
;
smartlist_add
(
dc
->
all_rsa_sha1_lst
,
(
char
*
)
k
);
}
DIGESTMAP_FOREACH_END
;
dc
->
by_collated_rsa_sha1
=
dc
->
by_rsa_sha1
;
}
/**
* Collation function for ed25519 consensuses: collate the votes for each
* entry in <b>dc</b> by ed25519 key and by RSA key.
...
...
This diff is collapsed.
Click to expand it.
src/or/dirvote.c
+
2
−
5
View file @
73c9c16f
...
...
@@ -1455,8 +1455,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
smartlist_free
(
combined_server_versions
);
smartlist_free
(
combined_client_versions
);
if
(
consensus_method
>=
MIN_METHOD_FOR_ED25519_ID_VOTING
)
smartlist_add_strdup
(
flags
,
"NoEdConsensus"
);
smartlist_add_strdup
(
flags
,
"NoEdConsensus"
);
smartlist_sort_strings
(
flags
);
smartlist_uniq_strings
(
flags
);
...
...
@@ -1852,7 +1851,6 @@ networkstatus_compute_consensus(smartlist_t *votes,
continue
;
if
(
ed_consensus
>
0
)
{
tor_assert
(
consensus_method
>=
MIN_METHOD_FOR_ED25519_ID_VOTING
);
if
(
ed_consensus
<=
total_authorities
/
2
)
{
log_warn
(
LD_BUG
,
"Not enough entries had ed_consensus set; how "
"can we have a consensus of %d?"
,
ed_consensus
);
...
...
@@ -1910,8 +1908,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
}
else
if
(
!
strcmp
(
fl
,
"Unnamed"
))
{
if
(
is_unnamed
)
smartlist_add
(
chosen_flags
,
(
char
*
)
fl
);
}
else
if
(
!
strcmp
(
fl
,
"NoEdConsensus"
)
&&
consensus_method
>=
MIN_METHOD_FOR_ED25519_ID_VOTING
)
{
}
else
if
(
!
strcmp
(
fl
,
"NoEdConsensus"
))
{
if
(
ed_consensus
<=
total_authorities
/
2
)
smartlist_add
(
chosen_flags
,
(
char
*
)
fl
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
src/or/dirvote.h
+
0
−
4
View file @
73c9c16f
...
...
@@ -61,10 +61,6 @@
/** The highest consensus method that we currently support. */
#define MAX_SUPPORTED_CONSENSUS_METHOD 28
/** Lowest consensus method where authorities vote on ed25519 ids and ensure
* ed25519 id consistency. */
#define MIN_METHOD_FOR_ED25519_ID_VOTING 22
/** Lowest consensus method where authorities may include a shared random
* value(s). */
#define MIN_METHOD_FOR_SHARED_RANDOM 23
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment