Fix identity cache miss during lookup response verification

Guard discovery triggers in handle_path_broken() and
handle_coords_required() with has_cached_identity() check. When the
XK responder receives an error signal before msg3 completes, the
initiator's identity is unknown, making LookupResponse proof
verification impossible. Skip discovery in this case — the handshake
retry mechanism handles recovery.

Downgrade the identity_cache miss log from ERROR to WARN since it's a
known race condition, not a bug.
This commit is contained in:
Johnathan Corgan
2026-02-23 18:44:27 +00:00
parent 0d93a19e07
commit e3b5bd0bcd
4 changed files with 29 additions and 7 deletions
+1 -1
View File
@@ -262,7 +262,7 @@ async fn test_response_proof_verification_failure() {
#[tokio::test]
async fn test_response_identity_cache_miss() {
// Verify that a response is discarded when the origin lacks the
// target's pubkey in identity_cache (should never happen in practice).
// target's pubkey in identity_cache (e.g., XK responder before msg3).
let mut node = make_node();
let from = make_node_addr(0xAA);