Previously we were using tor_assert() to enforce the documented
invariant here; this commit changes it to use BUG() instead. It
will protect us from crashes if the next commit (on #40563) turns
out to expose a bug somewhere.
const int ed_changed = ed_id_was_set &&
(!ed_id || !ed25519_pubkey_eq(ed_id, &chan->ed25519_identity));
- tor_assert(!rsa_changed || !rsa_id_was_set);
- tor_assert(!ed_changed || !ed_id_was_set);
+ if (BUG(rsa_changed && rsa_id_was_set))
+ return;
+ if (BUG(ed_changed && ed_id_was_set))
+ return;
if (!rsa_changed && !ed_changed)
return;