Skip to content

Commit ff3c06d

Browse files
committed
Improve error messages of Public{Ecc,Rsa}ParametersBuilder
Signed-off-by: Simon Brand <simon.brand@postadigitale.de>
1 parent 6fccc4d commit ff3c06d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tss-esapi/src/structures/tagged/public/ecc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ impl PublicEccParametersBuilder {
155155
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
156156
}
157157
} else {
158-
error!("Found symmetric parameter, expected it to be Null nor not set at all because 'restricted' and 'is_decrypt_key' are set to false");
158+
error!("Symmetric parameter was not set but 'restricted' and 'is_decrypt_key' are set to true");
159159
return Err(Error::local_error(WrapperErrorKind::ParamsMissing));
160160
}
161161
} else if let Some(symmetric) = self.symmetric {
162162
if !symmetric.is_null() {
163-
error!("Found symmetric parameter, expected it to be Null nor not set at all because 'restricted' and 'is_decrypt_key' are set to false");
163+
error!("Found symmetric parameter, expected it to be Null or not set at all because 'restricted' or 'is_decrypt_key' are set to false");
164164
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
165165
}
166166
}

tss-esapi/src/structures/tagged/public/rsa.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ impl PublicRsaParametersBuilder {
155155
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
156156
}
157157
} else {
158-
error!("Found symmetric parameter, expected it to be Null nor not set at all because 'restricted' and 'is_decrypt_key' are set to false");
158+
error!("Symmetric parameter was not set but 'restricted' and 'is_decrypt_key' are set to true");
159159
return Err(Error::local_error(WrapperErrorKind::ParamsMissing));
160160
}
161161
} else if let Some(symmetric) = self.symmetric {
162162
if !symmetric.is_null() {
163-
error!("Found symmetric parameter, expected it to be Null nor not set at all because 'restricted' and 'is_decrypt_key' are set to false");
163+
error!("Found symmetric parameter, expected it to be Null or not set at all because 'restricted' or 'is_decrypt_key' are set to false");
164164
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
165165
}
166166
}

0 commit comments

Comments
 (0)