[glib-networking/pgriffis/pkcs11-pin-handling] gnutls-pkcs11: Use debug messages rather than warnings for internal errors
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/pgriffis/pkcs11-pin-handling] gnutls-pkcs11: Use debug messages rather than warnings for internal errors
- Date: Wed, 26 May 2021 19:24:05 +0000 (UTC)
commit ea415ee41ca53dfc997229497a543fc1c891feb3
Author: Patrick Griffis <pgriffis igalia com>
Date: Wed May 26 14:22:13 2021 -0500
gnutls-pkcs11: Use debug messages rather than warnings for internal errors
These aren't really actionable or caused by programmer errors and
make tests harder to write for properly handling these cases.
tls/gnutls/gtlscertificate-gnutls.c | 2 +-
tls/gnutls/gtlsconnection-gnutls.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/tls/gnutls/gtlscertificate-gnutls.c b/tls/gnutls/gtlscertificate-gnutls.c
index 9d81cce..04c0238 100644
--- a/tls/gnutls/gtlscertificate-gnutls.c
+++ b/tls/gnutls/gtlscertificate-gnutls.c
@@ -528,7 +528,7 @@ g_tls_certificate_gnutls_copy (GTlsCertificateGnutls *gnutls,
status = gnutls_privkey_import_pkcs11_url (*pkey,
gnutls->private_key_pkcs11_uri ?
gnutls->private_key_pkcs11_uri : gnutls->pkcs11_uri);
if (status != GNUTLS_E_SUCCESS)
- g_warning ("Failed to copy PKCS #11 private key: %s", gnutls_strerror (status));
+ g_debug ("Failed to copy PKCS #11 private key: %s", gnutls_strerror (status));
}
else
{
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index bc3f9c8..0f587ae 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -267,9 +267,9 @@ on_pin_request (void *userdata,
switch (result)
{
case G_TLS_INTERACTION_FAILED:
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_warning ("Error getting PIN: %s", error->message);
- g_error_free (error);
+ if (error)
+ g_debug ("Error getting PIN: %s", error->message);
+ g_clear_error (&error);
break;
case G_TLS_INTERACTION_UNHANDLED:
break;
@@ -278,7 +278,7 @@ on_pin_request (void *userdata,
gsize password_size;
const guchar *password_data = g_tls_password_get_value (password, &password_size);
if (password_size > pin_max)
- g_warning ("PIN is larger than max PIN size");
+ g_debug ("PIN is larger than max PIN size");
memcpy (pin, password_data, MIN (password_size, pin_max));
ret = GNUTLS_E_SUCCESS;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]