Skip to content

Commit

Permalink
fix: build failure for scard feature
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit committed Dec 14, 2023
1 parent 7717cdd commit 0517612
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ where
Generator::new(move |_| async move { value })
}
}
/// Utilitiies for working with network client

/// Utilities for working with network client
impl<'a, OutTy> Generator<'a, NetworkRequest, crate::Result<Vec<u8>>, OutTy>
where
OutTy: 'a + Send,
Expand Down
7 changes: 3 additions & 4 deletions src/kerberos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,9 @@ impl Sspi for Kerberos {
}
#[cfg(feature = "scard")]
if let Some(CredentialsBuffers::SmartCard(ref identity_buffers)) = self.auth_identity {
return Ok(ContextNames {
username: utf16_bytes_to_utf8_string(&identity_buffers.username),
domain: None,
});
let username = utf16_bytes_to_utf8_string(&identity_buffers.username);
let username = crate::Username::parse(&username).map_err(|e| Error::new(ErrorKind::InvalidParameter, e))?;
return Ok(ContextNames { username });
}
Err(crate::Error::new(
crate::ErrorKind::NoCredentials,
Expand Down
12 changes: 6 additions & 6 deletions src/negotiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,12 @@ impl<'a> Negotiate {
.ok_or_else(|| Error::new(ErrorKind::NoAuthenticatingAuthority, "can not detect KDC url"))?;
info!("Negotiate: try Kerberos");

self.protocol =
NegotiatedProtocol::Kerberos(Kerberos::new_client_from_config(crate::KerberosConfig {
url: Some(host),
network_client: self.network_client_factory.network_client(),
hostname: Some(self.hostname.clone()),
})?);
let config = crate::KerberosConfig {
kdc_url: Some(host),
client_computer_name: Some(self.client_computer_name.clone()),
};

self.protocol = NegotiatedProtocol::Kerberos(Kerberos::new_client_from_config(config)?);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/pk_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub struct Wrapper<T> {
pub content: ExplicitContextTag0<T>,
}

pub type SignDataFn = Box<dyn Fn(&[u8]) -> Result<Vec<u8>>>;
pub type SignDataFn = Box<dyn Fn(&[u8]) -> Result<Vec<u8>> + Send>;

pub struct GenerateAsPaDataOptions<'a> {
pub p2p_cert: Certificate,
Expand Down

0 comments on commit 0517612

Please sign in to comment.