Compare commits
2 commits
67b7a2d0ea
...
ca942d6e3e
Author | SHA1 | Date | |
---|---|---|---|
ca942d6e3e | |||
317672991e |
4 changed files with 16 additions and 3 deletions
|
@ -5,10 +5,9 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
digest = "0.10"
|
digest = "0.10"
|
||||||
libc = "0.2.146"
|
libc = "0.2"
|
||||||
rustls-pemfile = "1.0"
|
rustls-pemfile = "1.0"
|
||||||
sha2 = "0.10"
|
sha2 = "0.10"
|
||||||
time = "0.3"
|
|
||||||
tinyrand = "0.5"
|
tinyrand = "0.5"
|
||||||
x509-parser = "0.15"
|
x509-parser = "0.15"
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,10 @@ impl<S: FingerPrintStore> ClientCertVerifier for Verifier<S> {
|
||||||
return Err(rustls::Error::InvalidCertificate(
|
return Err(rustls::Error::InvalidCertificate(
|
||||||
rustls::CertificateError::NotValidForName,
|
rustls::CertificateError::NotValidForName,
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
return Ok(ClientCertVerified::assertion());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
todo!()
|
todo!()
|
||||||
|
|
|
@ -535,6 +535,17 @@ fn chown(path: CString, uid: u32, gid: u32) -> Result<(), io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "freebsd")]
|
||||||
|
fn chmod(path: CString, mode: u16) -> Result<(), io::Error> {
|
||||||
|
unsafe {
|
||||||
|
if libc::chmod(path.as_ptr(), mode) != 0 {
|
||||||
|
return Err(io::Error::last_os_error());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
fn chmod(path: CString, mode: u32) -> Result<(), io::Error> {
|
fn chmod(path: CString, mode: u32) -> Result<(), io::Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
if libc::chmod(path.as_ptr(), mode) != 0 {
|
if libc::chmod(path.as_ptr(), mode) != 0 {
|
||||||
|
|
|
@ -75,7 +75,7 @@ where
|
||||||
let rustls_cert = rustls::Certificate(c.der);
|
let rustls_cert = rustls::Certificate(c.der);
|
||||||
let cert_chain = vec![rustls_cert];
|
let cert_chain = vec![rustls_cert];
|
||||||
let key_der = rustls::PrivateKey(c.key);
|
let key_der = rustls::PrivateKey(c.key);
|
||||||
cfg.with_single_cert(cert_chain, key_der)?
|
cfg.with_client_auth_cert(cert_chain, key_der)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let client = ClientConnection::new(Arc::new(cfg), dnsname)?;
|
let client = ClientConnection::new(Arc::new(cfg), dnsname)?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue