summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-01-02 10:07:13 -0500
committerNick Mathewson <nickm@torproject.org>2018-01-02 10:07:13 -0500
commitd53f779853ee112ca152198f7695ac3b940719ae (patch)
tree449bce974412ebe6577c472ed73f5cf98070ffb6 /src
parent996328f374cb3f3b9820278b7e76ba1ee40dbfed (diff)
parent53f350182e60b32791b23ea98368a41037bffd0d (diff)
downloadtor-d53f779853ee112ca152198f7695ac3b940719ae.tar.gz
tor-d53f779853ee112ca152198f7695ac3b940719ae.zip
Merge remote-tracking branch 'teor/ticket24001'
Diffstat (limited to 'src')
-rw-r--r--src/or/nodelist.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index e6eaefb216..4eafe6d7a7 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -908,9 +908,12 @@ node_get_ed25519_id(const node_t *node)
{
const ed25519_public_key_t *ri_pk = NULL;
const ed25519_public_key_t *md_pk = NULL;
+
if (node->ri) {
if (node->ri->cache_info.signing_key_cert) {
ri_pk = &node->ri->cache_info.signing_key_cert->signing_key;
+ /* Checking whether routerinfo ed25519 is all zero.
+ * Our descriptor parser should make sure this never happens. */
if (BUG(ed25519_public_key_is_zero(ri_pk)))
ri_pk = NULL;
}
@@ -919,6 +922,10 @@ node_get_ed25519_id(const node_t *node)
if (node->md) {
if (node->md->ed25519_identity_pkey) {
md_pk = node->md->ed25519_identity_pkey;
+ /* Checking whether microdesc ed25519 is all zero.
+ * Our descriptor parser should make sure this never happens. */
+ if (BUG(ed25519_public_key_is_zero(md_pk)))
+ md_pk = NULL;
}
}