mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
Resolve compilation issue with tpm enabled on linux (#1902)
This commit is contained in:
parent
54544075c1
commit
9bcd8d4737
|
@ -31,6 +31,7 @@ pub enum CacheError {
|
||||||
Sqlite,
|
Sqlite,
|
||||||
TooManyResults,
|
TooManyResults,
|
||||||
TransactionInvalidState,
|
TransactionInvalidState,
|
||||||
|
Tpm,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait CacheTxn {
|
pub trait CacheTxn {
|
||||||
|
@ -530,7 +531,8 @@ impl<'a> CacheTxn for DbTxn<'a> {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|
||||||
#[cfg(feature = "tpm")]
|
#[cfg(feature = "tpm")]
|
||||||
let pw = Db::tpm_new(self.crypto_policy, cred, tcti_str)?;
|
let pw =
|
||||||
|
Db::tpm_new(self.crypto_policy, cred, tcti_str).map_err(|()| CacheError::Tpm)?;
|
||||||
#[cfg(feature = "tpm")]
|
#[cfg(feature = "tpm")]
|
||||||
pw
|
pw
|
||||||
} else {
|
} else {
|
||||||
|
@ -605,7 +607,7 @@ impl<'a> CacheTxn for DbTxn<'a> {
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
if let Some(tcti_str) = self.require_tpm {
|
if let Some(tcti_str) = self.require_tpm {
|
||||||
#[cfg(feature = "tpm")]
|
#[cfg(feature = "tpm")]
|
||||||
let r = Db::tpm_verify(pw, cred, tcti_str);
|
let r = Db::tpm_verify(pw, cred, tcti_str).map_err(|()| CacheError::Tpm);
|
||||||
|
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
#[cfg(not(feature = "tpm"))]
|
#[cfg(not(feature = "tpm"))]
|
||||||
|
|
Loading…
Reference in a new issue