mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
Expand comments in node_get_ed25519_id() and put them near the relevant code
And add a changes file. Follow-up to 24001.
This commit is contained in:
parent
5865e56ec0
commit
53f350182e
4
changes/ticket24001
Normal file
4
changes/ticket24001
Normal file
@ -0,0 +1,4 @@
|
||||
o Minor features (code correctness, descriptors):
|
||||
- Check that microdesc ed25519 ids are non-zero in node_get_ed25519_id(),
|
||||
before returning them.
|
||||
Implements 24001, patch by "aruna1234".
|
@ -908,18 +908,22 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
/* Checking whether microdesc_ed25519() is all zero*/
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user