Skip to content

Commit

Permalink
tpm: Add AlgorithmError to TpmError
Browse files Browse the repository at this point in the history
Make get_idevid_template() to return TpmError

Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
  • Loading branch information
ansasaki committed Jan 18, 2024
1 parent c649ae0 commit 570613c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions keylime/src/tpm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ pub fn get_idevid_template(
template_str: &str,
asym_alg_str: &str,
name_alg_str: &str,
) -> std::result::Result<
(AsymmetricAlgorithm, HashingAlgorithm),
AlgorithmError,
> {
) -> Result<(AsymmetricAlgorithm, HashingAlgorithm)> {
let template_str = if ["", "detect", "default"].contains(&template_str) {
detect_str
} else {
Expand Down Expand Up @@ -147,6 +144,8 @@ pub enum TpmError {
kind: Option<Tss2ResponseCodeKind>,
message: String,
},
#[error("AlgorithmError: {0}")]
AlgorithmError(#[from] AlgorithmError),
#[error("Infallible: {0}")]
Infallible(#[from] std::convert::Infallible),
#[error("IO error: {0}")]
Expand Down

0 comments on commit 570613c

Please sign in to comment.