Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages of Public{Ecc,Rsa}ParametersBuilder #431

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 parameter was not set but 'restricted' and 'is_decrypt_key' are set to true");
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 parameter was not set but 'restricted' and 'is_decrypt_key' are set to true");
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
Loading