From 33182e7978bb7e3274ebc3a48b5d1abf84797c81 Mon Sep 17 00:00:00 2001 From: Simon Brand Date: Sun, 10 Sep 2023 19:55:45 +0000 Subject: [PATCH] Improve error messages of Public{Ecc,Rsa}ParametersBuilder Signed-off-by: Simon Brand --- tss-esapi/src/structures/tagged/public/ecc.rs | 4 ++-- tss-esapi/src/structures/tagged/public/rsa.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tss-esapi/src/structures/tagged/public/ecc.rs b/tss-esapi/src/structures/tagged/public/ecc.rs index e0809b3a..a9bfad5f 100644 --- a/tss-esapi/src/structures/tagged/public/ecc.rs +++ b/tss-esapi/src/structures/tagged/public/ecc.rs @@ -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"); 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)); } } diff --git a/tss-esapi/src/structures/tagged/public/rsa.rs b/tss-esapi/src/structures/tagged/public/rsa.rs index 4203a29a..8539dfc8 100644 --- a/tss-esapi/src/structures/tagged/public/rsa.rs +++ b/tss-esapi/src/structures/tagged/public/rsa.rs @@ -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"); 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)); } }