You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
3.0 KiB
64 lines
3.0 KiB
7 months ago
|
From 5819204528f5086b3772ca6caccfb23f55e01339 Mon Sep 17 00:00:00 2001
|
||
|
From: Dan Streetman <ddstreet@ieee.org>
|
||
|
Date: Mon, 21 Aug 2023 19:06:38 -0400
|
||
|
Subject: [PATCH] tpm2: make logging level consistent at debug for some
|
||
|
functions
|
||
|
|
||
|
(cherry picked from commit ed35ac31557722530e174e474b0be1b21bac53a4)
|
||
|
|
||
|
Related: RHEL-16182
|
||
|
---
|
||
|
src/shared/tpm2-util.c | 12 ++++++------
|
||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||
|
|
||
|
diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c
|
||
|
index f29515be14..48bb25a417 100644
|
||
|
--- a/src/shared/tpm2-util.c
|
||
|
+++ b/src/shared/tpm2-util.c
|
||
|
@@ -3556,7 +3556,7 @@ int tpm2_tpm2b_public_from_openssl_pkey(const EVP_PKEY *pkey, TPM2B_PUBLIC *ret)
|
||
|
size_t x_size, y_size;
|
||
|
r = ecc_pkey_to_curve_x_y(pkey, &curve_id, &x, &x_size, &y, &y_size);
|
||
|
if (r < 0)
|
||
|
- return log_error_errno(r, "Could not get ECC key curve/x/y: %m");
|
||
|
+ return log_debug_errno(r, "Could not get ECC key curve/x/y: %m");
|
||
|
|
||
|
TPM2_ECC_CURVE curve;
|
||
|
r = tpm2_ecc_curve_from_openssl_curve_id(curve_id, &curve);
|
||
|
@@ -3569,13 +3569,13 @@ int tpm2_tpm2b_public_from_openssl_pkey(const EVP_PKEY *pkey, TPM2B_PUBLIC *ret)
|
||
|
|
||
|
r = TPM2B_ECC_PARAMETER_CHECK_SIZE(x_size);
|
||
|
if (r < 0)
|
||
|
- return log_error_errno(r, "ECC key x size %zu too large.", x_size);
|
||
|
+ return log_debug_errno(r, "ECC key x size %zu too large.", x_size);
|
||
|
|
||
|
public.unique.ecc.x = TPM2B_ECC_PARAMETER_MAKE(x, x_size);
|
||
|
|
||
|
r = TPM2B_ECC_PARAMETER_CHECK_SIZE(y_size);
|
||
|
if (r < 0)
|
||
|
- return log_error_errno(r, "ECC key y size %zu too large.", y_size);
|
||
|
+ return log_debug_errno(r, "ECC key y size %zu too large.", y_size);
|
||
|
|
||
|
public.unique.ecc.y = TPM2B_ECC_PARAMETER_MAKE(y, y_size);
|
||
|
|
||
|
@@ -3588,17 +3588,17 @@ int tpm2_tpm2b_public_from_openssl_pkey(const EVP_PKEY *pkey, TPM2B_PUBLIC *ret)
|
||
|
size_t n_size, e_size;
|
||
|
r = rsa_pkey_to_n_e(pkey, &n, &n_size, &e, &e_size);
|
||
|
if (r < 0)
|
||
|
- return log_error_errno(r, "Could not get RSA key n/e: %m");
|
||
|
+ return log_debug_errno(r, "Could not get RSA key n/e: %m");
|
||
|
|
||
|
r = TPM2B_PUBLIC_KEY_RSA_CHECK_SIZE(n_size);
|
||
|
if (r < 0)
|
||
|
- return log_error_errno(r, "RSA key n size %zu too large.", n_size);
|
||
|
+ return log_debug_errno(r, "RSA key n size %zu too large.", n_size);
|
||
|
|
||
|
public.unique.rsa = TPM2B_PUBLIC_KEY_RSA_MAKE(n, n_size);
|
||
|
public.parameters.rsaDetail.keyBits = n_size * 8;
|
||
|
|
||
|
if (sizeof(uint32_t) < e_size)
|
||
|
- return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||
|
+ return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
|
||
|
"RSA key e size %zu too large.", e_size);
|
||
|
|
||
|
uint32_t exponent = 0;
|