diff --git a/src/generator.rs b/src/generator.rs index f1e95c8f..52f5348a 100644 --- a/src/generator.rs +++ b/src/generator.rs @@ -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>, OutTy> where OutTy: 'a + Send, diff --git a/src/kerberos/mod.rs b/src/kerberos/mod.rs index d49613fa..719b1c31 100644 --- a/src/kerberos/mod.rs +++ b/src/kerberos/mod.rs @@ -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, diff --git a/src/negotiate.rs b/src/negotiate.rs index 3c9aa738..1f3a3fa4 100644 --- a/src/negotiate.rs +++ b/src/negotiate.rs @@ -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)?); } } diff --git a/src/pk_init.rs b/src/pk_init.rs index 3cf76339..0c58b80b 100644 --- a/src/pk_init.rs +++ b/src/pk_init.rs @@ -60,7 +60,7 @@ pub struct Wrapper { pub content: ExplicitContextTag0, } -pub type SignDataFn = Box Result>>; +pub type SignDataFn = Box Result> + Send>; pub struct GenerateAsPaDataOptions<'a> { pub p2p_cert: Certificate,