Skip to content

Commit

Permalink
fix(acceptor): raise credssp error to caller (#563)
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-André Lureau <[email protected]>
Co-authored-by: Benoît Cortier <[email protected]>
  • Loading branch information
elmarco and CBenoit authored Oct 28, 2024
1 parent 42cc02d commit 87014d4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions crates/ironrdp-acceptor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,17 @@ where
Ok(())
}

let result = match credssp_loop(framed, acceptor, buf, client_computer_name, public_key, kerberos_config).await {
Ok(_) => EarlyUserAuthResult::Success,
Err(err) => {
warn!("credssp: {err}");
EarlyUserAuthResult::AccessDenied
}
};
let result = credssp_loop(framed, acceptor, buf, client_computer_name, public_key, kerberos_config).await;

if protocol.intersects(nego::SecurityProtocol::HYBRID_EX) {
trace!(?result, "HYBRID_EX");

let result = if result.is_ok() {
EarlyUserAuthResult::Success
} else {
EarlyUserAuthResult::AccessDenied
};

buf.clear();
result
.to_buffer(&mut *buf)
Expand All @@ -192,6 +193,9 @@ where
.await
.map_err(|e| ironrdp_connector::custom_err!("write all", e))?;
}

result?;

acceptor.mark_credssp_as_done();

Ok(())
Expand Down

0 comments on commit 87014d4

Please sign in to comment.