Use the Device TCTI if there is no TPMRM
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
parent
8c1524f1b9
commit
2a9a579033
|
@ -1377,7 +1377,11 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_tpm2_ctx() -> Result<Context, tss_esapi::response_code::Error> {
|
fn get_tpm2_ctx() -> Result<Context, tss_esapi::response_code::Error> {
|
||||||
|
if std::path::Path::new("/dev/tpmrm0").exists() {
|
||||||
unsafe { Context::new(tcti::Tcti::Tabrmd(Default::default())) }
|
unsafe { Context::new(tcti::Tcti::Tabrmd(Default::default())) }
|
||||||
|
} else {
|
||||||
|
unsafe { Context::new(tcti::Tcti::Device(Default::default())) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_tpm2_primary_key(
|
fn get_tpm2_primary_key(
|
||||||
|
|
Loading…
Reference in a new issue