Return error on session unavailable in handle_subsession_packet
Replace .session().ok() with proper error handling to fail fast when session is Closed or Processing after state machine processing. Previously, the code silently continued with outer_key = None, which could cause protocol errors downstream. Closes: nym-8de0
This commit is contained in:
committed by
Jędrzej Stuczyński
parent
4e8411a728
commit
d09e7a296d
@@ -453,8 +453,8 @@ impl LpConnectionHandler {
|
||||
// Get outer key before releasing borrow
|
||||
let outer_key = state_machine
|
||||
.session()
|
||||
.ok()
|
||||
.and_then(|s| s.outer_aead_key());
|
||||
.map_err(|e| GatewayError::LpProtocolError(format!("Session unavailable after processing: {}", e)))?
|
||||
.outer_aead_key();
|
||||
drop(state_entry);
|
||||
|
||||
match action {
|
||||
|
||||
Reference in New Issue
Block a user