tpm2: downgrade most log functions from error to debug

Because most TPM2 functions here are 'library-like' functions, they should be
at debug level, not error level.

The only functions not reduced to logging at debug are tpm2_list_devices(),
since it is expected to print output, and the tpm2_parse_pcr_argument_*()
functions, since the system-wide parse_*_argument() functions generally log at
error level.
This commit is contained in:
Dan Streetman
2023-10-03 17:13:50 +01:00
committed by Luca Boccassi
parent d3dde190c1
commit f9a0ee7554
11 changed files with 220 additions and 214 deletions
+2 -2
View File
@@ -198,7 +198,7 @@ static int load_public_key_tpm2(struct public_key_data *ret) {
r = tpm2_context_new(arg_tpm2_device, &c);
if (r < 0)
return r;
return log_error_errno(r, "Failed to create TPM2 context: %m");
r = tpm2_get_or_create_srk(
c,
@@ -208,7 +208,7 @@ static int load_public_key_tpm2(struct public_key_data *ret) {
/* ret_qname= */ NULL,
NULL);
if (r < 0)
return r;
return log_error_errno(r, "Failed to get or create SRK: %m");
if (r > 0)
log_info("New SRK generated and stored in the TPM.");
else