Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GSSAPI Kerberos Authentication in Debug Mode #372

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ uuid = "1.0"
winauth = { version = "0.0.4", optional = true }

[target.'cfg(unix)'.dependencies]
libgssapi = { version = "0.4.5", optional = true, default-features = false }
libgssapi = { version = "0.8.1", optional = true, default-features = false }

[dependencies.async-native-tls]
version = "0.4"
Expand Down
8 changes: 4 additions & 4 deletions src/client/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@ impl<S: AsyncRead + AsyncWrite + Unpin + Send> Connection<S> {

let client_cred = Cred::acquire(None, None, CredUsage::Initiate, Some(&s))?;

let ctx = ClientCtx::new(
client_cred,
let mut ctx = ClientCtx::new(
Some(client_cred),
Name::new(self.context.spn().as_bytes(), Some(&GSS_NT_KRB5_PRINCIPAL))?,
CtxFlags::GSS_C_MUTUAL_FLAG | CtxFlags::GSS_C_SEQUENCE_FLAG,
None,
);

let init_token = ctx.step(None)?;
let init_token = ctx.step(None, None)?;

login_message.integrated_security(Some(Vec::from(init_token.unwrap().deref())));

Expand All @@ -365,7 +365,7 @@ impl<S: AsyncRead + AsyncWrite + Unpin + Send> Connection<S> {

let auth_bytes = self.flush_sspi().await?;

let next_token = match ctx.step(Some(auth_bytes.as_ref()))? {
let next_token = match ctx.step(Some(auth_bytes.as_ref()), None)? {
Some(response) => {
event!(Level::TRACE, response_len = response.len());
TokenSspi::new(Vec::from(response.deref()))
Expand Down