Skip to content

Commit

Permalink
Improve error messages of Public{Ecc,Rsa}ParametersBuilder
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Brand <[email protected]>
  • Loading branch information
brandsimon committed Sep 10, 2023
1 parent 6fccc4d commit 33182e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tss-esapi/src/structures/tagged/public/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ impl PublicEccParametersBuilder {
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
}
} else {
error!("Found symmetric parameter, expected it to be Null nor not set at all because 'restricted' and 'is_decrypt_key' are set to false");
error!("Symmetric paramter was not set but 'restricted' and 'is_decrypt_key' are set to true");

Check failure on line 158 in tss-esapi/src/structures/tagged/public/ecc.rs

View workflow job for this annotation

GitHub Actions / Check spelling

paramter ==> parameter
return Err(Error::local_error(WrapperErrorKind::ParamsMissing));
}
} else if let Some(symmetric) = self.symmetric {
if !symmetric.is_null() {
error!("Found symmetric parameter, expected it to be Null nor not set at all because 'restricted' and 'is_decrypt_key' are set to false");
error!("Found symmetric parameter, expected it to be Null or not set at all because 'restricted' or 'is_decrypt_key' are set to false");
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
}
}
Expand Down
4 changes: 2 additions & 2 deletions tss-esapi/src/structures/tagged/public/rsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ impl PublicRsaParametersBuilder {
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
}
} else {
error!("Found symmetric parameter, expected it to be Null nor not set at all because 'restricted' and 'is_decrypt_key' are set to false");
error!("Symmetric paramter was not set but 'restricted' and 'is_decrypt_key' are set to true");

Check failure on line 158 in tss-esapi/src/structures/tagged/public/rsa.rs

View workflow job for this annotation

GitHub Actions / Check spelling

paramter ==> parameter
return Err(Error::local_error(WrapperErrorKind::ParamsMissing));
}
} else if let Some(symmetric) = self.symmetric {
if !symmetric.is_null() {
error!("Found symmetric parameter, expected it to be Null nor not set at all because 'restricted' and 'is_decrypt_key' are set to false");
error!("Found symmetric parameter, expected it to be Null or not set at all because 'restricted' or 'is_decrypt_key' are set to false");
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
}
}
Expand Down

0 comments on commit 33182e7

Please sign in to comment.