mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
connection_or_set_identity_digest: more defensive programming
We expect ed_id == NULL here to indicate "no ed id", but other parts of Tor sometimes use an all-0 ed_id. Here we detect that input and replace it with what's expected.
This commit is contained in:
@@ -165,6 +165,9 @@ connection_or_set_identity_digest(or_connection_t *conn,
|
||||
if (conn->chan)
|
||||
chan = TLS_CHAN_TO_BASE(conn->chan);
|
||||
|
||||
if (BUG(ed_id && ed25519_public_key_is_zero(ed_id)))
|
||||
ed_id = NULL;
|
||||
|
||||
log_info(LD_HANDSHAKE, "Set identity digest for %s at %p: %s %s.",
|
||||
connection_describe(TO_CONN(conn)),
|
||||
conn,
|
||||
|
||||
Reference in New Issue
Block a user